Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032678Openbravo ERPZ. Otherspublic2016-04-15 13:012018-02-22 17:23
maite 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q33.0PR16Q3 
aferraz
Advanced Payables and Receivables Mngmt
No
0032678: Wrong schedule details when purchase order is not fully invoiced and related invoices have partial payment terms
payment schedule detail related with the order (corresponding with part pending of invoicing) is lost when processing second invoice
0. Create new Payment Term named "30-60" and set "offset month due"=2 in header. Add line with "percentage due"=50 and "offset month due"=1
1. Register Purchase Order for Bebidas Alegres using "30-60" payment term. Add line for any product and qty=800. Add another line for different product and qty=200. Process Order
2. Register Purchase Invoice for Bebidas Alegres using "30-60" payment term. Run "Create lines from" and select line of 800units. NOT process invoice
3. Register Purchase Invoice for Bebidas Alegres using "30-60" payment term. Run "Create lines from" and select line of 800units. Edit line to set qty=-320 units. NOT process invoice
4. Process first invoice
5. Process second invoice. Run "Add payment" and realize that details are not correct (so if you select proposed details to pay invoice amount will be higher than invoice's amount)

NOTE: problem seems to be related with pending detail only related with the order, which is lost when processing second invoice
No tags attached.
related to defect 0033500 closed AtulOpenbravo Wrong payment schedule details when return to vendor document is invoiced using credit a memo invoice 
related to defect 0036637 closed collazoandy4 Include in QA client dataset a payment term that split into more than just one payment 
Issue History
2016-04-15 13:01maiteNew Issue
2016-04-15 13:01maiteAssigned To => Triage Finance
2016-04-15 13:01maiteModules => Advanced Payables and Receivables Mngmt
2016-04-15 13:01maiteResolution time => 1463695200
2016-04-15 13:01maiteTriggers an Emergency Pack => No
2016-04-19 17:48maiteIssue Monitored: networkb
2016-04-21 10:25aferrazAssigned ToTriage Finance => AtulOpenbravo
2016-05-09 09:30AtulOpenbravoStatusnew => scheduled
2016-05-11 17:53AtulOpenbravoNote Added: 0086386
2016-05-12 11:01psanjuanNote Added: 0086390
2016-05-12 11:09psanjuanNote Edited: 0086390bug_revision_view_page.php?bugnote_id=0086390#r12063
2016-05-12 12:13psanjuanNote Added: 0086392
2016-05-12 12:52psanjuanNote Added: 0086396
2016-05-12 12:58psanjuanNote Edited: 0086396bug_revision_view_page.php?bugnote_id=0086396#r12069
2016-05-12 12:59psanjuanNote Added: 0086397
2016-05-12 13:07psanjuanNote Edited: 0086397bug_revision_view_page.php?bugnote_id=0086397#r12071
2016-05-12 13:12psanjuanNote Edited: 0086397bug_revision_view_page.php?bugnote_id=0086397#r12072
2016-05-12 13:20psanjuanNote Edited: 0086397bug_revision_view_page.php?bugnote_id=0086397#r12073
2016-05-12 13:21psanjuanNote Edited: 0086397bug_revision_view_page.php?bugnote_id=0086397#r12074
2016-05-12 13:22psanjuanNote Edited: 0086386bug_revision_view_page.php?bugnote_id=0086386#r12076
2016-05-12 13:25psanjuanNote Added: 0086398
2016-05-12 13:27psanjuanNote Edited: 0086398bug_revision_view_page.php?bugnote_id=0086398#r12078
2016-05-12 13:32psanjuanNote Edited: 0086397bug_revision_view_page.php?bugnote_id=0086397#r12079
2016-05-12 13:33psanjuanNote Edited: 0086390bug_revision_view_page.php?bugnote_id=0086390#r12080
2016-05-12 13:35psanjuanNote Edited: 0086398bug_revision_view_page.php?bugnote_id=0086398#r12081
2016-05-12 13:42psanjuanNote Added: 0086399
2016-05-12 14:48psanjuanNote Added: 0086406
2016-05-16 18:08hgbotCheckin
2016-05-16 18:08hgbotNote Added: 0086475
2016-05-16 18:08hgbotStatusscheduled => resolved
2016-05-16 18:08hgbotResolutionopen => fixed
2016-05-16 18:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7eb95ad4b19b9eb48ee8df9eaf575dd79acccbcb [^]
2016-05-16 18:09aferrazReview Assigned To => aferraz
2016-05-16 18:09aferrazNote Added: 0086477
2016-05-16 18:09aferrazStatusresolved => closed
2016-05-16 18:09aferrazFixed in Version => 3.0PR16Q3
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087540
2016-08-10 13:42aferrazRelationship addedrelated to 0033500
2017-08-21 14:26aferrazRelationship addedrelated to 0036637
2018-02-22 17:22hgbotCheckin
2018-02-22 17:22hgbotNote Added: 0102624
2018-02-22 17:23hgbotCheckin
2018-02-22 17:23hgbotNote Added: 0102632

Notes
(0086386)
AtulOpenbravo   
2016-05-11 17:53   
(edited on: 2016-05-12 13:22)
Test Plan
- Login as F&B International group admin.
- Create new Payment Term named "30-60" and set "offset month due"=2 in header. Add line with "percentage due"=50 and "offset month due"=1.
- Register Purchase Order for "Bebidas Alegres" using "30-60" payment term. Add line for any product and qty=800. Add another line for different product and qty=200. Process Order.
- Register Purchase Invoice for "Bebidas Alegres" using "30-60" payment term. Run "Create lines from" and select line of 800 units. Do not process invoice.
- Register Purchase Invoice for Bebidas Alegres using "30-60" payment term. Run "Create lines from" and select line of 800units. Edit line to set qty=-320 units. Do not process invoice.
- Process first invoice.
- Process second invoice.
- Run "Add payment" and check that details are correct (If you select proposed details to pay invoice amount will be equal to invoice's amount).

(0086390)
psanjuan   
2016-05-12 11:01   
(edited on: 2016-05-12 13:33)
Issue reproduced as below:

- Create new Payment Term named "30-60" and set "offset month due"=2 in header. Add line with "percentage due"=50 and "offset month due"=1

- Go to Business Partner window and relate this new payment term to "Bebidas Alegres" BP.

- Register Purchase Order for Bebidas Alegres using "30-60" payment term. Add line for any product and qty=800, price = 1.00 and exempt VAT. Add another line for different product and qty=200, price = 1.00 and exempt VAT. Process the Order, therefore total gross amount of the order is 1000.00

- Register a Purchase Invoice for Bebidas Alegres using "30-60" payment term. Dated on 12 May 2016. Run "Create lines from" and select line of 800 units line from the order. DO NOT process invoice

- Register another Purchase Invoice for Bebidas Alegres using "30-60" payment term. Dated on 12 May 2016. Run "Create lines from" and select line of 800 units once more from the order. Edit the line to set qty=-320 units. DO NOT process invoice

- Process first invoice. Run "Add payment" in this first invoice and realize that details are correct :
13-06-2016 Outstanding Amount = 400.00
12-07-2016 Outstanding Amount = 400.00

- Process second invoice. Run "Add payment" in this second invoice and realize that details are not correct:
13-06-2016 Outstanding Amount = -1240.00 (this is not correct)
12-07-2016 Outstanding Amount = -160.00 (this is correct -320.00/2)

Actual payment shown is = -1400.00

(0086392)
psanjuan   
2016-05-12 12:13   
Another way to reproduce the issue:
- Create a purchase order same way as described above.
- Create a goods receipt from the line of 800 units and receipt only 480
- Create a purchase invoice from the receipt and change invoiced qty = 800
- Create another purchase invoice from the receipt for an amount of -320. Press Add Payment for this invoice and you will be able to check that payment details are not correct.
(0086396)
psanjuan   
2016-05-12 12:52   
(edited on: 2016-05-12 12:58)
Test Plan 1

- create a purchase order same way as described above.
- create a goods receipt from the order. Receipt all units of product 800+200
- create a purchase invoice from the receipt for one line, 800 product unit line. Complete. Verify add payment details are correct 400.00+400.00
- create a purchase invoice from the receipt for second line, 200 product unit line. Complete.Verify add payment details are correct 100.00+100.00

Test Plan 2

- create a purchase order same way as described above.
- create a goods receipt from the order. Receipt all units of product 800+200
- create a purchase invoice from the receipt for the two lines, 800 product unit line and 200 product line. Complete. Verify add payment details are correct 500.00+500.00

(0086397)
psanjuan   
2016-05-12 12:59   
(edited on: 2016-05-12 13:32)
Test Plan 3

- Create a purchase order same way as described above.
- Create a goods receipt from the line of 800 units and receipt only 480
- Create a purchase invoice from the receipt and change invoiced qty = 800. Verify add payment details are correct (400.00+400.00)
- Create another purchase invoice from the receipt. Check that the amount shown is -320, which is correct.
- Press Add Payment for this invoice and check they are correct -160.00+-160.00

Test Plan 4

- Create a purchase order same way as described above.
- Create a goods receipt from the line of 200 units and receipt only 180
- Create a purchase invoice from the receipt and change invoiced qty = 200. Verify add payment details are correct (100.00+100.00)
- Create another purchase invoice from the receipt. Check that the amount shown is -20, which is correct.
- Press Add Payment for this invoice and check they are correct -10.00+-10.00

Test Plan 5

- Create a purchase order same way as described above.
- Create a goods receipt from the line of 800 units and receipt only 480, add another line for the line of 200 units, and receipt only 180
- Create a purchase invoice from the receipt line 1 and change invoiced qty = 800 and line 2 and change invoice qty= 200.00. Verify add payment details are correct (500.00+500.00)
- Create another purchase invoice from the receipt. Check that the amount shown is for line 1 -320 and for line 2 -20, which is correct. Complete the invoice.
- Press Add Payment for this invoice and check they are correct -170.00+-170.00

Repeat same test as above but with negative amounts in the purchase order, that purchase order line 1 -800 units and purchase order line 2 -200.
Check that same behavior is shown.

(0086398)
psanjuan   
2016-05-12 13:25   
(edited on: 2016-05-12 13:35)
Test Plan 6

- Create a purchase order same way as described above. Complete the order.
- Create a purchase invoice by using "Create lines from", select line of 800 units. Do not process the invoice.
- Register another purchase invoice by using once more "Create lines from", select once again line of 800 units. Edit line to set qty=-320 units. Do not process invoice.
- Process first invoice. Run "Add payment" and check that the details shown in there are correct. (400.00+400.00)
- Process second invoice. Run "Add payment" and check that the details shown in there are correct.(-160.00+-160.00)

Repeat same test as above but for a purchase order including negative amounts. Line 1 -800 and line -200

(0086399)
psanjuan   
2016-05-12 13:42   
Test Plan 7

- Go to business partner window and relate "30 days" payment term to Bebidas BP.
- Create a purchase order same way as described above. Complete the order.
- Create a goods receipt from the order. Select line of 800 units and receipt only 480 units. Book the receipt.
- Create a purchase invoice for the receipt, change the invoices qty to 800. Complete the invoice.
- Create another purchase invoice for the receipt, check that invoice qty is -320 which is ok. Complete the invoice.
(0086406)
psanjuan   
2016-05-12 14:48   
Test Plan above verified.

Issue can be code reviewed and closed.
(0086475)
hgbot   
2016-05-16 18:08   
Repository: erp/devel/pi
Changeset: 7eb95ad4b19b9eb48ee8df9eaf575dd79acccbcb
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed May 11 21:13:35 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7eb95ad4b19b9eb48ee8df9eaf575dd79acccbcb [^]

Fixes Issue 32678:Wrong schedule details when purchase order is not fully
invoiced and related invoices have partial payment terms

While getting related order schedule, sign of quantity is checked

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
---
(0086477)
aferraz   
2016-05-16 18:09   
Code review OK
(0087540)
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
(0102624)
hgbot   
2018-02-22 17:22   
Repository: tools/automation/int
Changeset: 5379c33ecb83b3264f4e58a66f7e1ec73f516279
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Sep 05 10:34:06 2017 -0400
URL: http://code.openbravo.com/tools/automation/int/rev/5379c33ecb83b3264f4e58a66f7e1ec73f516279 [^]

Related to issue 32678: Added some automated test

---
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression32678.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression32678.java
---
(0102632)
hgbot   
2018-02-22 17:23   
Repository: tools/automation/int
Changeset: 365ca5aae6964e79c181f28b963f9344021e7eb1
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Wed Oct 18 21:31:06 2017 -0400
URL: http://code.openbravo.com/tools/automation/int/rev/365ca5aae6964e79c181f28b963f9344021e7eb1 [^]

Related to issue 32678: Fix tests flow execution

---
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRIn_Regressions3/APRIn_RegressionSuite3.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRIn_Regressions3/APRRegression32678In.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APROut_Regressions3/APROut_RegressionSuite3.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APROut_Regressions3/APRRegression32678Out.java
---