Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030019Openbravo ERP09. Financial managementpublic2015-05-26 09:422015-06-22 11:35
malsasua 
aferraz 
immediateminoralways
closedfixed 
20Community Appliance
 
3.0PR15Q2.3 
vmromanos
Core
No
0030019: 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 30019.diff (9,220) 2015-06-19 12:21
https://issues.openbravo.com/file_download.php?file_id=8219&type=bug
Issue History
2015-05-26 18:11aferrazTypedefect => backport
2015-05-26 18:11aferrazTarget Version => 3.0PR15Q2.2
2015-05-27 11:00dmitry_mezentsevTag Attached: Approved
2015-05-28 18:57hgbotCheckin
2015-05-28 18:57hgbotNote Added: 0077874
2015-05-28 18:57hgbotStatusscheduled => resolved
2015-05-28 18:57hgbotResolutionopen => fixed
2015-05-28 18:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/c7f004f2815dd0c7b9d389bb5e1eadaab83111f0 [^]
2015-05-28 18:58vmromanosReview Assigned To => vmromanos
2015-05-28 18:58vmromanosNote Added: 0077877
2015-05-28 18:58vmromanosStatusresolved => closed
2015-06-17 14:42aferrazStatusclosed => new
2015-06-17 14:42aferrazResolutionfixed => open
2015-06-17 19:00hgbotCheckin
2015-06-17 19:00hgbotNote Added: 0078346
2015-06-18 09:36aferrazTarget Version3.0PR15Q2.2 => 3.0PR15Q2.3
2015-06-19 12:10vmromanosStatusnew => scheduled
2015-06-19 12:21vmromanosFile Added: 30019.diff
2015-06-19 12:21vmromanosNote Added: 0078392
2015-06-19 12:22vmromanosNote Edited: 0078392bug_revision_view_page.php?bugnote_id=0078392#r8855
2015-06-22 11:35hgbotCheckin
2015-06-22 11:35hgbotNote Added: 0078407
2015-06-22 11:35hgbotStatusscheduled => resolved
2015-06-22 11:35hgbotResolutionopen => fixed
2015-06-22 11:35hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/c7f004f2815dd0c7b9d389bb5e1eadaab83111f0 [^] => http://code.openbravo.com/erp/backports/3.0PR15Q2.3/rev/6b3505a5370e8829b13058b5449e2d8bb45cd73b [^]
2015-06-22 11:35vmromanosNote Added: 0078408
2015-06-22 11:35vmromanosStatusresolved => closed

Notes
(0077874)
hgbot   
2015-05-28 18:57   
Repository: erp/backports/3.0PR15Q2.2
Changeset: c7f004f2815dd0c7b9d389bb5e1eadaab83111f0
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 28 13:02:49 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/c7f004f2815dd0c7b9d389bb5e1eadaab83111f0 [^]

Fixes issue 30019: 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
---
(0077877)
vmromanos   
2015-05-28 18:58   
Code review + testing OK
(0078346)
hgbot   
2015-06-17 19:00   
Repository: erp/backports/3.0PR15Q2.2
Changeset: 38993c090dd0e079d603ee11f1440f442c266ba1
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 17 14:27:39 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/38993c090dd0e079d603ee11f1440f442c266ba1 [^]

Related to issue 30019: Backout changeset c7f004f2815d

---
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
---
(0078392)
vmromanos   
2015-06-19 12:21   
(edited on: 2015-06-19 12:22)
Attached is the right fix.
Blocked until backport repo is created

(0078407)
hgbot   
2015-06-22 11:35   
Repository: erp/backports/3.0PR15Q2.3
Changeset: 6b3505a5370e8829b13058b5449e2d8bb45cd73b
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.0PR15Q2.3/rev/6b3505a5370e8829b13058b5449e2d8bb45cd73b [^]

Fixes issue 30019: 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
---
(0078408)
vmromanos   
2015-06-22 11:35   
Code review + testing OK