Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020093Openbravo ERP09. Financial managementpublic2012-03-22 18:252012-04-17 05:31
dalsasua 
naiaramartinez 
urgentmajoralways
closedfixed 
20Ubuntu 10.10
3.0MP8.1 
3.0MP11 
Advanced Payables and Receivables Mngmt
No
0020093: Message not clear when processing a payment for financial account without the chosen payment method
Message not clear when processing a payment for financial account without the chosen payment method
1. Go to Financial Account Banco de España - Cuenta 1
2. Go to Payment Method tab and create a new one: "Al Contado".
3. Go to Payment In window, create a new one, and choose F&B España - Región Norte, 334.32 amount, Al contado Payment Method and EUR-Banco de España-Cuenta 1 For Deposit To field. Save.
4. Go back to Payment Method tab of Financial Account Banco de España - Cuenta 1, and delete the "Al Contado" payment method created in step 2.
5. Go to Payment In created in step 3, and click on Add Details.
6. Set Transaction Type to Orders or Invoices and activate Show payments in for alternative payment methods.
7. Choose the first payment for 334.32, and click on Process and Ok.
8. Realize that an error "Index: 0, Size: 0" is shown. This message has nothing to do with the actual error.
Fin_PaymentPorcess servlet, in line 221 says:
if (dao.isAutomatedExecutionPayment(payment.getAccount(), payment.getPaymentMethod(), payment.isReceipt())) { (...)
this call to isAutomatedExecutionPayment function executes this code:
FinAccPaymentMethod finAccPaymentMethod = getFinancialAccountPaymentMethod(account, paymentMethod);
and this call to getFinancialAccountPaymentMethod executes a query, assuming that the result set will be of 1 row, at least, as the return statement says:
return obc.list().get(0);

Several possibilities can be followed in order to fix this:
1.- Before calling to isAutomatedExecutionPayment, check whether there exists that payment method for that financial account or not.
2.- Catch the exception in Fin_PaymentProcess and show a correct message.
3.- Throw a concrete exception in isAutomatedExecutionPayment or getFinancialAccountPaymentMethod
VMA-Reviewed
Issue History
2012-03-22 18:25dalsasuaNew Issue
2012-03-22 18:25dalsasuaAssigned To => vmromanos
2012-03-22 18:25dalsasuaModules => Core
2012-03-22 18:26dalsasuaIssue Monitored: gregor1com
2012-03-23 12:08dalsasuaAssigned Tovmromanos => dalsasua
2012-03-23 12:08dalsasuaStatusnew => scheduled
2012-03-23 12:08dalsasuafix_in_branch => pi
2012-03-23 12:09dalsasuaModulesCore => Advanced Payables and Receivables Mngmt
2012-03-23 12:09dalsasuafix_in_branchpi =>
2012-03-26 14:22dalsasuaPriorityimmediate => urgent
2012-03-26 14:22dalsasuaSeveritycritical => major
2012-03-30 13:44dalsasuaAssigned Todalsasua => vmromanos
2012-04-11 11:32vmromanosTag Attached: VMA-Reviewed
2012-04-11 12:38naiaramartinezAssigned Tovmromanos => naiaramartinez
2012-04-11 12:41naiaramartinezNote Added: 0047481
2012-04-13 09:36hgbotCheckin
2012-04-13 09:36hgbotNote Added: 0047548
2012-04-13 09:36hgbotStatusscheduled => resolved
2012-04-13 09:36hgbotResolutionopen => fixed
2012-04-13 09:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e8c1e6c5054d59054ea198a880493dda2a30dc6f [^]
2012-04-13 09:36vmromanosNote Added: 0047549
2012-04-13 09:36vmromanosStatusresolved => closed
2012-04-13 09:36vmromanosFixed in Version => 3.0MP11
2012-04-17 05:31hudsonbotCheckin
2012-04-17 05:31hudsonbotNote Added: 0047647

Notes
(0047481)
naiaramartinez   
2012-04-11 12:41   
Test Plan:
1. Go to Financial Account Banco de España - Cuenta 1
2. Go to Payment Method tab and create a new one: "Al Contado".
3. Go to Payment In window, create a new one, and choose F&B España - Región Norte, 334.32 amount, Al contado Payment Method and EUR-Banco de España-Cuenta 1 For Deposit To field. Save.
4. Go back to Payment Method tab of Financial Account Banco de España - Cuenta 1, and delete the "Al Contado" payment method created in step 2.
5. Go to Payment In created in step 3, and click on Add Details.
6. Set Transaction Type to Orders or Invoices and activate Show payments in for alternative payment methods.
7. Choose the first payment for 334.32, and click on Process and Ok.
You can see that the error is 'Selected payment method doesn't exist.'
(0047548)
hgbot   
2012-04-13 09:36   
Repository: erp/devel/pi
Changeset: e8c1e6c5054d59054ea198a880493dda2a30dc6f
Author: Naiara Martinez <naiara.martinez <at> openbravo.com>
Date: Wed Apr 11 12:29:37 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e8c1e6c5054d59054ea198a880493dda2a30dc6f [^]

fixed issue 20093 APRM Set a correct error message and catch the exception

---
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
---
(0047549)
vmromanos   
2012-04-13 09:36   
code review + testing OK
(0047647)
hudsonbot   
2012-04-17 05:31   
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/cedf57621434 [^]

Maturity status: Test