Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030121Openbravo ERPZ. Otherspublic2015-06-03 13:452015-06-12 13:51
jorge-garcia 
jorge-garcia 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q2.2 
vmromanos
Advanced Payables and Receivables Mngmt
Production - Confirmed Stable
2014-07-18
3.0PR14Q3
https://code.openbravo.com/erp/devel/pi/diff/87765308f9bd/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml [^]
No
0030121: Payment plan is updating wrong in some circunstancies
Payment plan is updating wrong if Payment Method is set as Automatic Receipt and a sales order is partially paid.
As group admin role:
   Create a new Payment Method and set Automatic Receipt = 'Y'
   Add it to a financial account.
   Create a Sales Order, set the previously created payment method and Invoice Terms = Immediate.
   Click on Add Payment an create a partial payment for the Sales Order.
   Create a Sales Invoice from it and complete it
   Check the Received field of the Payment Plan of the invoice has been updated with the sum of the full payment and the partial payment of the order and the Outstanding amount is wrong as well.
  Check the payment details of the payment plan from both (order and invoice) are created correctly
Approved
blocks defect 00300823.0PR15Q3 closed jorge-garcia Payment plan is updating wrong in some circunstancies 
Issue History
2015-06-08 11:00jorge-garciaTypedefect => backport
2015-06-08 11:00jorge-garciaTarget Version => 3.0PR15Q2.2
2015-06-09 17:52jorge-garciaRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/77b6251af841 [^] => https://code.openbravo.com/erp/devel/pi/diff/87765308f9bd/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml [^]
2015-06-10 13:27dmitry_mezentsevTag Attached: Approved
2015-06-12 13:46hgbotCheckin
2015-06-12 13:46hgbotNote Added: 0078238
2015-06-12 13:46hgbotCheckin
2015-06-12 13:46hgbotNote Added: 0078239
2015-06-12 13:46hgbotStatusscheduled => resolved
2015-06-12 13:46hgbotResolutionopen => fixed
2015-06-12 13:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/5612ad11863bfd91463028ba7a796cbb9ab0e50d [^]
2015-06-12 13:46hgbotStatusscheduled => resolved
2015-06-12 13:46hgbotCheckin
2015-06-12 13:46hgbotNote Added: 0078241
2015-06-12 13:51vmromanosNote Deleted: 0078239
2015-06-12 13:51vmromanosReview Assigned To => vmromanos
2015-06-12 13:51vmromanosNote Added: 0078247
2015-06-12 13:51vmromanosStatusresolved => closed

Notes
(0078238)
hgbot   
2015-06-12 13:46   
Repository: erp/backports/3.0PR15Q2.2
Changeset: 5612ad11863bfd91463028ba7a796cbb9ab0e50d
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Wed Jun 10 13:09:56 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/5612ad11863bfd91463028ba7a796cbb9ab0e50d [^]

Fixed issue 30121: Payment plan is updating wrong in some circumstances

Payment plan is updating wrong if Payment Method is set as Automatic Receipt
and a sales order is partially paid.

The problem was that the function duplicates the value of the received amount
created in the Complete process of the invoice, because the function searches
all the payment details of the payment plan that has an invoice paid
(invoicepaid column).

The solution is to search those payment details that are not pre-paid and then
update the payment plan.

Now, the values are filled correctly.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
---
(0078241)
hgbot   
2015-06-12 13:46   
Repository: erp/backports/3.0PR15Q2.2
Changeset: 9887ec5384c1ff7b9ed56b52184bf7c7af8b45e2
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Jun 12 12:49:18 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/9887ec5384c1ff7b9ed56b52184bf7c7af8b45e2 [^]

Related to issue 30121: code review improvements

The invoice's payment schedules and payment monitor is only updated when all the payment schedule details are paid.

This changeset covers the scenario where an order is partially paid. Before this change, the invoice's payment schedules and payment monitor were wrongly updated considering that the payment schedule was fully paid when any of its payment schedule details was paid. That asumption may be wrong in some scenarios, for example when the order is associated to one or more payment schedule details not yet paid (isinvoicepaid=N) and at least one already paid.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
---
(0078247)
vmromanos   
2015-06-12 13:51   
Code review + testing OK