Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030007Openbravo ERP09. Financial managementpublic2015-05-26 09:422016-02-02 09:36
malsasua 
aferraz 
immediateminoralways
closedfixed 
20Community Appliance
 
 
vmromanos
Core
Production - Confirmed Stable
2014-04-03
3.0PR14Q2
https://code.openbravo.com/erp/devel/pi/rev/f7078a85289e6c61918f567b28d2df3fe17ddb47 [^]
No
0030007: 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.
No tags attached.
duplicate of defect 0028236 closed pramakrishnan Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order 
related to defect 00292383.0PR15Q2 closed umartirena Transactions created from "Match Statement" process are created in Draft status 
related to defect 00288603.0PR15Q2 closed Sandrahuguet UpdatePaymentPlan modulscript takes long when updating from a version lower than q3 to q3. 
related to defect 0030009 closed aferraz UpdatePaymentPlan modulscript takes hours to finish updating from mp31 to PR15Q2 
depends on backport 00300193.0PR15Q2.3 closed aferraz Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order 
depends on backport 00300203.0PR15Q1.6 closed aferraz Payment schedule amount incorrectly calculated when adding a payment from reconcile window to a sales order 
depends on defect 00300823.0PR15Q3 closed jorge-garcia Payment plan is updating wrong in some circunstancies 
caused by feature request 00293903.0PR14Q4 closed Sandrahuguet Reconciliation refactor project 
blocks defect 00301703.0PR15Q3 closed aferraz Generic UpdatePaymentPlan module script 
causes defect 00300953.0PR15Q3 closed aferraz BP current balance not properly updated when generating credit from Payment In/Out 
causes defect 00301663.0PR15Q3 closed aferraz Wrong order payment plan with isinvoicepaid feature 
Issue History
2015-05-26 09:42malsasuaNew Issue
2015-05-26 09:42malsasuaAssigned To => Triage Finance
2015-05-26 09:42malsasuaModules => Core
2015-05-26 09:42malsasuaTriggers an Emergency Pack => No
2015-05-26 15:27aferrazAssigned ToTriage Finance => aferraz
2015-05-26 18:11aferrazStatusnew => scheduled
2015-05-26 18:28aferrazRelationship addedcaused by 0029390
2015-05-26 18:29aferrazRelationship addedduplicate of 0028236
2015-05-26 18:29aferrazRelationship addedrelated to 0029238
2015-05-26 18:30aferrazRelationship addedrelated to 0028860
2015-05-26 18:31aferrazRegression level => Production - Confirmed Stable
2015-05-26 18:31aferrazRegression date => 2015-03-12
2015-05-26 18:31aferrazRegression introduced in release => 3.0PR15Q1.2
2015-05-26 18:31aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f7078a85289e6c61918f567b28d2df3fe17ddb47 [^]
2015-05-26 18:36txasuIssue Monitored: txasu
2015-05-28 09:27aferrazNote Added: 0077852
2015-05-28 09:27aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8680
2015-05-28 09:28aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8681
2015-05-28 09:40aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8682
2015-05-28 09:41aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8683
2015-05-28 10:02aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8687
2015-05-28 10:23aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8688
2015-05-28 10:54aferrazRelationship addedrelated to 0030009
2015-05-28 11:26aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8690
2015-05-28 18:58hgbotCheckin
2015-05-28 18:58hgbotNote Added: 0077876
2015-05-28 18:58hgbotStatusscheduled => resolved
2015-05-28 18:58hgbotResolutionopen => fixed
2015-05-28 18:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/aed0c66779e9442c6c92010951125f28179c0e1e [^]
2015-05-28 18:58vmromanosReview Assigned To => vmromanos
2015-05-28 18:58vmromanosNote Added: 0077878
2015-05-28 18:58vmromanosStatusresolved => closed
2015-05-29 17:24hudsonbotCheckin
2015-05-29 17:24hudsonbotNote Added: 0077903
2015-06-02 18:05SandrahuguetRegression date2015-03-12 => 2014-04-03
2015-06-02 18:05SandrahuguetRegression introduced in release3.0PR15Q1.2 => 3.0PR14Q2
2015-06-04 14:00aferrazRelationship addedcauses 0030095
2015-06-17 13:43aferrazStatusclosed => new
2015-06-17 13:43aferrazResolutionfixed => open
2015-06-17 14:47aferrazRelationship addedblocks 0030166
2015-06-18 12:21hgbotCheckin
2015-06-18 12:21hgbotNote Added: 0078366
2015-06-18 12:43aferrazRelationship deletedblocks 0030166
2015-06-18 12:43aferrazRelationship addedcauses 0030166
2015-06-18 18:32hudsonbotCheckin
2015-06-18 18:32hudsonbotNote Added: 0078382
2015-06-19 11:54aferrazNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8852
2015-06-19 12:10vmromanosStatusnew => scheduled
2015-06-19 12:18hgbotCheckin
2015-06-19 12:18hgbotNote Added: 0078390
2015-06-19 12:18hgbotStatusscheduled => resolved
2015-06-19 12:18hgbotResolutionopen => fixed
2015-06-19 12:18hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/aed0c66779e9442c6c92010951125f28179c0e1e [^] => http://code.openbravo.com/erp/devel/pi/rev/a1b8bf010d175767b49d7f9dc325220ff2c7ba92 [^]
2015-06-19 12:19vmromanosNote Edited: 0077852bug_revision_view_page.php?bugnote_id=0077852#r8853
2015-06-19 12:20vmromanosNote Added: 0078391
2015-06-19 12:20vmromanosStatusresolved => closed
2015-06-19 23:57hudsonbotCheckin
2015-06-19 23:57hudsonbotNote Added: 0078399
2015-06-22 11:56vmromanosRelationship addedblocks 0030170
2015-06-22 11:58vmromanosRelationship addeddepends on 0030082
2016-02-02 09:36hgbotCheckin
2016-02-02 09:36hgbotNote Added: 0083818

