Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030751Openbravo ERP09. Financial managementpublic2015-09-03 15:352016-02-02 09:35
vmromanos 
vmromanos 
immediatemajoralways
closedfixed 
5
 
 
dmiguelez
Core
Production - Confirmed Stable
2013-11-26
3.0MP30
https://code.openbravo.com/erp/devel/pi/rev/3875daa1b317f2bb28d70d338d45ebc8e4c962b6 [^]
No
0030751: Lines deleted each time you reactivate a payment proposal
Each time you reactivate a payment proposal, at least one payment proposal line is randomly deleted.
As group admin
Make sure you unschedule accounting server process.
Go to Payment Proposal window.
Create a new record. Paying from: Cuenta de Banco. Payment method: Cheque (recommended to use this configuration for testing purposes, but it is reproducible with any configuration)
Press Select Expected Payments. Remove the filter and select all the records.
Write down the number of lines, for example 9
Run Generate Payment process selecting any action.
Now Reactivate the payment proposal.
Realize some payment proposal lines are randomly deleted.
No tags attached.
related to defect 00306853.0PR15Q4 closed vmromanos Error when reactivating payment proposal related with a closed order 
related to defect 00306863.0PR15Q4 closed vmromanos It is not possible to process payment related with a closed order and generated from payment proposal window 
depends on backport 00307523.0PR15Q3.1 closed Triage Omni OMS Lines deleted each time you reactivate a payment proposal 
depends on backport 00307533.0PR15Q2.5 closed Triage Omni OMS Lines deleted each time you reactivate a payment proposal 
caused by defect 00250523.0MP30 closed pramakrishnan Not paid invoices cannot be added to a payment proposal if they are already included in a processed proposal 
Issue History
2015-09-03 15:35vmromanosNew Issue
2015-09-03 15:35vmromanosAssigned To => Triage Finance
2015-09-03 15:35vmromanosModules => Core
2015-09-03 15:35vmromanosRegression level => Production - Confirmed Stable
2015-09-03 15:35vmromanosRegression date => 2013-11-26
2015-09-03 15:35vmromanosRegression introduced in release => 3.0MP30
2015-09-03 15:35vmromanosRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/3875daa1b317f2bb28d70d338d45ebc8e4c962b6 [^]
2015-09-03 15:35vmromanosTriggers an Emergency Pack => No
2015-09-03 15:35vmromanosRelationship addedcaused by 0025052
2015-09-03 15:36vmromanosStatusnew => scheduled
2015-09-03 15:36vmromanosAssigned ToTriage Finance => vmromanos
2015-09-03 15:47vmromanosRelationship addedrelated to 0030685
2015-09-03 15:47vmromanosRelationship addedrelated to 0030686
2015-09-03 15:55vmromanosNote Added: 0080052
2015-09-03 16:01vmromanosNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9337
2015-09-04 11:43psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9346#r9346
2015-09-04 12:05psanjuanNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9351
2015-09-04 12:07psanjuanNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9352
2015-09-04 13:08psanjuanNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9358
2015-09-04 13:08psanjuanNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9359
2015-09-04 13:49psanjuanNote Edited: 0080052bug_revision_view_page.php?bugnote_id=0080052#r9360
2015-09-07 11:58hgbotCheckin
2015-09-07 11:58hgbotNote Added: 0080185
2015-09-07 11:58hgbotStatusscheduled => resolved
2015-09-07 11:58hgbotResolutionopen => fixed
2015-09-07 11:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fcdcb8232dfb9a48bc3f7cb8869ae61d3c7fe49e [^]
2015-09-07 11:58dmiguelezReview Assigned To => dmiguelez
2015-09-07 11:58dmiguelezNote Added: 0080186
2015-09-07 11:58dmiguelezStatusresolved => closed
2015-09-07 21:18hudsonbotCheckin
2015-09-07 21:18hudsonbotNote Added: 0080221
2016-02-02 09:35hgbotCheckin
2016-02-02 09:35hgbotNote Added: 0083806

Notes
(0080052)
vmromanos   
2015-09-03 15:55   
(edited on: 2015-09-04 13:49)
Test plan I:
Go to Payment Proposal window.
Create a new record. Paying from: Cuenta de Banco. Payment method: Cheque (recommended to use this configuration for testing purposes, but it is reproducible with any configuration)
Press Select Expected Payments. Remove the filter and select all the records.
Write down the number of lines, for example 9
Run Generate Payment process selecting any action.
Now Reactivate the payment proposal.
Verify the number of lines continue to be the same

Test Plan II:
Go to Payment Proposal window.
Create a new record. Paying from: Cuenta de Banco. Payment method: Cheque (recommended to use this configuration for testing purposes, but it is reproducible with any configuration)
Press Select Expected Payments. Remove the filter and select part of the records.
Write down the number of lines, for example 5
Run Generate Payment process selecting any action.
Now Reactivate the payment proposal.
Verify the number of lines continue to be the same

Test plan III:
Create a Purchase Order for the BP (i.e: Bebidas Alegres) with "Cheque" payment method
Create a record in the Payment Proposal screen
      Payment Method: Cheque
      Click on the Selected Expected Payments button, remove the filter and select the previously created order
