Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034226Openbravo ERP03. Procurement managementpublic2016-10-17 19:062016-12-16 18:38
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Core
No
0034226: Requisition lines with same product are grouped only if their line number is consecutive
Requisition lines with same product are grouped only if their line number is consecutive. The solution of the 25114 seems not to be correct
As group admin role:
   Create a Requisition add a product and complete it
   Create a new Requisition, add the same product and complete it
   Create a new Requisition, add two different products and the same product in the line 30 and complete it
   Go to Requisition To Order window
   Select all the previously created lines and click on Add
   Select all the previously created lines and click on Create
   Check in the created purchase order that the first two requisition lines have been grouped but the line with the same product of the third requisition is on a different purchase order line
No tags attached.
related to defect 00251143.0PR14Q2 closed AtulOpenbravo Requisition to order process does not maintain the order of the requisition lines 
Issue History
2016-10-17 19:06ngarciaNew Issue
2016-10-17 19:06ngarciaAssigned To => Triage Finance
2016-10-17 19:06ngarciaModules => Core
2016-10-17 19:06ngarciaResolution time => 1478473200
2016-10-17 19:06ngarciaTriggers an Emergency Pack => No
2016-10-17 19:06ngarciaRelationship addedrelated to 0025114
2016-10-17 19:06ngarciaIssue Monitored: networkb
2016-10-20 19:19aferrazAssigned ToTriage Finance => markmm82
2016-10-20 20:26markmm82Statusnew => scheduled
2016-10-24 15:31markmm82Note Added: 0090822
2016-11-08 09:31hgbotCheckin
2016-11-08 09:31hgbotNote Added: 0091218
2016-11-08 09:31hgbotStatusscheduled => resolved
2016-11-08 09:31hgbotResolutionopen => fixed
2016-11-08 09:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e498cedad5a54fc68f06a51b3837fd3d24487820 [^]
2016-11-08 09:31hgbotCheckin
2016-11-08 09:31hgbotNote Added: 0091219
2016-11-08 09:35aferrazReview Assigned To => aferraz
2016-11-08 09:35aferrazNote Added: 0091220
2016-11-08 09:35aferrazStatusresolved => closed
2016-11-08 09:35aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092598
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092599

Notes
(0090822)
markmm82   
2016-10-24 15:31   
Test Plan:
As group admin role:
   Create a Requisition to Bebidas Alegres bp.
     Add 10 Units of Agua sin Gas 1L product and complete it (Line 10)
   Create a Requisition to Bebidas Alegres bp.
     Add 20 Units of Agua sin Gas 1L product and complete it (Line 10)
   Create a Requisition to Bebidas Alegres bp.
     Add 10 Units of Cerveza Ale 0,5L product and complete it (Line 10)
     Add 10 Units of Cerveza Lager 0,5Lproduct and complete it (Line 20)
     Add 30 Units of Agua sin Gas 1L product and complete it (Line 30)
   Go to Requisition To Order window
     Notice the order is
       Line 10 of the first Requisition (Agua sin Gas 1L)
       Line 10 of the second Requisition (Agua sin Gas 1L)
       Line 10 of the third Requisition (Cerveza Ale 0,5L)
       Line 20 of the third Requisition (Cerveza Lager 0,5L)
       Line 30 of the third Requisition (Agua sin Gas 1L)
   Select all the previously created lines and click on Add
     Notice the order of lines remain the same
   Select all the previously created lines and click on Create
   Check in the created purchase order that lines left as:
     Line 10: 60 Units of Agua sin Gas 1L (Grouped the 3 lines of requisitions)
     Line 20: 10 Units of Cerveza Ale 0,5L
     Line 30: 10 Units of Cerveza Lager 0,5L
     Lines with the same product of the third requisition have been grouped in the first purchase order line and the order remains.

Test Plan 2 (related to issue 25114)
As group admin role:
   Create a Requisition to Bebidas Alegres bp.
     Add 1 Units of Vino Tinto 0,75L product and complete it (Line 10)
     Add 1 Units of Cerveza Lager 0,5L product and complete it (Line 20)
     Add 1 Units of Agua sin Gas 1L product and complete it (Line 30)
     Add 1 Units of Cerveza Ale 0,5L product and complete it (Line 40)
     Add 1 Units of Cola de Cereza 0,5L product and complete it (Line 50)
   Complete it.
   Go to Requisition To Order window
     Notice the order of lines is the same than the requisition.
   Select all the previously created lines and click on Add
     Notice the order of lines remain the same.
   Select all the previously created lines and click on Create
   Check in the created purchase order and notice that the process does maintain the original order.
(0091218)
hgbot   
2016-11-08 09:31   
Repository: erp/devel/pi
Changeset: e498cedad5a54fc68f06a51b3837fd3d24487820
Author: Mark <markmm82 <at> gmail.com>
Date: Fri Nov 04 18:58:07 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/e498cedad5a54fc68f06a51b3837fd3d24487820 [^]

Fixes issue 34226: Requisition lines with same product are correctly grouped

Selection of lines in Requisition to Order process always try to maintain the
original order of the lines where the order is created from.
To do that, it first order by line number and then by product, this guarantees
the order but lines with same attributes set (product, attribute, description,
price and UOM) could be no consecutives and not correctly grouped.

To make a correct grouping, was changed the logic of always expect consecutive
products. Before creating the new purchase order line all existing lines
with same attribute set are grouped into a unique line with the total of the
order quantities in a Hash Map object. Then, purchase order lines are created
from the Hash Map containing lines with totals of the originals lines with same
attributes set.

---
M src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java
---
(0091219)
hgbot   
2016-11-08 09:31   
Repository: erp/devel/pi
Changeset: 0be9fca7e99562cbf98a40b9fd67849f07769ad2
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Nov 07 20:40:24 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0be9fca7e99562cbf98a40b9fd67849f07769ad2 [^]

Related to issue 34226: Code review improvements

Remove second unneeded loop. For each line, if it has a valid key in the hash map, existing order line will be updated, otherwise, a new order line will be inserted.

---
M src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java
M src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql
---
(0091220)
aferraz   
2016-11-08 09:35   
Code review + Testing OK
(0092598)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test
(0092599)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test