Notes
(0077852)
aferraz   
2015-05-28 09:27   
(edited on: 2015-06-19 12:19)
Test Plan 1:

- Create a sales order from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 amount and book it.

- Go to the Financial Account "Cuenta de Banco"
  Create a new record in "Imported Bank Statement"
  Add a record in "Bank Statement Lines" tab with "Alimentos y Supermercados, S.A" business partner and amount in to 1,000.
  Process it.

- Click on Match Statement.
  Click on "+" icon to create a transaction.
  Click on "+" icon of Payment field to add a payment

- In Add Payment process, choose "Transferencia" payment method and transaction type "Orders".
  Select just the 1,000 order created in the previous step.
  Choose "Process Received Payment/s", and click on Done.
  Click on Done in Add Transaction process.
  Click on Ok in Match Statement process.

- Go to the created Sales Order.
  Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 1,000
  Outstanding: 0


Test Plan 2:

- Create a sales order from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 amount and book it.

- Create a goods shipment from the sales order and complete it.

- Create a sales invoice from the goods shipment and complete it.

- Go to the Financial Account "Cuenta de Banco"
  Create a new record in "Imported Bank Statement"
  Add a record in "Bank Statement Lines" tab with "Alimentos y Supermercados, S.A" business partner and amount in to 1,000.
  Process it.

- Click on Match Statement.
  Click on "+" icon to create a transaction.
  Click on "+" icon of Payment field to add a payment

- In Add Payment process, choose "Transferencia" payment method and transaction type "Invoices".
  Select just the 1,000 invoice created in the previous step.
  Choose "Process Received Payment/s", and click on Done.
  Click on Done in Add Transaction process.
  Click on Ok in Match Statement process.

- Go to the created Sales Order.
  Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 1,000
  Outstanding: 0

- Go to the created Sales Invoice.
  Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 1,000
  Outstanding: 0


Test Plan 3:

- Go to Preference window and create a record for "Allow to use invoice paid status control" property and value = Y

- Create a sales order from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 amount and book it.

- Go to the Financial Account "Cuenta de Banco"
  Go to "Transferencia" Payment Method.
  Set Invoice Paid Status = Payment Cleared in Payment In and Payment Out.

- Go to the Financial Account "Cuenta de Banco"
  Create a new record in "Imported Bank Statement"
  Add a record in "Bank Statement Lines" tab with "Alimentos y Supermercados, S.A" business partner and amount in to 1,000.
  Process it.

- Click on Match Statement.
  Click on "+" icon to create a transaction.
  Click on "+" icon of Payment field to add a payment

- In Add Payment process, choose "Transferencia" payment method and transaction type "Orders".
  Select just the 1,000 order created in the previous step.
  Choose "Process Received Payment/s", and click on Done.
  Click on Done in Add Transaction process.
  Click on Ok in Match Statement process.