Generate Payments by selecting the option of grouping separate payments for the same vendor into one payment
Navigate to the payment created and reactivate it by deleting lines
Verify the payment proposal line associated to this payment has been deleted.
Enter a new payment proposal with the same header as before.
Click on the Selected Expected Payments button, remove the filter.
Verify that the order is shown again for selection.

Test plan IV:
Create two Purchase Invoices with the same payment method (for different business partners)
Create a record in the Payment Proposal screen
      Payment Method: Cheque
      Incl. documents up to this date > Invoices Payment Plans' Expected Date
Click on the Selected Expected Payments button, remove the filter and select the previously created invoices
Generate Payments by selecting the option of grouping separate payments for the same vendor into one payment
Navigate to one of that payments and reactivate it by deleting lines
Verify the payment proposal line associated to this payment has been deleted.
Enter a new payment proposal with the same header as before.
Click on the Selected Expected Payments button, remove the filter.
Verify the invoice linked to the reactivated payment is shown again for selection.

Test Plan V:
Create a Purchase Order for the BP (i.e: Bebidas Alegres) with "Cheque" payment method
Create a record in the Payment Proposal screen
      Payment Method: Cheque
      Click on the Selected Expected Payments button, remove the filter and select the previously created order
Generate Payments by selecting the option of grouping separate payments for the same vendor into one payment
Navigate to the payment created and reactivate it by NOT deleting lines.
Click on "Add Details" remove the line of the order selected and add a G/L item, therefore payment can be processed.
Verify that the payment proposal line associated to the payment of this order has been deleted.
Enter a new payment proposal with the same header as before.
Click on the Selected Expected Payments button, remove the filter.
Verify that the order is shown again for selection.


Test Plan VI:
Create a Purchase Invoice for the BP (i.e: Bebidas Alegres) with "Cheque" payment method
Create a record in the Payment Proposal screen
      Payment Method: Cheque
      Click on the Selected Expected Payments button, remove the filter and select the previously created invoice
Generate Payments by selecting the option of grouping separate payments for the same vendor into one payment
Navigate to the payment created and reactivate it by NOT deleting lines.
Click on "Add Details" remove the line of the invoice selected and add a G/L item, therefore payment can be processed.
Verify that the payment proposal line associated to the payment of the invoice has been deleted.
Enter a new payment proposal with the same header as before.
Click on the Selected Expected Payments button, remove the filter.
Verify that the order is shown again for selection.

(0080185)
hgbot   
2015-09-07 11:58   
Repository: erp/devel/pi
Changeset: fcdcb8232dfb9a48bc3f7cb8869ae61d3c7fe49e
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Sep 03 17:13:57 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fcdcb8232dfb9a48bc3f7cb8869ae61d3c7fe49e [^]

Fixed bug 30685 Fixed bug 30686 Fixed bug 30751: Several Payment Proposal issues

This changeset includes the fixes for several issues related to the Payment Proposal flow:
# 30685: Error when reactivating payment proposal related with a closed order
Cause: The payment schedule detail was deleted as part of the reactivation process, however DAL wasn't aware of it: when trying to delete the associated payment proposal line, DAL tried first to set proposal line's PSD to null, creating a database constraint violation in the flush.

# 30686: It is not possible to process payment related with a closed order and generated from payment proposal window.
Cause: The payment detail associated to the closed order remained in the system and it couldn't be deleted neither manually nor automatically because it was linked to the payment proposal line


# 30751: Lines deleted each time you reactivate a payment proposal
Cause: The code in charge of deleting the payment proposal lines was deleting only the lines linked to the last set of processed payment schedule details, instead of doing for all of them. This code worked fine when the payment was reactivated from the Payment window, but not when it was called from the Payment Proposal window, wrongly removing payment proposal lines.


The solution for all these issues is the following:
1. The payment proposal is set to processed=N before calling the payment process. This avoids the need of running flushes in the payment process to unprocess and process the payment proposal. That fixes the flush issues and increases the general performance of the process.
2. The code in charge of deleting the linked payment proposal lines is executed:
2.1 when a PSD is deleted because the amount is 0 (for example in the scenario where we close the order), or
2.2 when we are reactivating a payment (deleting lines only) and we don't come from payment proposal reactivation process. Now when calling the payment process from the Payment proposal, we pass a new parameter comingFrom to the payment process.
2.3 In Add Payment, when we are removing a line (for example while reactivating a payment deleting the lines)

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProposalProcess.java
---
(0080186)
dmiguelez   
2015-09-07 11:58   
Code Review + Testing Ok
(0080221)
hudsonbot   
2015-09-07 21:18   
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/f3ddf66cdf4b [^]
Maturity status: Test
(0083806)
hgbot   
2016-02-02 09:35   
Repository: tools/automation/int
Changeset: e45f89f1248cd7b9cdfaba14e18231e8f8d71249
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Sep 23 10:31:14 2015 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/e45f89f1248cd7b9cdfaba14e18231e8f8d71249 [^]

Related to issue 30751: Added an automated test

---
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentproposal/PaymentProposalHeaderTab.java
M src-test/com/openbravo/test/integration/erp/modules/client/application/gui/pickandexecute/PickAndExecuteWindow.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
M src-test/com/openbravo/test/integration/erp/modules/userinterface/smartclient/gui/Grid.java
M src-test/com/openbravo/test/integration/erp/testscripts/financial/receivablespayables/transactions/PaymentProposal.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression020.java
---