Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030685
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2015-08-27 12:412015-09-07 21:18
ReportermaiteView Statuspublic 
Assigned Tovmromanos 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionfcdcb8232dfb
ProjectionnoneETAnoneTarget Version3.0PR15Q4
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030685: Error when reactivating payment proposal related with a closed order

DescriptionError when reactivating payment proposal related with a closed order
Steps To Reproduce1. 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"
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00250523.0MP30 closedpramakrishnan Not paid invoices cannot be added to a payment proposal if they are already included in a processed proposal 
related to defect 00306863.0PR15Q4 closedvmromanos It is not possible to process payment related with a closed order and generated from payment proposal window 
related to defect 0030751 closedvmromanos Lines deleted each time you reactivate a payment proposal 

-  Notes
(0079989)
vmromanos (manager)
2015-09-01 12:01

Only reproducible in PostgreSQL
(0080057)
vmromanos (manager)
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 (developer)
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 (developer)
2015-09-07 11:59

Code Review + Testing Ok
(0080219)
hudsonbot (developer)
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

- Issue History
Date Modified Username Field Change
2015-08-27 12:41 maite New Issue
2015-08-27 12:41 maite Assigned To => Triage Finance
2015-08-27 12:41 maite Modules => Advanced Payables and Receivables Mngmt
2015-08-27 12:41 maite Resolution time => 1443304800
2015-08-27 12:41 maite Triggers an Emergency Pack => No
2015-08-27 12:41 maite Issue Monitored: networkb
2015-09-01 12:01 vmromanos Note Added: 0079989
2015-09-01 14:00 vmromanos Relationship added related to 0025052
2015-09-02 11:17 vmromanos Status new => scheduled
2015-09-02 11:17 vmromanos Assigned To Triage Finance => vmromanos
2015-09-02 11:19 vmromanos Relationship added related to 0030686
2015-09-03 15:47 vmromanos Relationship added related to 0030751
2015-09-03 16:18 vmromanos Note Added: 0080057
2015-09-04 11:53 psanjuan Note Edited: 0080057 View Revisions
2015-09-04 12:27 psanjuan Note Edited: 0080057 View Revisions
2015-09-04 12:31 psanjuan Note Edited: 0080057 View Revisions
2015-09-04 12:32 psanjuan Note Edited: 0080057 View Revisions
2015-09-07 11:58 hgbot Checkin
2015-09-07 11:58 hgbot Note Added: 0080183
2015-09-07 11:58 hgbot Status scheduled => resolved
2015-09-07 11:58 hgbot Resolution open => fixed
2015-09-07 11:58 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fcdcb8232dfb9a48bc3f7cb8869ae61d3c7fe49e [^]
2015-09-07 11:59 dmiguelez Review Assigned To => dmiguelez
2015-09-07 11:59 dmiguelez Note Added: 0080187
2015-09-07 11:59 dmiguelez Status resolved => closed
2015-09-07 21:18 hudsonbot Checkin
2015-09-07 21:18 hudsonbot Note Added: 0080219


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker