svn commit: r1085342 - in /ofbiz/branches/release10.04/applications: accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java product/data/ProductTypeData.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1085342 - in /ofbiz/branches/release10.04/applications: accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java product/data/ProductTypeData.xml

ashish-18
Author: ashish
Date: Fri Mar 25 12:05:39 2011
New Revision: 1085342

URL: http://svn.apache.org/viewvc?rev=1085342&view=rev
Log:
Hand merge from trunk r1085341- Following bug fixes are being taken care in this commit.
-- Tax % discount was not working when we were applying a promotion in which we were doing order grand total to ZERO.
-- showing appropriate message when payment is refunded for manual transaction.
Thanks Amit.

Modified:
    ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
    ofbiz/branches/release10.04/applications/product/data/ProductTypeData.xml

Modified: ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1085342&r1=1085341&r2=1085342&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/branches/release10.04/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Fri Mar 25 12:05:39 2011
@@ -2323,6 +2323,7 @@ public class PaymentGatewayServices {
             Debug.logError(e, "Problem refunding payment through processor", module);
             return ServiceUtil.returnError("Refund processor problems; see logs");
         }
+        refundResponse.putAll(ServiceUtil.returnSuccess("Payment #" + refundResponse.get("paymentId") +" is refunded successfully with amount " + refundResponse.get("refundAmount") +" for manual transaction."));
         return refundResponse;
     }
 

Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1085342&r1=1085341&r2=1085342&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Fri Mar 25 12:05:39 2011
@@ -1657,6 +1657,14 @@ public class ProductPromoWorker {
                 actionResultInfo.ranAction = true;
                 actionResultInfo.totalDiscountAmount = amount;
             }
+        } else if ("PROMO_TAX_PERCENT".equals(productPromoActionEnumId)) {
+            BigDecimal percentage = (productPromoAction.get("amount") == null ? BigDecimal.ZERO : (productPromoAction.getBigDecimal("amount").movePointLeft(2))).negate();
+            BigDecimal amount = cart.getTotalSalesTax().multiply(percentage);
+            if (amount.compareTo(BigDecimal.ZERO) != 0) {
+                doOrderPromoAction(productPromoAction, cart, amount, "amount", delegator);
+                actionResultInfo.ranAction = true;
+                actionResultInfo.totalDiscountAmount = amount;
+            }
         } else {
             Debug.logError("An un-supported productPromoActionType was used: " + productPromoActionEnumId + ", not performing any action", module);
             actionResultInfo.ranAction = false;

Modified: ofbiz/branches/release10.04/applications/product/data/ProductTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/product/data/ProductTypeData.xml?rev=1085342&r1=1085341&r2=1085342&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/product/data/ProductTypeData.xml (original)
+++ ofbiz/branches/release10.04/applications/product/data/ProductTypeData.xml Fri Mar 25 12:05:39 2011
@@ -405,6 +405,7 @@ under the License.
     <Enumeration description="Product for [Special Promo] Price" enumCode="PROD_SPPRC" enumId="PROMO_PROD_SPPRC" sequenceId="08" enumTypeId="PROD_PROMO_ACTION"/>
     <Enumeration description="Shipping X% discount" enumCode="SHIP_CHARGE" enumId="PROMO_SHIP_CHARGE" sequenceId="09" enumTypeId="PROD_PROMO_ACTION"/>
     <Enumeration description="Call Service" enumCode="SERVICE" enumId="PROMO_SERVICE" sequenceId="10" enumTypeId="PROD_PROMO_ACTION"/>
+    <Enumeration description="Tax % Discount" enumCode="TAX_PERCENT" enumId="PROMO_TAX_PERCENT" sequenceId="11" enumTypeId="PROD_PROMO_ACTION"/>
 
     <EnumerationType description="Product Rating Field Type" enumTypeId="PROD_RATING_TYPE" hasTable="N" parentTypeId=""/>
     <Enumeration description="Min Rating" enumCode="MIN" enumId="PRDR_MIN" sequenceId="01" enumTypeId="PROD_RATING_TYPE"/>