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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0031193
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2015-10-20 18:452015-11-23 21:17
ReporterngarciaView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision07dbbd544216
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0031193: Execute Pending Payments background process is taken into account payments that are not Awaiting Execution

DescriptionExecute Pending Payments background process is taken into account payments that are not Awaiting Execution
Steps To ReproduceAs system admin role:
   Install Authorize.net module and apply its dataset, as well as Member Portal dataset, in order to have a payment method configured as:
      Payment In Allowed = 'Y'
      Execution Type = Automatic
      Execution Process = 'a process that will fail'
      Deferred = 'N'
      Automatic Receipt = 'Y'
   Do not configure the authorize.net parameters
   Add that Payment Method to the Financial Account
   1. Create a Sales Invoice with that Payment Method, complete it and execute the payment (an error will be raised)
   Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is present in aprm_pending_paymentinvoice table) but an error is shown. This is correct
   Go to Payment In window, select the payment and Void it
  Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is still present in aprm_pending_paymentinvoice table) but an error is shown. This is incorrect
   2. Create another Sales Invoice with that Payment Method, complete it and execute the payment (an error will be raised)
   Go to Payment In window, reactivate the associated payment, change its payment method and process it
  Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is still present in aprm_pending_paymentinvoice table). This is incorrect too
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0081178)
AtulOpenbravo (developer)
2015-10-21 15:54
edited on: 2015-10-22 14:14

Test Plan
- Login as system admin role:
- Install Authorize.net module and apply its dataset, as well as "Member Portal" dataset, in order to have a payment method configured as:
      Payment In Allowed = 'Y'
      Execution Type = Automatic
      Execution Process = Authorize.net CIM Integration (this one is valid for this scenario, it will also work for any other process that will fail)
      Deferred = 'N'
      Automatic Receipt = 'Y'
- Do not configure the authorize.net parameters in the Client window, "Email Configuration" tab.
- Add that Payment Method to the Financial Account
- Create a Sales Invoice with that Payment Method, complete it and execute the payment (an error will be raised, "NoExecutionProcessFound").
- Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is present in aprm_pending_paymentinvoice table) but an error is shown.
- Go to Payment In window, select the payment and Void it.
- Launch the Execute Pending Payments background process and check it executes successfully. (as the payment is not present in aprm_pending_paymentinvoice table).
- Create another Sales Invoice with that Payment Method, complete it and execute the payment (an error will be raised).
- Go to Payment In window, reactivate the associated payment, change its payment method and process it
- Launch the Execute Pending Payments background process and check that it executes successfully. (as the payment is not present in aprm_pending_paymentinvoice table).

(0081210)
psanjuan (manager)
2015-10-22 14:18

Issue verified.
(0081264)
psanjuan (manager)
2015-10-23 14:40
edited on: 2015-10-29 14:57

Test Plan below verified.

Prerequisites

Login as system admin role

Install Authorize.net module and apply its dataset, as well as "Member Portal" dataset

Check that two payment methods have been created: "authorize.net Online" and "Authorize.net Subscription". this last one is configured as Automatic by default as described below:
      Payment In Allowed = 'Y'
      Execution Type = Automatic
      Execution Process = Authorize.net CIM Integration
      Deferred = 'N'
      Automatic Receipt = 'Y'
- Do not configure the authorize.net parameters in the Client window, "Email Configuration" tab, therefore this payment method will not work.

Add that Payment Method ( Authorize.net Subscription) to the Financial Account

(1) Scenario 1 - Execute Pending Payments process properly works for a payment method properly configured.

Go to Financial Account "Cuenta de Banco" for F&B España
Go to Payment Method tab. Configure "Cheque" payment method as below:
Payment In allowed
Automatic Receipt = Yes
Execution Type = Automatic
Execution Process = Simple Execution Process
Deferred = No

Go to Sales Invoice and create a new sales invoice for F&B España, Alimentos y Supermercado BP. Select Cheque as payment method. Enter any line.
Complete the invoice and cancel payment execution, therefore a new payment in with "Awaiting Execution" status is created.

Go to Process Request window and run Execute Pending Payments process for F&B España.

Check that the process ends successfully and the payment in has changed its status to Payment Received.

Go back to the sales invoice and verify that it is set as "Payment Complete" = Yes.

Repeat same scenario executing the payment:
- from the invoice
- from the payment in window
to check that execution works ok.


(2) Scenario 2 - Execute Pending Payments process properly works for a payment method do NOT properly configured when it is change to "Void".

Create a Sales Invoice for F&B España, Alimentos y Supermercados BP. Select "Authorize.net Subscription" payment method. Add any line. Complete the invoice. While completing the invoice do cancel the execution of the payment.

Check that a new payment in linked to the invoice has been created with "Awaiting Execution" status.

Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is present in aprm_pending_paymentinvoice table) but an error is shown. "Error during the payment execution. Please read the payment execution message to get more information about the problem" (Where do I can get more information about the problem??)

Repeat same scenario executing the payment:
- from the invoice
- from the payment in window
to check that execution does not successfully ends.

Go to Payment In window, select the payment created and Void it.

Launch the Execute Pending Payments background process once again and check that no error is shown as it executes successfully.

(3) Scenario 3 - Execute Pending Payments process properly works for a payment method do NOT properly configured when the payment in is changed to a "Manual" Payment Method.

Create a Sales Invoice for F&B España, Alimentos y Supermercados BP. Select "Authorize.net Subscription" payment method. Add any line. Complete the invoice. While completing the invoice do cancel the execution of the payment.

Check that a new payment in linked to the invoice has been created with "Awaiting Execution" status.

Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is present in aprm_pending_paymentinvoice table) but an error is shown. "Error during the payment execution. Please read the payment execution message to get more information about the problem" (Where do I can get more information about the problem??)

Go to Payment In window, reactivate the associated payment, change its payment method to "Transferencia" (Manual Execution Type payment method), relate it to the same invoice by using "Add Details" button and process it

Launch the Execute Pending Payments background process once again and check that no error is shown as it executes successfully.

(4) Scenario 4 - Execute Pending Payments process properly works for a payment method do NOT properly configured when the payment in is changed to an "Automatic" Payment Method.

Create a Sales Invoice for F&B España, Alimentos y Supermercados BP. Select "Authorize.net Subscription" payment method. Add any line. Complete the invoice. While completing the invoice do cancel the execution of the payment.

Check that a new payment in linked to the invoice has been created with "Awaiting Execution" status.

Launch the Execute Pending Payments background process and check it tries to execute it (as the payment is present in aprm_pending_paymentinvoice table) but an error is shown. "Error during the payment execution. Please read the payment execution message to get more information about the problem" (Where do I can get more information about the problem??)

Go to Payment In window, reactivate the associated payment, change its payment method to "Cheque" (Automatic Execution Type payment method), relate it to the same invoice by using "Add Details" button and process it

There is no need to do anything else as the payment changes to "Payment Received".

Launch the Execute Pending Payments background process and check it completes successfully.

(5) Scenario 5 - Execute Pending Payments process properly works when a payment in created with a payment method properly configured, is reactivated and changed for another payment method do NOT properly configured.

Go to Sales Invoice and create a new sales invoice for F&B España, Alimentos y Supermercado BP. Select Cheque as payment method. Enter any line.
Complete the invoice and cancel payment execution, therefore a new payment in with "Awaiting Execution" status is created.

Go to Payment in window and check that an Awaiting Execution payment has been created.

Reactivate the payment and change invoice payment method to Authorize.net Subscription payment method. Press Add Details to keep the relation with the invoice. Select "Process Received Payment(s) Action and then press Done.

Press Execute Payment button and then "Execute".
Verify that an error is shown which is OK "Error during the payment execution. Please read the payment execution message to get more information about the problem.

Go now to Process Request window and launch Execute Pending Payments process. Verify it ends with an error

(6) Scenario 6 - Mix of invoices, one set with a payment method properly configured and the other one with a payment method do not properly configured.

Go to sales invoice and create for F&B España, Alimentos y Supermercados BP, set with "Cheque" payment method. Add any line. Complete and do not execute the payment.

Go to sales invoice and create for F&B España, Alimentos y Supermercados BP, set with "Authorized.net Subscription" payment method. Add any line. Complete and do not execute the payment.

Go to payment in window and check that there are two new payments in "Awaiting Execution" status.

Go to Process Request window and launch "Execute Pending Payments" process.
Check that the process ends with an error, which is ok, but the payment in related to the payment method properly configured "Cheque" has changed its status to "Payment Received", while the other keeps in "Awaiting Execution".

Same way the invoice related to "Cheque" payment method is now paid, while the invoice related to "Authorized.net Subscription" payment method is not paid.

(7) Scenario 7 - Payment in properly configured and executed, reactivated and configured with a payment method do not properly configured.

Go to sales invoice and create for F&B España, Alimentos y Supermercados BP, set with "Cheque" payment method. Add any line. Complete and do not execute the payment.

Go to payment in window and verify that a new payment in awaiting execution status have been created. Execute the payment. After that Reactivate it and change the payment method to "Authorized.net Subscription". Select same invoice by using "Add Details" button.

Try to execute the payment now from the payment in window, "Execute Payment" button. An error is shown, which is correct.

Go to Process Request window and launch "Execute Pending Payments" process.
Check that the process shows as well an error, which is correct.

(8) Scenario 8 - A payment in, including two invoices, related to a payment method properly configured is reactivated and changed by a payment method do not properly configured.

Go to sales invoice window and create two invoices for F&B España, Alimentos y Supermercados BP, Transferencia payment method.
Complete the invoices.

Go to payment in window and create a new payment for Alimentos y Supermercados, Payment method = Cheque. Select the two invoices created.
Press Done and check that payment status changes to "Payment Received".

Reactivate the payment and change the payment method to "Authorized. net Subscription". Press Add Details. Remove the filter and select once again these two invoices. Complete the payment.

Check that payment in status is Awaiting Execution. Try to execute the payment from payment in window. Check that fails, which is correct.

Try to execute the payment from Process Request window by launching "Execute Pending Payment". Check that it also fails, which is correct.

Go back to Payment in and reactivate it, change the payment to Cheque and select once more the two invoices. Check that this time payment status changes to "Payment Made" and the two invoices are paid.

(0081304)
psanjuan (manager)
2015-10-26 11:22

Test Plan above verified.
(0081486)
vmromanos (developer)
2015-11-04 18:59

After talking to EAR the solution has changed a little bit:

1. When a payment in awaiting execution is reactivated or voided, we immediately delete the associated APRMPendingPaymentFromInvoice record. This is a way to ensure the same behavior as when creating the payment manually, where no APRMPendingPaymentFromInvoice record is created and the user must process manually the payment.

2. In case the payment is in awaiting execution, and there is any update, we update the APRMPendingPaymentFromInvoice record to point to the current Payment Process. This is a way to ensure the payment originally created by the system can be processed by the background process with the right payment process.

3. In case the payment is in awaiting execution, and the payment method is updated to any other without a payment process, then the APRMPendingPaymentFromInvoice record is deleted. This is done to ensure the payment is not processed by the background process with the Payment Process associated before.
(0081498)
psanjuan (manager)
2015-11-05 10:59
edited on: 2015-11-05 11:05

After change in the solution of the issue, see note above.

Test plan above has been verified.

New test added:

(9) Scenario 9 - Payment method changed to another "Automatic" payment method, without reactivating an Awaiting execution payment in.

Go to Sales invoice window and create a new one for F&B España, Alimentos y Supermercados, Payment Method = Authorized.net Subcription.
Complete the invoice and do not execute the payment.

Go to payment in window and check that a new awaiting execution payment in has been created.

Run Execute Pending Payments and check that an error is shown, which is correct.

Go to payment in window and change the payment method to Cheque.

Run Execute Pending Payments and check it ends successfully and no error is shown.

Payment is now set as Payment Received and the sales invoice is paid.

(10) Scenario 10 Payment method changed to a "Manual" payment method, without reactivating an Awaiting execution payment in.

Go to Sales invoice window and create a new one for F&B España, Alimentos y Supermercados, Payment Method = Authorized.net Subcription.
Complete the invoice and do not execute the payment.

Go to payment in window and check that a new awaiting execution payment in has been created.

Run Execute Pending Payments and check that an error is shown, which is correct.

Go to payment in window and change the payment method to Transferencia.

Run Execute Pending Payments and check it ends successfully and no error is shown.

(0081501)
hgbot (developer)
2015-11-05 11:20

Repository: erp/devel/pi
Changeset: 24d5b02440cae22da69aebe6dc9ab50ccac99203
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Oct 29 14:26:35 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/24d5b02440cae22da69aebe6dc9ab50ccac99203 [^]

Fixes Issue 0031193:Execute Pending Payments background process is taken into
 account payments that are not Awaiting Execution

- Remove lines from APRMPendingPaymentFromInvoice when payment does not have
status as Awaiting Execution
- While processing payment check whether records exists in
APRMPendingPaymentsFromInvoice if no create them, if yes check whether they
have proper execution process, if not set it.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/ExecutePendingPayments.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0081502)
hgbot (developer)
2015-11-05 11:20

Repository: erp/devel/pi
Changeset: 07dbbd5442169fc56bba45679429bf23fa544477
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Nov 04 18:55:33 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/07dbbd5442169fc56bba45679429bf23fa544477 [^]

Fixed bug 31193: code review improvements

