Author: jleroux
Date: Sat Jan 31 11:37:14 2015
New Revision: 1656185

URL: http://svn.apache.org/r1656185
Log:
A patch from Youssef Khaye to finally fix "Incorrect quantityNotAvailable for 
OrderItemShipGrpInvRes when issuing items to shipments"   
https://issues.apache.org/jira/browse/OFBIZ-5364 

This patch fixes the problem from a functional point of view and consequently 
the JUnit test in question.

In fact, functionally speaking, The previous patch is not good in measure or it 
does not take into account that an OrderItem might use several lines of stock 
InventoryItem.
orderId     orderItemSeqId  orderItemShipGrpSeqId   InvetoryItemId
10000       000001              10000                               000001
10000       000001              10001                               000001

So by making a stock exit (ItemIssuance) we can afford to cancel the 
reservation lines for the line of stock in question but not all the lines of 
stock.
That's why I added the lines in the inventoryItemId research question and then 
cancel a reservation!

While at it I reverted r1653056 since testMultipleInventoryItemIssuance now 
passes

I think I'm clear.

Thank you and sorry again for my email.
{quote]

Modified:
    
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
    ofbiz/trunk/applications/product/testdef/FacilityTest.xml

Modified: 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=1656185&r1=1656184&r2=1656185&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
 Sat Jan 31 11:37:14 2015
@@ -275,6 +275,7 @@ under the License.
         <entity-and list="oisgirs" entity-name="OrderItemShipGrpInvRes">
             <field-map field-name="orderId" 
from-field="orderItemShipGrpInvRes.orderId"/>
             <field-map field-name="orderItemSeqId" 
from-field="orderItemShipGrpInvRes.orderItemSeqId"/>
+            <field-map field-name="inventoryItemId" 
from-field="orderItemShipGrpInvRes.inventoryItemId"/>
         </entity-and>
         <!-- Need to Cancel and re-reserve oisgir to fix OFBIZ-5364 issue, 
while there are multiple ship groups for an order item associated with same 
inventory and you are issuing items from one ship group to another, then 
quantityNotAvailable will be incorrect if we do not cancel and reserve all 
oisgir of order item  -->
         <iterate entry="oisgir" list="oisgirs">

Modified: ofbiz/trunk/applications/product/testdef/FacilityTest.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/testdef/FacilityTest.xml?rev=1656185&r1=1656184&r2=1656185&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/testdef/FacilityTest.xml (original)
+++ ofbiz/trunk/applications/product/testdef/FacilityTest.xml Sat Jan 31 
11:37:14 2015
@@ -39,8 +39,8 @@ under the License.
         <entity-xml action="load" 
entity-xml-url="component://product/testdef/data/IssuanceTestData.xml"/>
     </test-case>
 
-<!--    <test-case case-name="issuance-tests">
+    <test-case case-name="issuance-tests">
         <junit-test-suite class-name="org.ofbiz.shipment.test.IssuanceTest"/>
     </test-case>
--->
+
 </test-suite>


Reply via email to