Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032729Openbravo ERP07. Sales managementpublic2016-04-20 14:072018-02-22 18:18
maite 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q33.0PR16Q3 
aferraz
Core
No
0032729: Invoices not properly grouped by order in case shipment lines are not ordered by order in shipment document
When 2 sales orders (from a business partner defined with "Invoice grouping= by order") are related with 1 goods shipment, more invoices than order are generated in case lines from same order are not consecutive in shipment lines
1. Access, as System Administrator, to "Reference" window and search "Scheduled invoice grouping" reference. Access "List" tab and add option "010000000000000" with name "group by order"
2. Access, as System Administrator, to Business Partner window | Customer tab and set "Invoice grouping" field as "Displayed"
3. Compile application using "ant smartbuild" and restart tomcat
4. Access to Business Partner window and configure any customer with "Invoice grouping= group by order"
5. Register Sales Order for this bp, add 2 lines setting different products and process
6. Register another sales order for same bp, add another 2 lines setting different products and process
7. Access Goods Shipment window, run "Create Lines from" process and select previous orders. Realize that 4 lines are added: first 2 lines belong to order1 and rest to order2
8. Modify first line to set "Line no"=40. Modify last line to set "Line no"=10. (Ensuring that lines from same order are not consecutive). Process shipment
9. Access "Create invoices from orders" form, select both orders and process

Realize that 4 invoices are created instead of 2 invoices
No tags attached.
related to defect 0038238 closed collazoandy4 Error in Create Invoices From Orders for orders shipped in different organizations and business partner with invoice grouping 
diff c_invoice_create.diff (677) 2016-04-21 18:08
https://issues.openbravo.com/file_download.php?file_id=9311&type=bug
Issue History
2016-04-20 14:07maiteNew Issue
2016-04-20 14:07maiteAssigned To => Triage Finance
2016-04-20 14:07maiteModules => Core
2016-04-20 14:07maiteResolution time => 1463263200
2016-04-20 14:07maiteTriggers an Emergency Pack => No
2016-04-20 14:08maiteIssue Monitored: networkb
2016-04-21 10:18aferrazAssigned ToTriage Finance => AtulOpenbravo
2016-04-21 18:08maiteFile Added: c_invoice_create.diff
2016-04-27 04:24AtulOpenbravoStatusnew => scheduled
2016-04-27 04:24AtulOpenbravoNote Added: 0086004
2016-05-02 14:23psanjuanNote Added: 0086122
2016-05-02 15:25psanjuanNote Edited: 0086122bug_revision_view_page.php?bugnote_id=0086122#r11934
2016-05-02 15:25psanjuanNote Edited: 0086004bug_revision_view_page.php?bugnote_id=0086004#r11936
2016-05-02 15:27psanjuanNote Added: 0086123
2016-05-02 15:27psanjuanNote Edited: 0086123bug_revision_view_page.php?bugnote_id=0086123#r11938
2016-05-02 15:35psanjuanNote Edited: 0086123bug_revision_view_page.php?bugnote_id=0086123#r11939
2016-05-02 18:25psanjuanNote Edited: 0086123bug_revision_view_page.php?bugnote_id=0086123#r11940
2016-05-02 18:28psanjuanNote Added: 0086134
2016-05-03 15:10hgbotCheckin
2016-05-03 15:10hgbotNote Added: 0086157
2016-05-03 15:10hgbotStatusscheduled => resolved
2016-05-03 15:10hgbotResolutionopen => fixed
2016-05-03 15:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0a36e7951257c2ce31f550721c3bf1ed748fa95a [^]
2016-05-03 15:10aferrazReview Assigned To => aferraz
2016-05-03 15:10aferrazNote Added: 0086158
2016-05-03 15:10aferrazStatusresolved => closed
2016-05-03 15:10aferrazFixed in Version => 3.0PR16Q3
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087513
2018-01-17 17:08hgbotCheckin
2018-01-17 17:08hgbotNote Added: 0101761
2018-01-17 17:08hgbotCheckin
2018-01-17 17:08hgbotNote Added: 0101762
2018-02-22 18:18hudsonbotCheckin
2018-02-22 18:18hudsonbotNote Added: 0102662
2018-02-22 18:18hudsonbotCheckin
2018-02-22 18:18hudsonbotNote Added: 0102663
2018-04-13 09:21aferrazRelationship addedrelated to 0038238