Changes in the solution:
1. When a payment in awaiting execution is reactivated or voided, we immediately delete the associated APRMPendingPaymentFromInvoice record. This is a way to ensure the same behavior as when creating the payment manually, where no APRMPendingPaymentFromInvoice record is created and the user must process manually the payment.
2. In case the payment is in awaiting execution, and there is any update, we update the APRMPendingPaymentFromInvoice record to point to the current Payment Process. This is a way to ensure the payment originally created by the system can be processed by the background process with the right payment process.
3. In case the payment is in awaiting execution, and the payment method is updated to any other without a payment process, then the APRMPendingPaymentFromInvoice record is deleted. This is done to ensure the payment is not processed by the background process with the Payment Process associated before.
4. The changes in the FIN_PaymentProcess have been reverted, because there is no need to create always a APRMPendingPaymentFromInvoice record before processing the payment
5. The ExecutePendingPayments class, which is the background process that processes the payments in the APRMPendingPaymentFromInvoice entity, will remove any APRMPendingPaymentFromInvoice record linked to a payment in Voided status, and it will execute only the payments in Awaiting Execution.
6. The code in the ExecutePendingPayments will probably require a deeper review to properly write it.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/ExecutePendingPayments.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0081503)
vmromanos (developer)
2015-11-05 11:24

Code review + testing OK
(0082176)
hudsonbot (developer)
2015-11-23 21:17

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/7b56bebaaa88 [^]
Maturity status: Test
(0082177)
hudsonbot (developer)
2015-11-23 21:17

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/7b56bebaaa88 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-10-20 18:45 ngarcia New Issue
2015-10-20 18:45 ngarcia Assigned To => Triage Finance
2015-10-20 18:45 ngarcia Modules => Core
2015-10-20 18:45 ngarcia Triggers an Emergency Pack => No
2015-10-20 18:47 ngarcia Issue Monitored: networkb
2015-10-21 10:11 AtulOpenbravo Assigned To Triage Finance => AtulOpenbravo
2015-10-21 10:12 AtulOpenbravo Status new => scheduled
2015-10-21 15:54 AtulOpenbravo Note Added: 0081178
2015-10-22 14:01 psanjuan Steps to Reproduce Updated View Revisions
2015-10-22 14:01 psanjuan Note Edited: 0081178 View Revisions
2015-10-22 14:06 psanjuan Note Edited: 0081178 View Revisions
2015-10-22 14:08 psanjuan Note Edited: 0081178 View Revisions
2015-10-22 14:11 psanjuan Note Edited: 0081178 View Revisions
2015-10-22 14:14 psanjuan Note Edited: 0081178 View Revisions
2015-10-22 14:15 psanjuan Steps to Reproduce Updated View Revisions
2015-10-22 14:16 psanjuan Steps to Reproduce Updated View Revisions
2015-10-22 14:18 psanjuan Note Added: 0081210
2015-10-23 14:40 psanjuan Note Added: 0081264
2015-10-23 14:42 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:22 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:24 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:29 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:31 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:49 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 10:56 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:02 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:17 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:21 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:22 psanjuan Note Added: 0081304
2015-10-26 11:26 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:35 psanjuan Note Edited: 0081264 View Revisions
2015-10-26 11:42 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:18 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:22 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:22 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:26 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:48 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:54 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:58 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:58 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 11:58 psanjuan Note Edited: 0081264 View Revisions
2015-10-27 12:05 psanjuan Note Edited: 0081264 View Revisions
2015-10-29 14:38 psanjuan Note Edited: 0081264 View Revisions
2015-10-29 14:42 psanjuan Note Edited: 0081264 View Revisions
2015-10-29 14:56 psanjuan Note Edited: 0081264 View Revisions
2015-10-29 14:57 psanjuan Note Edited: 0081264 View Revisions
2015-11-04 18:59 vmromanos Note Added: 0081486
2015-11-05 10:59 psanjuan Note Added: 0081498
2015-11-05 11:01 psanjuan Note Edited: 0081498 View Revisions
2015-11-05 11:03 psanjuan Note Edited: 0081498 View Revisions
2015-11-05 11:04 psanjuan Note Edited: 0081498 View Revisions
2015-11-05 11:05 psanjuan Note Edited: 0081498 View Revisions
2015-11-05 11:20 hgbot Checkin
2015-11-05 11:20 hgbot Note Added: 0081501
2015-11-05 11:20 hgbot Status scheduled => resolved
2015-11-05 11:20 hgbot Resolution open => fixed
2015-11-05 11:20 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/24d5b02440cae22da69aebe6dc9ab50ccac99203 [^]
2015-11-05 11:20 hgbot Checkin
2015-11-05 11:20 hgbot Note Added: 0081502
2015-11-05 11:20 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/24d5b02440cae22da69aebe6dc9ab50ccac99203 [^] => http://code.openbravo.com/erp/devel/pi/rev/07dbbd5442169fc56bba45679429bf23fa544477 [^]
2015-11-05 11:24 vmromanos Review Assigned To => vmromanos
2015-11-05 11:24 vmromanos Note Added: 0081503
2015-11-05 11:24 vmromanos Status resolved => closed
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082176
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082177


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker