Author: deepak
Date: Sat Jan 16 10:41:51 2016
New Revision: 1724951
URL:
http://svn.apache.org/viewvc?rev=1724951&view=revLog:
(OFBIZ-6806) Applied patch from jira issue OFBIZ-6806
============================================================
Order Item with multiple qty reserved with multiple inventory item not correctly recorded into Shipment_Item_Billing
============================================================
Thanks Swapnil Shah for reporting the issue and Ankush for providing the patch.
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=1724951&r1=1724950&r2=1724951&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat Jan 16 10:41:51 2016
@@ -490,8 +490,12 @@ public class InvoiceServices {
}
if ("ItemIssuance".equals(currentValue.getEntityName())) {
+ /* Find ShipmentItemBilling based on shipmentId, shipmentItemSeqId, invoiceId, invoiceItemSeqId as
+ because if any order item has multiple quantity and reserved by multiple inventories then there will be multiple invoice items.
+ In that case ShipmentItemBilling was creating only for one invoice item. Fixed under OFBIZ-6806.
+ */
List<GenericValue> shipmentItemBillings = EntityQuery.use(delegator).from("ShipmentItemBilling")
- .where("shipmentId", currentValue.get("shipmentId"), "shipmentItemSeqId", currentValue.get("shipmentItemSeqId"))
+ .where("shipmentId", currentValue.get("shipmentId"), "shipmentItemSeqId", currentValue.get("shipmentItemSeqId"), "invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId)
.queryList();
if (UtilValidate.isEmpty(shipmentItemBillings)) {