Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036476Openbravo ERP07. Sales managementpublic2017-07-12 12:362017-09-21 16:49
ngarcia 
collazoandy4 
immediatemajoralways
closedfixed 
5
 
3.0PR17Q4 
vmromanos
Core
Production - Confirmed Stable
2016-11-18
3.0PR17Q1
https://code.openbravo.com/erp/devel/pi/rev/7232cc0b37a99b4ed3f897372b1e97bcb2fe84a5#l10.73 [^]
No
0036476: Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered
Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered

The problem happens when sum(qtyordered) = sum(qtydelivered)
In a version previous to 3.0PR17Q1:
   As group admin role:
      Create a sales order
      Add -2 units of a product
      Add 2 units of another product
      Complete it
      Create a Goods Shipment header and check you can select the order in Create Lines From
      Do not select it

   As system admin role:
      Upgrade the instance to 3.0PR17Q1 (or later)
   
   As group admin role:
      Go to Goods Shipment header and check you cannot select the order in Create Lines From
No tags attached.
depends on backport 00364823.0PR17Q3 closed collazoandy4 Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered 
depends on backport 00364833.0PR17Q2.2 closed collazoandy4 Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered 
depends on backport 00364843.0PR17Q1.3 closed collazoandy4 Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered 
caused by design defect 00346123.0PR17Q1 closed vmromanos Performance problem in Return To Vendor Shipment 
? affected_orders.sql (477) 2017-07-21 08:48
https://issues.openbravo.com/file_download.php?file_id=10929&type=bug
? fix_query.sql (478) 2017-07-21 08:48
https://issues.openbravo.com/file_download.php?file_id=10930&type=bug
Issue History
2017-07-12 12:36ngarciaNew Issue
2017-07-12 12:36ngarciaAssigned To => Triage Finance
2017-07-12 12:36ngarciaModules => Core
2017-07-12 12:36ngarciaResolution time => 1501624800
2017-07-12 12:36ngarciaTriggers an Emergency Pack => No
2017-07-12 12:37ngarciaRelationship addedcaused by 0034612
2017-07-12 12:38ngarciaIssue Monitored: networkb
2017-07-12 12:38ngarciaSummaryCannot add sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered => Cannot add some sales order lines to goods shipments after upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered
2017-07-12 12:38ngarciaDescription Updatedbug_revision_view_page.php?rev_id=15497#r15497
2017-07-12 13:24vmromanosAssigned ToTriage Finance => collazoandy4
2017-07-12 16:25collazoandy4Statusnew => scheduled
2017-07-12 22:16collazoandy4Statusscheduled => acknowledged
2017-07-12 22:19collazoandy4Statusacknowledged => scheduled
2017-07-13 16:23collazoandy4Note Added: 0098065
2017-07-14 23:46collazoandy4Note Edited: 0098065bug_revision_view_page.php?bugnote_id=0098065#r15521
2017-07-20 16:01vmromanosRegression level => Production - Confirmed Stable
2017-07-20 16:01vmromanosRegression date => 2016-11-18
2017-07-20 16:01vmromanosRegression introduced in release => 3.0PR17Q1
2017-07-20 16:01vmromanosRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/7232cc0b37a99b4ed3f897372b1e97bcb2fe84a5#l10.73 [^]
2017-07-21 08:31hgbotCheckin
2017-07-21 08:31hgbotNote Added: 0098163
2017-07-21 08:31hgbotStatusscheduled => resolved
2017-07-21 08:31hgbotResolutionopen => fixed
2017-07-21 08:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/570ce3b92b6965c01400aa95c687deb71d872bae [^]
2017-07-21 08:34vmromanosReview Assigned To => vmromanos
2017-07-21 08:34vmromanosNote Added: 0098170
2017-07-21 08:34vmromanosStatusresolved => closed
2017-07-21 08:34vmromanosFixed in Version => 3.0PR17Q4
2017-07-21 08:48vmromanosFile Added: affected_orders.sql
2017-07-21 08:48vmromanosFile Added: fix_query.sql
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099282

Notes
(0098065)
collazoandy4   
2017-07-13 16:23   
(edited on: 2017-07-14 23:46)
Test Plan
 In a version previous to 3.0PR17Q1:
   As group admin role:
      Go to Sales Order window and create a new record for bp Alimentos y Supermercados, S.A:
        Add -2 units of Cerveza Ale 0,5L product
        Add 2 units of Cerveza Lager 0,5L product
        Complete it
      Create a Goods Shipment header and check you can select the previous order created (1000189) in Create Lines From
        Do not select it
      Go to Sales Order window and create a new record for bp Alimentos y Supermercados, S.A:
        Add 5 units of Vino Blanco 0,75L product
        Add -5 units of Vino Rosado 0,75L product
        Add 2 units of Vino Tinto 0,75L product
        Complete it
      Go to Goods Shipment window and select the previous one created and select the previous order created (1000190) in Create Lines From and select all order lines
        Edit the lines to 3 units of Vino Blanco 0,75L, -3 units of Vino Rosado 0,75L products and complete the shipment
      Go to Sales Order window and select previous order (1000190) and check:
        Product: Vino Blanco 0,75L, Ordered Quantity: 5 Delivered Quantity: 3
        Product: Vino Rosado 0,75L, Ordered Quantity: -5 Delivered Quantity: -3
        Product: Vino Tinto 0,75L, Ordered Quantity: 2 Delivered Quantity: 2
        Product: Descuento 10%, Ordered Quantity: 1 Delivered Quantity: 1
      Create a Goods Shipment header and check you can select the previous order created (1000190) in Create Lines From
        Do not select it
      Go to Sales Order window and create a new record for bp Alimentos y Supermercados, S.A:
        Add 5 units of Cerveza Ale 0,5L product
        Add -4 units of Cerveza Lager 0,5L product
        Remove the record in Basic discount tab and Complete it
        Check no discount line was added to Lines tab
      Go to Goods Shipment and check you can select the previous order created (1000191) in Create Lines From
        Do not select it
      Go to Sales Order window and create a new record for bp Alimentos y Supermercados, S.A:
        Add 8 units of Vino Blanco 0,75L product
        Add -6 units of Vino Rosado 0,75L product
        Add 3 units of Vino Tinto 0,75L product
        Remove the record in Basic discount and Complete it
      Go to Goods Shipment window and select the previous one created and select the previous order created (1000192) in Create Lines From and select all order lines
        Edit the lines to 5 units of Vino Blanco 0,75L, 1 Vino Tinto 0,75L products and complete the shipment
      Go to Sales Order window and select previous order (1000192) and check:
        Product: Vino Blanco 0,75L, Ordered Quantity: 8 Delivered Quantity: 5
        Product: Vino Rosado 0,75L, Ordered Quantity: -6 Delivered Quantity: -6
        Product: Vino Tinto 0,75L, Ordered Quantity: 3 Delivered Quantity: 1
      Create a Goods Shipment header and check you can select the previous order created (1000192) in Create Lines From
        Do not select it
   As system admin role:
      Upgrade the instance to 3.0PR17Q1 (or later)
   As group admin role:
      Go to Goods Shipment header and check you can select the orders 1000189, 1000190, 1000191, and 1000192 in Create Lines From
        Select the order 1000189 and Complete the Shipment
      Go to Sales Order and check the Sales Order is with Delivery Status: 100% and Delivered: Yes
      Void the last shipment and check the order change the Delivery Status: 0%, Delivered: No and you can select it in Create Lines From process in the shipment window

(0098163)
hgbot   
2017-07-21 08:31   
Repository: erp/devel/pi
Changeset: 570ce3b92b6965c01400aa95c687deb71d872bae
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Jul 18 11:06:02 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/570ce3b92b6965c01400aa95c687deb71d872bae [^]

Fixes issue 36476: Cannot add some sales order lines to goods shipments after
upgrading to 3.0PR17Q1 as a modulescript set the order as isdelivered

Cannot add some sales order lines to goods shipments because the modulescript
set the order as isdelivered when the order contains lines with negative qtyordered
and the sum(qtyordered) = sum(qtydelivered)

Now the update only happend when the order don't have a line where
QTYORDERED <> QTYDELIVERED.

Because the NOT EXISTS change the check to issotrx field now is made in the main
query because a wrong evaluation in the subquery happends when issotrx = 'N' and
NOT EXISTS

---
M src-db/database/model/functions/M_INOUT_POST.xml
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateQtyDeliveredData.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdateQtyDelivered_data.xsql
---
(0098170)
vmromanos   
2017-07-21 08:34   
Code review + testing OK
(0099282)
hudsonbot   
2017-09-21 16:49   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test