Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030206Openbravo ERP09. Financial managementpublic2015-06-18 17:262016-02-02 09:33
VictorVillar 
aferraz 
immediatecriticalalways
closedfixed 
5
pi 
3.0PR15Q3 
vmromanos
Core
Production - Confirmed Stable
2015-04-07
3.0PR15Q1.3
https://code.openbravo.com/erp/devel/pi/rev/58b1503188be73811b4885798fae1d31bd337076 [^]
Yes
0030206: Wrong payment status under some circumstancies
Wrong payment status under some circumstancies.

If you are using Automatic Deposit: Yes - Execution Type: Automatic and Execution Process: Simple Execution Process in your payment method and you complete a Payment In (the same in Payment Out) the status is Payment Received and it is wrong, it should be Deposited not cleared
Configure the Payment method: Wire Transfer (see the screenshot attached):
Automatic Deposit: Yes - Execution Type: Automatic and Execution Process: Simple Execution Process

Go to Payment In window:
 Organization: US
 create a new one for Healthy Food Supermarkets
 Amount: 20
Click on Add details button.
   Add a GL Item and received amount: 20
Click on Done

Realise that the payment status is Payment Received and it is wrong, it should be Deposited not cleared.

The same is happening with Payments Outs.


Note: It is working fine with the following configuration:
 * Automatic deposit: Yes - Execution Type: Manual
 * Automatic deposit: Yes - Execution Type: Automatic - Execution process: Simple execution process - Deferred: yes


No tags attached.
related to defect 00301433.0PR15Q3 closed vmromanos It is not possible to deposit more than one payment at the same time after 3.0PR14Q4 
depends on backport 00302303.0PR15Q2.3 closed aferraz Wrong payment status under some circumstancies 
depends on backport 00302313.0PR15Q1.6 closed aferraz Wrong payment status under some circumstancies 
caused by defect 0029464 closed vmromanos NullPointerException error when Adding Payment from Match Statement process and working with Automatic Payment Method 
png payment_method_automatic.png (160,372) 2015-06-18 17:40
https://issues.openbravo.com/file_download.php?file_id=8217&type=bug
png
Issue History
2015-06-18 17:26VictorVillarNew Issue
2015-06-18 17:26VictorVillarAssigned To => Triage Finance
2015-06-18 17:26VictorVillarModules => Core
2015-06-18 17:26VictorVillarResolution time => 1434664800
2015-06-18 17:26VictorVillarRegression level => Production - Confirmed Stable
2015-06-18 17:26VictorVillarTriggers an Emergency Pack => No
2015-06-18 17:26VictorVillarIssue Monitored: networkb
2015-06-18 17:29VictorVillarNote Added: 0078374
2015-06-18 17:39VictorVillarFile Added: payment_method.png
2015-06-18 17:40VictorVillarFile Deleted: payment_method.png
2015-06-18 17:40VictorVillarFile Added: payment_method_automatic.png
2015-06-18 17:43VictorVillarSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8851#r8851
2015-06-19 12:19AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-06-19 12:19AtulOpenbravoStatusnew => scheduled
2015-06-19 12:22VictorVillarTriggers an Emergency PackNo => Yes
2015-06-22 20:38AtulOpenbravoRegression date => 2015-04-01
2015-06-22 20:38AtulOpenbravoRegression introduced in release => 3.0PR15Q1.3
2015-06-22 20:38AtulOpenbravoRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/9b344a0c8a62 [^]
2015-06-22 20:38AtulOpenbravoRelationship addedcaused by 0029498
2015-06-23 12:20aferrazRegression date2015-04-01 => 2015-04-07
2015-06-23 12:20aferrazRegression introduced in release3.0PR15Q1.3 => pi
2015-06-23 12:20aferrazRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/9b344a0c8a62 [^] => https://code.openbravo.com/erp/devel/pi/rev/58b1503188be73811b4885798fae1d31bd337076 [^]
2015-06-23 12:22aferrazRegression introduced in releasepi => main
2015-06-23 12:53aferrazRelationship deletedcaused by 0029498
2015-06-23 12:54aferrazRelationship addedcaused by 0029464
2015-06-23 12:56aferrazAssigned ToAtulOpenbravo => aferraz
2015-06-23 12:57aferrazStatusscheduled => acknowledged
2015-06-23 12:57aferrazStatusacknowledged => scheduled
2015-06-23 13:10aferrazRelationship addedrelated to 0030143
2015-06-23 13:13aferrazNote Added: 0078429
2015-06-23 16:08aferrazNote Added: 0078436
2015-06-23 18:50vmromanosNote Added: 0078458
2015-06-23 18:55vmromanosNote Edited: 0078458bug_revision_view_page.php?bugnote_id=0078458#r8875
2015-06-24 10:14hgbotCheckin
2015-06-24 10:14hgbotNote Added: 0078470
2015-06-24 10:14hgbotStatusscheduled => resolved
2015-06-24 10:14hgbotResolutionopen => fixed
2015-06-24 10:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/051a7473f53478355fd50cc42817324ef7fdb056 [^]
2015-06-24 10:15vmromanosReview Assigned To => vmromanos
2015-06-24 10:15vmromanosNote Added: 0078473
2015-06-24 10:15vmromanosStatusresolved => closed
2015-06-25 17:59hudsonbotCheckin
2015-06-25 17:59hudsonbotNote Added: 0078516
2015-07-08 11:24vmromanosRegression introduced in releasemain => 3.0PR15Q1.3
2016-02-02 09:33hgbotCheckin
2016-02-02 09:33hgbotNote Added: 0083798
2016-03-11 12:46vmromanosNote Edited: 0078458bug_revision_view_page.php?bugnote_id=0078458#r11413

