Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030020Openbravo ERP09. Financial managementpublic2015-05-26 09:422016-08-17 00:00
malsasua 
aferraz 
immediateminoralways
closedfixed 
20Community Appliance
 
3.0PR15Q1.6 
vmromanos
Core
No
0030020: Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order
Payment schedule amount incorrectly calculated when adding a payment from financial account reconcile window to a sales order
- Create a sales order from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 and book it.
- Go to the Financial Account "Cuenta de Banco"
- Click on tab "Imported Bank Statement"
- Click on new, give it a name, and go to "Bank Statement Lines" tab.
- Click on new, give it a reference, choose "Alimentos y Supermercados, S.A" business partner, set amount in to 1,000.
- Click on save and process, and Match Statement.
- Click on "+" icon to create a transaction.
- Click on Add Payment In/Out
- Choose transaction type "Orders", set the amount to 1,000.
- Select just the 1,000 order created in the previous step.
- Click on process, and choose "Process Received payment/s and deposit", and click on Ok.
- Go to the sales order, and realize that payment schedule record says:
Expected Amount: 1,000
Received Amount: 2,000
Outstanding: -1,000
- fin_payment_schedule record is not correctly updated when running the described steps.
- fin_payment_schedule_detail records are ok. The issue is when updating the fin_payment_schedule record.
- Please notice that if you click on "Add Transaction" in Financial Account window, bug is not reproduced, only if AddTransaction servlet is invoqued from the automatic reconcile window.
Approved
blocks defect 0030007 closed aferraz Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order 
diff 30020.diff (9,220) 2015-06-19 12:22
https://issues.openbravo.com/file_download.php?file_id=8220&type=bug
Issue History
2015-05-26 18:11aferrazTypedefect => backport
2015-05-26 18:11aferrazTarget Version => 3.0PR15Q1.5
2015-05-27 11:00dmitry_mezentsevTag Attached: Approved
2015-05-28 18:56hgbotCheckin
2015-05-28 18:56hgbotNote Added: 0077873
2015-05-28 18:56hgbotStatusscheduled => resolved
2015-05-28 18:56hgbotResolutionopen => fixed
2015-05-28 18:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/a8be86693dcab0c1290f5c24bbcba83fb88b62dc [^]
2015-05-28 18:57vmromanosReview Assigned To => vmromanos
2015-05-28 18:57vmromanosNote Added: 0077875
2015-05-28 18:57vmromanosStatusresolved => closed
2015-06-17 14:42aferrazStatusclosed => new
2015-06-17 14:42aferrazResolutionfixed => open
2015-06-17 19:01hgbotCheckin
2015-06-17 19:01hgbotNote Added: 0078348
2015-06-18 09:36aferrazTarget Version3.0PR15Q1.5 => 3.0PR15Q1.6
2015-06-19 12:10vmromanosStatusnew => scheduled
2015-06-19 12:22vmromanosFile Added: 30020.diff
2015-06-19 12:22vmromanosNote Added: 0078393
2015-06-22 11:37hgbotCheckin
2015-06-22 11:37hgbotNote Added: 0078409
2015-06-22 11:37hgbotStatusscheduled => resolved
2015-06-22 11:37hgbotResolutionopen => fixed
2015-06-22 11:37hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/a8be86693dcab0c1290f5c24bbcba83fb88b62dc [^] => http://code.openbravo.com/erp/backports/3.0PR15Q1.6/rev/8821f87d7f6bf37c6b2026df32e9deed9cada476 [^]
2015-06-22 11:37vmromanosNote Added: 0078410
2015-06-22 11:37vmromanosStatusresolved => closed
2016-08-17 00:00eugeniIssue Monitored: eugeni

Notes
(0077873)
hgbot   
2015-05-28 18:56   
Repository: erp/backports/3.0PR15Q1.5
Changeset: a8be86693dcab0c1290f5c24bbcba83fb88b62dc
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 28 12:33:42 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/a8be86693dcab0c1290f5c24bbcba83fb88b62dc [^]

Fixes issue 30020: Payment schedule amount incorrectly calculated.

Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order.
FIN_TransactionProcess and PaidStatusEventHandler have been changed in order to set invoicepaid=true only when FIN_PaymentScheduleDetail has a related InvoicePaymentSchedule.
FIN_PaymentProcess.java has also been changed, in order to check invoicePaidAmounts only if FIN_PaymentScheduleDetail has a related InvoicePaymentSchedule.
In case of a payment to a order without an invoice, updatePaymentAmounts will be called only once.
Name of preference in UpdatePaymentPlan modulescript has been update to run it again and fix wrong data created by the issue.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
M src/org/openbravo/event/PaidStatusEventHandler.java
---
(0077875)
vmromanos   
2015-05-28 18:57   
Code review + testing OK
(0078348)
hgbot   
2015-06-17 19:01   
Repository: erp/backports/3.0PR15Q1.5
Changeset: 3b90dd290e71e109c0f0f0731c84f130767918bc
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 17 14:28:09 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/3b90dd290e71e109c0f0f0731c84f130767918bc [^]

Related to issue 30020: Backout changeset a8be86693dca

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
M src/org/openbravo/event/PaidStatusEventHandler.java
---
(0078393)
vmromanos   
2015-06-19 12:22   
Attached is the right fix.
Blocked until backport repo is created
(0078409)
hgbot   
2015-06-22 11:37   
Repository: erp/backports/3.0PR15Q1.6
Changeset: 8821f87d7f6bf37c6b2026df32e9deed9cada476
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 17 18:53:46 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.6/rev/8821f87d7f6bf37c6b2026df32e9deed9cada476 [^]

Fixes issue 30020: Payment schedule amount incorrectly calculated

FIN_PaymentProcess was not setting isinvoicepaid = true when processing a payment related to an order.
Also, APRM_ISPAYMENTCONFIRMED function, was not taking into account isinvoicepaid when checking if a payment related to an order was confirmed.
Name of preference in UpdatePaymentPlan modulescript has been update to run it again and fix wrong data created by the issue.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
M src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
M src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
---
(0078410)
vmromanos   
2015-06-22 11:37   
Code review + testing OK