- Go to the created Sales Order.
  Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 1,000
  Outstanding: 0


Test Plan 4:

- Go to Preference window and create a record for "Allow to use invoice paid status control" property and value = Y

- Create a sales invoice from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 amount and book it.

- Go to the Financial Account "Cuenta de Banco"
  Go to "Transferencia" Payment Method.
  Set Invoice Paid Status = Payment Cleared in Payment In and Payment Out.

- Go to the Financial Account "Cuenta de Banco"
  Create a new record in "Imported Bank Statement"
  Add a record in "Bank Statement Lines" tab with "Alimentos y Supermercados, S.A" business partner and amount in to 1,000.
  Process it.

- Click on Match Statement.
  Click on "+" icon to create a transaction.
  Click on "+" icon of Payment field to add a payment

- In Add Payment process, choose "Transferencia" payment method and transaction type "Invoices".
  Select just the 1,000 invoice created in the previous step.
  Choose "Process Received Payment/s", and click on Done.
  Click on Done in Add Transaction process.
  Click on Ok in Match Statement process.

- Go to the created Sales Invoice.
  Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 1,000
  Outstanding: 0


Test Plan 5:

- Go to Preference window and create a record for "Allow to use invoice paid status control" property and value = Y

- Go to the Financial Account "Cuenta de Banco"
  Go to "Transferencia" Payment Method.
  Set Invoice Paid Status = Payment Cleared in Payment In and Payment Out.

- Create a sales order from "F&B España - Región Norte" org to BP "Alimentos y Supermercados, S.A" for 1,000 amount and book it.
  Click on Add Payment button, and click on Done.

- Realize that Payment Plan record (and Payment Details record also) says:
  Expected Amount: 1,000
  Received: 0
  Outstanding: 1,000


Test Plan 6:

- Register Sales Order for any Org and BP. Set Invoice terms= immediate. Add any line and process order

- Register Sales Invoice using "Create lines from" process from previous order

- Register Payment In for partial amount

- Register another Payment In for rest of amount

- Access Sales Order and Sales Invoice and realize that Payment Plan information is properly updated in both cases

- "Reactivate and delete lines" from second Payment In

- Access Sales Order and Sales Invoice and realize that Payment Plan information is properly updated in both cases

(0077876)
hgbot   
2015-05-28 18:58   
Repository: erp/devel/pi
Changeset: aed0c66779e9442c6c92010951125f28179c0e1e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 28 12:58:25 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/aed0c66779e9442c6c92010951125f28179c0e1e [^]

Fixes issue 30007: 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
---
(0077878)
vmromanos   
2015-05-28 18:58   
Code review + testing OK
(0077903)
hudsonbot   
2015-05-29 17:24   
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/bd6740e1bbd3 [^]
Maturity status: Test
(0078366)
hgbot   
2015-06-18 12:21   
Repository: erp/devel/pi
Changeset: 56e313660729ba9148ad01703190a43a604ae231
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 17 13:50:39 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/56e313660729ba9148ad01703190a43a604ae231 [^]

Related to issue 30007: Backout changeset aed0c66779e9

---
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
---
(0078382)
hudsonbot   
2015-06-18 18:32   
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/42df4e2c6b02 [^]
Maturity status: Test
(0078390)
hgbot   
2015-06-19 12:18   
Repository: erp/devel/pi
Changeset: a1b8bf010d175767b49d7f9dc325220ff2c7ba92
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 17 18:53:46 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a1b8bf010d175767b49d7f9dc325220ff2c7ba92 [^]

Fixes issue 30007: 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
---
(0078391)
vmromanos   
2015-06-19 12:20   
Code review + testing OK
(0078399)
hudsonbot   
2015-06-19 23:57   
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/53058d80de1d [^]
Maturity status: Test
(0083818)
hgbot   
2016-02-02 09:36   
Repository: tools/automation/int
Changeset: bf7d200e031213521d68adb9be0ab62d804b8d7d
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Oct 01 16:20:44 2015 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/bf7d200e031213521d68adb9be0ab62d804b8d7d [^]

Related to issue 30007: Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/data/financial/receivablespayables/transactions/AddTransactionData.java
M src-test/com/openbravo/test/integration/erp/data/financial/receivablespayables/transactions/MatchStatementData.java
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/AddTransactionProcess.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/RegressionSuite.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/build.xml
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression30007In.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression30007Out.java
---