Author: ashish
Date: Sat Sep 20 16:30:05 2014
New Revision: 1626476
URL:
http://svn.apache.org/r1626476Log:
Applied bug fix from jira issue - OFBIZ-3833 - Payment capture is less than Order total.
Thanks Mridul for reviewing the patch.
Modified:
ofbiz/trunk/applications/order/servicedef/services.xml
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1626476&r1=1626475&r2=1626476&view=diff==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Sat Sep 20 16:30:05 2014
@@ -256,6 +256,7 @@ under the License.
location="org.ofbiz.order.order.OrderServices" invoke="recalcOrderTax">
<description>Adjust the order tax amount</description>
<attribute name="orderId" type="String" mode="IN"/>
+ <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
</service>
<service name="changeOrderStatus" engine="java" auth="true"
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1626476&r1=1626475&r2=1626476&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Sep 20 16:30:05 2014
@@ -1542,6 +1542,7 @@ public class OrderServices {
LocalDispatcher dispatcher = ctx.getDispatcher();
Delegator delegator = ctx.getDelegator();
String orderId = (String) context.get("orderId");
+ String orderItemSeqId = (String) context.get("orderItemSeqId");
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
@@ -1725,7 +1726,11 @@ public class OrderServices {
Map<String, Object> createOrderAdjContext = new HashMap<String, Object>();
createOrderAdjContext.put("orderAdjustmentTypeId", "SALES_TAX");
createOrderAdjContext.put("orderId", orderId);
- createOrderAdjContext.put("orderItemSeqId", "_NA_");
+ if (UtilValidate.isNotEmpty(orderItemSeqId)) {
+ createOrderAdjContext.put("orderItemSeqId", orderItemSeqId);
+ } else {
+ createOrderAdjContext.put("orderItemSeqId", "_NA_");
+ }
createOrderAdjContext.put("shipGroupSeqId", "_NA_");
createOrderAdjContext.put("description", "Tax adjustment due to order change");
createOrderAdjContext.put("amount", orderTaxDifference);