Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026073Openbravo ERP09. Financial managementpublic2014-03-24 18:062014-03-31 15:25
marvintm 
pramakrishnan 
highmajoralways
closedfixed 
5
 
 
Sandrahuguet
Core
No
0026073: When a payment is processed, even if the process fails, the ProcessBundle returns 'success'
It's possible to call the FIN_PaymentProcess process in such a way that even if it fails, the final result is "success".

This happens due to the fact that the FIN_PaymentProcess indirectly calls the FIN_FinaccTransaction process (to create an automatic financial account transaction), and basically doesn't check if this process finished successfully or not.

This means that if the FIN_FinaccTransaction process ends with error, then the whole database transaction has been rolled back, but the main FIN_PaymentProcess still ends with an error.

We have been able to reproduce this problem with the Web POS (the ending result is very serious, as even though the POS receipts are not saved due to a validation failing in the FIN_FinaccTransaction process, an error is not saved either because the process finished successfully).
The way we've been able to reproduce this is the following:
- Install Retail, with the White Valley sampledata.
- Go to the Open/Close Period Control window.
- Go to the current period in the The White Valley Group Calendar
- Close the period for all documents except: AP Payment, AR Receipt, Sales Order
- Go to the Web POS, and complete a receipt. Realize that this receipt cannot be found in Sales Order window, and cannot also be found in the Errors while processing POS data window. It's been lost forever.

The main problem is the triggerAutomaticFinancialAccountTransaction method in the FIN_PaymentProcess class. This method calls the processTransaction method, but basically ignores its result. Instead of ignoring it, it should get it and if it has returned an error, it should fill its own bundle with it, and return an error.

No tags attached.
related to design defect 0026020RR14Q3 closed marvintm Retail Modules Failure proof ticket synchronisation with ERP system 
diff issue26073.diff (2,260) 2014-03-24 19:00
https://issues.openbravo.com/file_download.php?file_id=6769&type=bug
Issue History
2014-03-24 18:06marvintmNew Issue
2014-03-24 18:06marvintmAssigned To => dmiguelez
2014-03-24 18:06marvintmModules => Core
2014-03-24 18:06marvintmTriggers an Emergency Pack => No
2014-03-24 19:00marvintmFile Added: issue26073.diff
2014-03-24 19:01marvintmNote Added: 0065408
2014-03-24 19:23marvintmRelationship addedrelated to 0026020
2014-03-30 15:08hgbotCheckin
2014-03-30 15:08hgbotNote Added: 0065591
2014-03-30 15:08hgbotStatusnew => resolved
2014-03-30 15:08hgbotResolutionopen => fixed
2014-03-30 15:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/548bfa48bd30d4d151c88e12dd2cec38da095e5c [^]
2014-03-30 15:13hgbotCheckin
2014-03-30 15:13hgbotNote Added: 0065592
2014-03-30 22:47hudsonbotCheckin
2014-03-30 22:47hudsonbotNote Added: 0065593
2014-03-30 22:47hudsonbotCheckin
2014-03-30 22:47hudsonbotNote Added: 0065594
2014-03-31 15:25SandrahuguetAssigned Todmiguelez => pramakrishnan
2014-03-31 15:25SandrahuguetReview Assigned To => Sandrahuguet
2014-03-31 15:25SandrahuguetNote Added: 0065616
2014-03-31 15:25SandrahuguetStatusresolved => closed

Notes
(0065408)
marvintm   
2014-03-24 19:01   
I've attached a diff which should fix the reported issue. However, imho it's very important to review all cases of a process calling a second process, to ensure that in all cases the OBError which the second process returns is considered when building the result of the first process.
(0065591)
hgbot   
2014-03-30 15:08   
Repository: erp/devel/pi
Changeset: 548bfa48bd30d4d151c88e12dd2cec38da095e5c
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Sun Mar 30 18:36:39 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/548bfa48bd30d4d151c88e12dd2cec38da095e5c [^]

Fixes Issue 26073: When a payment is processed, even if the process fails, the ProcessBundle returns 'success'

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0065592)
hgbot   
2014-03-30 15:13   
Repository: erp/devel/pi
Changeset: bb458216d9b1f8ec9536acb3be2bce74fd471166
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Sun Mar 30 18:42:52 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/bb458216d9b1f8ec9536acb3be2bce74fd471166 [^]

Related to Issue 26073: When a payment is processed, even if the process fails, the ProcessBundle returns 'success'

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0065593)
hudsonbot   
2014-03-30 22:47   
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/a5afd9f6f31c [^]
Maturity status: Test
(0065594)
hudsonbot   
2014-03-30 22:47   
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/a5afd9f6f31c [^]
Maturity status: Test
(0065616)
Sandrahuguet   
2014-03-31 15:25   
Code review + testing OK