svn commit: r1085341 - in /ofbiz/trunk/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: r1085341 - in /ofbiz/trunk/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:01:01 2011
New Revision: 1085341

URL: http://svn.apache.org/viewvc?rev=1085341&view=rev
Log:
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/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
    ofbiz/trunk/applications/product/data/ProductTypeData.xml

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1085341&r1=1085340&r2=1085341&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Fri Mar 25 12:01:01 2011
@@ -2410,6 +2410,7 @@ public class PaymentGatewayServices {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                     "AccountingPaymentRefundError", locale));
         }
+        refundResponse.putAll(ServiceUtil.returnSuccess("Payment #" + refundResponse.get("paymentId") +" is refunded successfully with amount " + refundResponse.get("refundAmount") +" for manual transaction."));
         return refundResponse;
     }
 

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1085341&r1=1085340&r2=1085341&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Fri Mar 25 12:01:01 2011
@@ -1772,6 +1772,14 @@ public class ProductPromoWorker {
                     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/trunk/applications/product/data/ProductTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/data/ProductTypeData.xml?rev=1085341&r1=1085340&r2=1085341&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/data/ProductTypeData.xml (original)
+++ ofbiz/trunk/applications/product/data/ProductTypeData.xml Fri Mar 25 12:01:01 2011
@@ -434,6 +434,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"/>