Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013474Openbravo ERP09. Financial managementpublic2010-05-30 21:232010-06-10 13:02
FTS 
vmromanos 
immediatemajoralways
closedfixed 
408.0
2.50MP18 
2.50MP19 
Core
No
0013474: Create payment fails while creating on bank statements
When you try to create a payment from the bank statement application gives error:
      
Error:
The selected Withholding is not associated to the payment's Business Partner.

Where is no withholding configured for Business Partner.
1- Go to Financial Management || Receivables & Payables || Transactions || Bank Statement
2- Create a new bank statement and save it
3- Go to Lines tab, create a new record and save it.
Example:
   Line No: 10
   Effective Date: 31.01.2009 Accounting Date:31.01.2009
   Statement Amount: 5.0
4- Press Create Payment button, fill data and press "OK" button. Example:
   Business Partner : Any
   Amount: 5.0
   Form of Payment: Bank deposit
   Due Date: 31.01.2009
   Status: any
Regression
related to backport 00135232.40 closed vmromanos Create payment fails while creating on bank statements 
Issue History
2010-05-30 21:23FTSNew Issue
2010-05-30 21:23FTSAssigned To => dalsasua
2010-06-03 18:03iatienzaIssue Monitored: iatienza
2010-06-03 18:44jonalegriaesartePrioritynormal => immediate
2010-06-03 18:51psarobeversionmain => 2.50MP18
2010-06-03 18:58jonalegriaesarteTarget Version => 2.50MP19
2010-06-04 09:51jonalegriaesarteNote Added: 0027942
2010-06-04 11:25vmromanosAssigned Todalsasua => vmromanos
2010-06-04 11:25vmromanosStatusnew => scheduled
2010-06-04 11:25vmromanosfix_in_branch => pi
2010-06-04 11:26vmromanosNote Added: 0027943
2010-06-04 11:57vmromanosIssue cloned0013523
2010-06-04 11:57vmromanosRelationship addedrelated to 0013523
2010-06-04 12:34FTSNote Added: 0027947
2010-06-04 15:38hgbotCheckin
2010-06-04 15:38hgbotNote Added: 0027996
2010-06-04 15:38hgbotStatusscheduled => resolved
2010-06-04 15:38hgbotResolutionopen => fixed
2010-06-04 15:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0a2a03157bd5f77362bc802a7651db92ade0682a [^]
2010-06-07 08:58sureshbabuNote Added: 0028024
2010-06-07 08:58sureshbabuStatusresolved => new
2010-06-07 08:58sureshbabuResolutionfixed => open
2010-06-07 10:18vmromanosNote Added: 0028040
2010-06-07 11:27vmromanosStatusnew => scheduled
2010-06-07 11:27vmromanosNote Added: 0028044
2010-06-07 11:27vmromanosStatusscheduled => resolved
2010-06-07 11:27vmromanosResolutionopen => fixed
2010-06-07 21:21hudsonbotCheckin
2010-06-07 21:21hudsonbotNote Added: 0028115
2010-06-07 23:44hudsonbotCheckin
2010-06-07 23:44hudsonbotNote Added: 0028157
2010-06-08 14:04sureshbabuNote Added: 0028184
2010-06-08 14:04sureshbabuStatusresolved => closed
2010-06-09 00:00anonymoussf_bug_id0 => 3013458
2010-06-10 13:02psarobeTag Attached: Regression

Notes
(0027942)
jonalegriaesarte   
2010-06-04 09:51   
We think that the problem is in the validation (PostgreSQL):
SELECT COUNT(*)
INTO v_count
FROM C_BP_Withholding
WHERE C_Withholding_ID=v_c_withholding_id
AND C_BPartner_ID=v_C_BPartner_ID;
IF (v_count=0) THEN
    RAISE EXCEPTION '%', '@NOT_BP_WITHHOLDING@'; --OBTG:-20000--
END IF;

Maybe it should check that the user has selected a withholding, so the code should be:

IF (v_c_withholding_id IS NOT NULL) THEN
SELECT COUNT(*)
INTO v_count
FROM C_BP_Withholding
WHERE C_Withholding_ID=v_c_withholding_id
AND C_BPartner_ID=v_C_BPartner_ID;
IF (v_count=0) THEN
    RAISE EXCEPTION '%', '@NOT_BP_WITHHOLDING@'; --OBTG:-20000--
END IF;
END IF;

What do you think? Thanks.
(0027943)
vmromanos   
2010-06-04 11:26   
Hi John,

Yes, totally agree with you. I will fix it right now.
(0027947)
FTS   
2010-06-04 12:34   
Just an information that issue 13475 is related to withholding as well. In theory it could affect possibility to select needed withholding in bank statement payments.
(0027996)
hgbot   
2010-06-04 15:38   
Repository: erp/devel/pi
Changeset: 0a2a03157bd5f77362bc802a7651db92ade0682a
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Jun 04 15:38:46 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0a2a03157bd5f77362bc802a7651db92ade0682a [^]

Fixed bug 13474: Create payment fails while creating on bank statements
It only checks if a withholding has been selected by the user

---
M src-db/database/model/functions/C_DEBT_PAYMENT_CREATE.xml
---
(0028024)
sureshbabu   
2010-06-07 08:58   
Hi,

I have tried to verify this issue in Live qa builds, after i enter details in create payment window, system throws an empty error message.
(0028040)
vmromanos   
2010-06-07 10:18   
Hi Suresh,

I can reproduce this "empty red message" in live builds, however it seems to be an issue that affects all the database processes. Try for example to complete an invoice and you will get the same error.

Here is the log:
10:15:19 [ajp-8009-4] ERROR org.openbravo.scheduling.ProcessRunner -
java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at org.openbravo.scheduling.ProcessRunner.execute(ProcessRunner.java:58)
    at org.openbravo.erpWindows.PurchaseInvoice.Header.doPost(Header.java:452)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:101)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:427)
    at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
    at java.lang.Thread.run(Thread.java:619)
(0028044)
vmromanos   
2010-06-07 11:27   
Hi Suresh,

I can confirm you the bug 0013518 is the responsible of this behaviour. I have just asked Ivan to reopen it and fix it properly. Once it's properly fixed, it should work fine.

I set it again as fixed.
(0028115)
hudsonbot   
2010-06-07 21:21   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/0a2a03157bd5 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/8b43a1f2fff4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17563.obx [^]
(0028157)
hudsonbot   
2010-06-07 23:44   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/0a2a03157bd5 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/8b43a1f2fff4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17563.obx [^]
(0028184)
sureshbabu   
2010-06-08 14:04   
verified (live qa postgres context) working fine,

Now user able to create Payments using bank statement