Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030686Openbravo ERPZ. Otherspublic2015-08-27 12:592015-09-07 21:18
maite 
vmromanos 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q4 
dmiguelez
Advanced Payables and Receivables Mngmt
No
0030686: It is not possible to process payment related with a closed order and generated from payment proposal window
It is not possible to process payment related with a closed order and generated from payment proposal window
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 Out and run "reactivate" option
5. Try to process payment again and you will receive error due to total order amount now is 0
6. User is not able to remove order document from payment out document. In case you try to unmark order detail and add gl item detail or invoice detail you will receive error
No tags attached.
related to defect 00306853.0PR15Q4 closed vmromanos Error when reactivating payment proposal related with a closed order 
related to defect 0030751 closed vmromanos Lines deleted each time you reactivate a payment proposal 
Issue History
2015-08-27 12:59maiteNew Issue
2015-08-27 12:59maiteAssigned To => Triage Finance
2015-08-27 12:59maiteModules => Advanced Payables and Receivables Mngmt
2015-08-27 12:59maiteResolution time => 1443304800
2015-08-27 12:59maiteTriggers an Emergency Pack => No
2015-08-27 13:00maiteIssue Monitored: networkb
2015-09-02 11:19vmromanosRelationship addedrelated to 0030685
2015-09-03 13:36vmromanosStatusnew => scheduled
2015-09-03 14:22vmromanosAssigned ToTriage Finance => vmromanos
2015-09-03 15:47vmromanosRelationship addedrelated to 0030751
2015-09-03 16:30vmromanosNote Added: 0080058
2015-09-04 11:52psanjuanNote Edited: 0080058bug_revision_view_page.php?bugnote_id=0080058#r9348
2015-09-07 11:58hgbotCheckin
2015-09-07 11:58hgbotNote Added: 0080184
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: 0080188
2015-09-07 11:59dmiguelezStatusresolved => closed
2015-09-07 21:18hudsonbotCheckin
2015-09-07 21:18hudsonbotNote Added: 0080220

Notes
(0080058)
vmromanos   
2015-09-03 16:30   
(edited on: 2015-09-04 11:52)
Test plan:
1. Register Purchase Order for any org and bp. Make sure "Cheque" is selected in "Payment Method" field. Add a 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 Out and run "reactivate" option
5. Try to process payment again. Verify this error is shown: "It is not possible to process a Payment without line." because the system tries to delete this line and then process the payment which has no lines
6. Try to process payment again, but this time enter a gl item (so the final payment will have 1 line)
7. Verify the process finishes successfully and the previous payment line has been removed, and the new one for the GL Item has been created
8. Go back to the payment proposal. Verify the line previously associated to this payment has been deleted (because there is nothing pending to be paid for the order)

(0080184)
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
---
(0080188)
dmiguelez   
2015-09-07 11:59   
Code Review + Testing Ok
(0080220)
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