Notes
(0078374)
VictorVillar   
2015-06-18 17:29   
Necessary a script to fix the inconsistent data:
   - change the status to the right one
   - create the financial transactions: currently it is not possible to deposit more than one payment at the same time after 3.0PR14Q4 [1] so it is unfeasible to do it using the UI.

[1] https://issues.openbravo.com/view.php?id=30143 [^]
(0078429)
aferraz   
2015-06-23 13:13   
No modulescript will be needed to fix data due to issue [1] will be fixed and will allow to create transactions manually, which will also fix the status of payments.

[1] https://issues.openbravo.com/view.php?id=30143 [^]
(0078436)
aferraz   
2015-06-23 16:08   
Test plan:

Configure the Payment method: Wire Transfer (see the screenshot attached):
Automatic Deposit: Yes - Execution Type: Automatic and Execution Process: Simple Execution Process

Go to Payment In window:
 Organization: US
 create a new one for Healthy Food Supermarkets
 Amount: 20
Click on Add details button.
   Add a GL Item and received amount: 20
Click on Done

Realise that the payment status is Deposited not cleared.

Repeat the same flow with Payment Out.
(0078458)
vmromanos   
2015-06-23 18:50   
(edited on: 2016-03-11 12:46)
Query to detect payments missing its transaction (this only works if the payment method definition in the financial account hasn't been updated!):

select count(*)
from fin_payment p
where p.isreceipt = 'N'
and p.status = 'PPM'
and not exists (select 1 from fin_finacc_transaction t
                where t.FIN_FINANCIAL_ACCOUNT_ID = p.FIN_FINANCIAL_ACCOUNT_ID
                and p.fin_payment_id = t.fin_payment_id)
and exists (select 1
            from fin_finacc_paymentmethod pm
            where p.fin_paymentmethod_id = pm.fin_paymentmethod_id
            and pm.PAYOUT_EXECUTION_TYPE = 'A'
                and pm.payOUT_execution_process_id is not null
                and pm.payOUT_deferred = 'N'
                and pm.automatic_withdrawn = 'Y'
                and pm.FIN_FINANCIAL_ACCOUNT_ID = p.FIN_FINANCIAL_ACCOUNT_ID
            )
and p.amount <> 0



select count(*)
from fin_payment p
where p.isreceipt = 'Y'
and p.status = 'RPR'
and not exists (select 1 from fin_finacc_transaction t
                where t.FIN_FINANCIAL_ACCOUNT_ID = p.FIN_FINANCIAL_ACCOUNT_ID
                and p.fin_payment_id = t.fin_payment_id)
and exists (select 1
            from fin_finacc_paymentmethod pm
            where p.fin_paymentmethod_id = pm.fin_paymentmethod_id
            and pm.PAYIN_EXECUTION_TYPE = 'A'
                and pm.payin_execution_process_id is not null
                and pm.payin_deferred = 'N'
                and pm.automatic_deposit = 'Y'
                and pm.FIN_FINANCIAL_ACCOUNT_ID = p.FIN_FINANCIAL_ACCOUNT_ID
            )
and p.amount <> 0

(0078470)
hgbot   
2015-06-24 10:14   
Repository: erp/devel/pi
Changeset: 051a7473f53478355fd50cc42817324ef7fdb056
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Jun 23 12:52:47 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/051a7473f53478355fd50cc42817324ef7fdb056 [^]

Fixes issue 30206: Wrong payment status under some circumstancies

comingFrom internal parameter in FIN_PaymentProcess.java was always setted to "TRANSACTION" instead of using received comingFrom value, when Automatic Deposit/Withdrawn was activated and execution type was Automatic and not Deferred.
Because of that, transaction was not created when creating a payment from Payment In or Payment Out with this configuration.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0078473)
vmromanos   
2015-06-24 10:15   
Code review + testing OK
(0078516)
hudsonbot   
2015-06-25 17:59   
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/65f6b2e875a7 [^]
Maturity status: Test
(0083798)
hgbot   
2016-02-02 09:33   
Repository: tools/automation/int
Changeset: 28b79b73f30cbd913a3ba86bb48c3a422e97ac1f
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 15 17:26:34 2015 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/28b79b73f30cbd913a3ba86bb48c3a422e97ac1f [^]

Related to issue 30206: Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentin/PaymentInTab.java
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentout/PaymentOutTab.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/RegressionSuite.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/build.xml
M src-test/com/openbravo/test/integration/erp/testscripts/financial/receivablespayables/transactions/PaymentIn.java
M src-test/com/openbravo/test/integration/erp/testscripts/financial/receivablespayables/transactions/PaymentOut.java
A src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentin/ExecutePaymentInPopUp.java
A src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentout/ExecutePaymentOutPopUp.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression002.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression003.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression004.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression005.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression006.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression007.java
---