Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031457Openbravo ERPZ. Otherspublic2015-11-12 18:422016-06-17 19:37
ngarcia 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
 
dmiguelez
Advanced Payables and Receivables Mngmt
No
0031457: Invoice with negative amount with an order with lower amount is set as not paid. Positive and negative schedule details pending
Invoice with negative amount with an order with lower amount is set as not paid. Positive and negative schedule details pending
As group admin role:
   Create a Sales Order, set it as Invoice Terms = Immediate
   Add a product with a negative quantity and book it (Total gross amount: -200)
   Create a sales invoice header
   Add the previously created order
   Add a positive line (50) in order the total amount to remain negative (Total gross amount: -150)
   Complete it
   Add a payment to it from the Sales Invoice window for the total amount of the invoice (-150)
   Launch the payment report and check the invoice is shown with Awaiting Payment status and an amount of 0
   Check through database two schedule details are pending and associated to the invoice
No tags attached.
causes defect 0032914 closed aferraz Wrong payment status as well payment in details when partially paying a Reversed Sales Invoice 
Issue History
2015-11-12 18:42ngarciaNew Issue
2015-11-12 18:42ngarciaAssigned To => Triage Finance
2015-11-12 18:42ngarciaModules => Core
2015-11-12 18:42ngarciaTriggers an Emergency Pack => No
2015-11-12 18:44ngarciaIssue Monitored: networkb
2015-11-12 18:45ngarciaModulesCore => Advanced Payables and Receivables Mngmt
2015-11-12 19:38heccamIssue Monitored: heccam
2015-12-09 12:02AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-12-09 12:02AtulOpenbravoStatusnew => scheduled
2015-12-29 11:19AtulOpenbravoNote Added: 0083041
2015-12-29 11:19AtulOpenbravoNote Edited: 0083041bug_revision_view_page.php?bugnote_id=0083041#r10550
2015-12-29 11:21AtulOpenbravoNote Edited: 0083041bug_revision_view_page.php?bugnote_id=0083041#r10551
2016-01-13 18:25hgbotCheckin
2016-01-13 18:25hgbotNote Added: 0083267
2016-01-13 18:25hgbotStatusscheduled => resolved
2016-01-13 18:25hgbotResolutionopen => fixed
2016-01-13 18:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cac91026199ded604ae3830c114d42ee26bcc690 [^]
2016-01-13 18:26dmiguelezReview Assigned To => dmiguelez
2016-01-13 18:26dmiguelezNote Added: 0083268
2016-01-13 18:26dmiguelezStatusresolved => closed
2016-03-17 10:54hudsonbotCheckin
2016-03-17 10:54hudsonbotNote Added: 0085043
2016-05-10 14:14aferrazRelationship addedcauses 0032914
2016-05-19 17:34aferrazNote Edited: 0083041bug_revision_view_page.php?bugnote_id=0083041#r12176
2016-05-23 13:43hgbotCheckin
2016-05-23 13:43hgbotNote Added: 0086650
2016-05-23 13:43hgbotCheckin
2016-05-23 13:43hgbotNote Added: 0086653
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087551

Notes
(0083041)
AtulOpenbravo   
2015-12-29 11:19   
(edited on: 2016-05-19 17:34)
Test Plan
- Login as F&B International Group Admin Role.
- Create a Sales Order, set it as Invoice Terms = Immediate
   Add a product with a negative quantity and book it
   (Total gross amount:= -200)
- Create a sales invoice header.
   Add the previously created order.
   Add a positive line (50) in order the total amount to remain negative
   (Total gross amount:= -150)
   Complete it.
- Add a payment to it from the Sales Invoice window for the total amount of the invoice (-150).
- Launch the payment report and check the invoice is shown with Deposited Not Cleared status.
- Check with the following query only two payment schedule details have been created, both related with created payment, one with an amount of -200 related with both the order and the invoice and the other one with an amount of 50 related only with the invoice:

select i.grandtotal, ps.amount, ps.paidamt, ps.outstandingamt, psd.amount, psd.fin_payment_schedule_order, psd.fin_payment_schedule_invoice, psd.fin_payment_detail_id
from c_invoice i
join fin_payment_schedule ps
on i.c_invoice_id = ps.c_invoice_id
join fin_payment_scheduledetail psd
on ps.fin_payment_schedule_id = psd.fin_payment_schedule_invoice
where i.documentno = '<invoice_number>'

Purchase flow verified.

(0083267)
hgbot   
2016-01-13 18:25   
Repository: erp/devel/pi
Changeset: cac91026199ded604ae3830c114d42ee26bcc690
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Dec 29 15:37:32 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/cac91026199ded604ae3830c114d42ee26bcc690 [^]

Fixes Issue 31457:Invoice with negative amount with an order with lower
amount is set as not paid. Positive and negative schedule details pending

Negative amount comparison in Add Payment Action Handler changed.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0083268)
dmiguelez   
2016-01-13 18:26   
Code Review + Testing Ok
(0085043)
hudsonbot   
2016-03-17 10:54   
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/b22fb0500156 [^]
Maturity status: Test
(0086650)
hgbot   
2016-05-23 13:43   
Repository: erp/backports/3.0PR16Q2
Changeset: 4d626559c58861630878ffafd67e9b0380166625
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 19 15:15:02 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q2/rev/4d626559c58861630878ffafd67e9b0380166625 [^]

Fixes issue 32916: Fix properly issue 31457

Change getOrderedPaymentScheduleDetails method in AddPaymentActionHandler class to order by absolute value of FIN_PaymentScheduleDetail.PROPERTY_AMOUNT property.
Change also the manage negative amounts check to recalculate remainingAmount if it is lower than outstandingAmount in case remainingAmount is negative.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0086653)
hgbot   
2016-05-23 13:43   
Repository: erp/devel/pi
Changeset: 036fbe5f521cf65b516c065463160fe59d6b9ef3
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 19 15:15:02 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/036fbe5f521cf65b516c065463160fe59d6b9ef3 [^]

Fixes issue 32914: Fix properly issue 31457

Change getOrderedPaymentScheduleDetails method in AddPaymentActionHandler class to order by absolute value of FIN_PaymentScheduleDetail.PROPERTY_AMOUNT property.
Change also the manage negative amounts check to recalculate remainingAmount if it is lower than outstandingAmount in case remainingAmount is negative.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0087551)
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