Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030685Openbravo ERPZ. Otherspublic2015-08-27 12:412015-09-07 21:18
maite 
vmromanos 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q4 
dmiguelez
Advanced Payables and Receivables Mngmt
No
0030685: Error when reactivating payment proposal related with a closed order
Error when reactivating payment proposal related with a closed order
1. Register Purchase Order for any org and bp. Add line and process
2. Register Payment Proposal header for same org and bp. Select previous order and run "Generate Payments" process
3. Access Purchase Order and Close it. Total order amount will be set to 0 as order line was not delivered
4. Access Payment Proposal and try to Reactivate it. New tab is open with 404 error and payment proposal header shows following error "Error occurred
ERROR: current transaction is aborted, commands ignored until end of transaction block"
No tags attached.
related to defect 00250523.0MP30 closed pramakrishnan Not paid invoices cannot be added to a payment proposal if they are already included in a processed proposal 
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 
related to defect 0030751 closed vmromanos Lines deleted each time you reactivate a payment proposal 
Issue History
2015-08-27 12:41maiteNew Issue
2015-08-27 12:41maiteAssigned To => Triage Finance
2015-08-27 12:41maiteModules => Advanced Payables and Receivables Mngmt
2015-08-27 12:41maiteResolution time => 1443304800
2015-08-27 12:41maiteTriggers an Emergency Pack => No
2015-08-27 12:41maiteIssue Monitored: networkb
2015-09-01 12:01vmromanosNote Added: 0079989
2015-09-01 14:00vmromanosRelationship addedrelated to 0025052
2015-09-02 11:17vmromanosStatusnew => scheduled
2015-09-02 11:17vmromanosAssigned ToTriage Finance => vmromanos
2015-09-02 11:19vmromanosRelationship addedrelated to 0030686
2015-09-03 15:47vmromanosRelationship addedrelated to 0030751
2015-09-03 16:18vmromanosNote Added: 0080057
2015-09-04 11:53psanjuanNote Edited: 0080057bug_revision_view_page.php?bugnote_id=0080057#r9350
2015-09-04 12:27psanjuanNote Edited: 0080057bug_revision_view_page.php?bugnote_id=0080057#r9353
2015-09-04 12:31psanjuanNote Edited: 0080057bug_revision_view_page.php?bugnote_id=0080057#r9354
2015-09-04 12:32psanjuanNote Edited: 0080057bug_revision_view_page.php?bugnote_id=0080057#r9355
2015-09-07 11:58hgbotCheckin
2015-09-07 11:58hgbotNote Added: 0080183
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:59dmiguelezReview Assigned To => dmiguelez
2015-09-07 11:59dmiguelezNote Added: 0080187
2015-09-07 11:59dmiguelezStatusresolved => closed
2015-09-07 21:18hudsonbotCheckin
2015-09-07 21:18hudsonbotNote Added: 0080219

Notes
(0079989)
vmromanos   
2015-09-01 12:01   
Only reproducible in PostgreSQL
(0080057)
vmromanos   
2015-09-03 16:18   
(edited on: 2015-09-04 12:32)
Test plan I:
1. Register Purchase Order for any org (i.e. F&B España) and bp (i.e. Bebidas Alegres. Make sure "Cheque" is selected in the field "Payment Method". Add line and process
2. Register Payment Proposal header for same org and bp. Select previous order and run "Generate Payments" process
3. Realize that a payment out (i.e : 1000400) has been created with status "Payment Made".
4. Access Purchase Order and navigate to "Payment Plan", "Payment Details" therefore payment 1000400 is shown there with a paid amount, however Outstanding amount in payment plan tab reflects the amount to be paid.
5. Access Purchase Order and Close it. Total order amount will be set to 0 as order line was not delivered.
6. Access Payment Proposal and try to Reactivate it. Verify the process finishes successfully and the line is deleted because there is nothing else pending to be paid for this order.
7. Realize that payment out created does not longer exist.
8. Go to the purchase order and realize that Payment Plan shows 0.00 in Expected Amount, Paid and Outstanding fields and there are no payment details.

Test Plan II:
1. Register Purchase Order for any org (i.e. F&B España) and bp (i.e. Bebidas Alegres. Make sure "Cheque" is selected in the field "Payment Method". Add line and process
2. Register Payment Proposal header for same org and bp. Select previous order and run "Generate Payments" process
3. Realize that a payment out (i.e : 1000401) has been created with status "Payment Made".
4. Access Purchase Order and navigate to "Payment Plan", "Payment Details" therefore payment 1000401 is shown there with a paid amount, however Outstanding amount in payment plan tab reflects the amount to be paid.
5. Access Purchase Order and Close it. Total order amount will be set to 0 as order line was not delivered.
6. Access to Payment Out window and search by the payment (i.e 100401), run Reactivate and Delete lines.
7. Go to the purchase order and realize that Payment Plan shows 0.00 in Expected Amount, Paid and Outstanding fields and there are no payment details.
8. Access Payment Proposal window and refresh. Realize that the payment proposal line is not shown there anymore. Reactivate the payment proposal and realize that the purchase order just closed can not be selected anymore.

(0080183)
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
---
(0080187)
dmiguelez   
2015-09-07 11:59   
Code Review + Testing Ok
(0080219)
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