Notes
(0086004)
AtulOpenbravo   
2016-04-27 04:24   
(edited on: 2016-05-02 15:25)
Test Plan
- Login as System Administrator, to "Reference" window and search "Scheduled invoice grouping" reference. Access "List" tab and add option "010000000000000" with name "Group by order"
- In Application Dictionary >> Windows Tabs and Fields >> Business Partner window | Customer tab and set "Invoice grouping" field as "Displayed"
- Compile application using "ant smartbuild" and restart tomcat.
- Login as F&B International Group Admin.
- Go to Business Partner window and configure customer "Moon Light" with "Invoice grouping= Group by order"
- Register Sales Order for this bp, add 2 lines setting different products and process. Products: Ale Beer, Lager Beer
- Register another sales order for same bp, add another 2 lines setting different products and process. Products: Red Wine, Rose Windw
- Access Goods Shipment window, run "Create Lines from" process and select previous orders and EC-0-0-0 as Storage Locator. Check that 4 lines are added: first 2 lines belong to order1 and rest to order2.
- Modify first line to set "Line no"=40. Modify last line to set "Line no"=10. (Ensuring that lines from same order are not consecutive).
- Process shipment
- Go to "Create invoices from orders" form, select both orders and process
- Check only that 2 invoices are created instead of 4 as prior to fix.

(0086122)
psanjuan   
2016-05-02 14:23   
(edited on: 2016-05-02 15:25)
Issue can be reproduced if Business Partner selected is configured this way:
Invoice Terms : After delivery
Invoice Grouping: Group by order

(0086123)
psanjuan   
2016-05-02 15:27   
(edited on: 2016-05-02 18:25)
Test Plan 1

- Login as System Administrator, to "Reference" window and search "Scheduled invoice grouping" reference. Access "List" tab and add option "010000000000000" with name "Group by order"

- In Application Dictionary >> Windows Tabs and Fields >> Business Partner window | Customer tab and set "Invoice grouping" field as "Displayed"

- Compile application using "ant smartbuild" and restart tomcat.

- Login as F&B International Group Admin.

- Go to Business Partner window and configure customer "Moon Light" with "Invoice grouping= Group by order" and "Invoice Terms = After delivery".

- Register Sales Order for this bp, add 2 lines setting different products and process. Products: Ale Beer, Lager Beer

- Register another sales order for same bp, add another 2 lines setting different products and process. Products: Red Wine, Rose Wine

- Access Goods Shipment window, run "Create Lines from" process and select previous orders and EC-0-0-0 as Storage Locator. Check that 4 lines are added: first 2 lines belong to order 1 and rest to order 2.

- Modify first line to set "Line no"=40. Modify last line to set "Line no"=10. (Ensuring that lines from same order are not consecutive).

- Process shipment

- Go to "Create invoices from orders" form, search by Moon Light Restaurants, and select both orders. Enter an invoice date and process

- Check only that 2 invoices are created instead of 4 as prior to fix.

Test Plan 2

- Go to Business Partner window and configure customer "Moon Light" with "Invoice grouping= By Customer" and "Invoice Terms = After delivery".

- Repeat test plan I above.

- Make sure only one invoice is created.


Test Plan 3

- Go to Business Partner window and configure customer "Moon Light" with "Invoice grouping= By Ship Location" and "Invoice Terms = After delivery".

- Repeat test plan I above by making sure the same location (storage bin) is selected in goods shipment lines.

- Make sure only one invoice is created.

(0086134)
psanjuan   
2016-05-02 18:28   
Test Plan above verified.

Issue can be code reviewed and closed.
(0086157)
hgbot   
2016-05-03 15:10   
Repository: erp/devel/pi
Changeset: 0a36e7951257c2ce31f550721c3bf1ed748fa95a
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Apr 26 21:25:13 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/0a36e7951257c2ce31f550721c3bf1ed748fa95a [^]

Fixes Issue 32729:In Create Invoice From Orders, Group by Order does not
working properly in case related shipment have lines from different order
not in consequent sequence of order

In case there are lines from different order in same Goods Shipment,
order field in shipment header is set as blank and order information
should be fetched from shipment lines order line field

Additional change done in this fix related with Group by Currency No of
zeros were set as 8 prior to 1 which was for used for grouping Payment Term.
9 is correct for Currency.

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
---
(0086158)
aferraz   
2016-05-03 15:10   
Code review + Testing OK
(0087513)
hudsonbot   
2016-06-17 19:37   
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/0dc7be081b1c [^]
Maturity status: Test
(0101761)
hgbot   
2018-01-17 17:08   
Repository: erp/devel/pi
Changeset: a773422cce1f4bc3c9aa737e7ab3436dd1bdd33b
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Wed Jan 17 16:56:19 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a773422cce1f4bc3c9aa737e7ab3436dd1bdd33b [^]

Added test for issue 32729

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0101762)
hgbot   
2018-01-17 17:08   
Repository: erp/devel/pi
Changeset: 7918fd33ee2351a4d01dfaa68bdf94e378c9758e
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Jan 17 17:05:17 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7918fd33ee2351a4d01dfaa68bdf94e378c9758e [^]

Related to Issue 32729. Code Review changes

Improvmentes in automated tests:
* Set more meaningful names
* Avoid Dal refresh when possible
* Set final to parameters in methods when possible

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0102662)
hudsonbot   
2018-02-22 18:18   
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/980a6ad5bbf5 [^]
Maturity status: Test
(0102663)
hudsonbot   
2018-02-22 18:18   
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/980a6ad5bbf5 [^]
Maturity status: Test