# HG changeset patch
# User Atul Gaware <atul.gaware@openbravo.com>
# Date 1462471333 -19800
#      Thu May 05 23:32:13 2016 +0530
# Node ID 811d817dfdab54eddc9e784269ca6a35b93ac4e2
# Parent  a6cbad47ab80b521388ac1d3a211fe5213fe72bd
Fixes issue 33042: Wrong link between SalesInvoice Line and GoodsShipment Line

Partially shipped, when invoice created with Create Invoice from Order having Immediate = Invoice Term, Process Shipment From Order updates
Invoice Line with partial shipment line reference (this is wrong).
M_INOUT_CREATE avoids this update.

diff -r a6cbad47ab80 -r 811d817dfdab src-db/database/model/functions/M_INOUT_CREATE.xml
--- a/src-db/database/model/functions/M_INOUT_CREATE.xml	Wed May 04 16:40:02 2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_CREATE.xml	Thu May 05 23:32:13 2016 +0530
@@ -706,7 +706,8 @@
                 Updated=now(),
                 UpdatedBy=v_User_ID
             WHERE C_ORDERLINE_ID=ol.C_OrderLine_ID
-            AND M_INOUTLINE_ID IS NULL;
+            AND M_INOUTLINE_ID IS NULL
+            AND v_Qty = QtyInvoiced;
             --<<Next_Line>>
             Next_Line:=false;
             FETCH Cur_OrderLine INTO ol;
