Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021737Openbravo ERP09. Financial managementpublic2012-09-25 09:512012-09-25 16:04
vmromanos 
vmromanos 
immediatemajorN/A
closedfixed 
20Debian 5.0
 
3.0MP16 
vmromanos
Core
No
0021737: API Change request for new Bank Account Format Layout
Due to the new Bank Account Format Layout 0021665 we have increased the length of some columns in charge of storing bank account number information.

This way we ensure that any possible bank account number can be introduced in Openbravo.

The changes are:
C_BP_BANKACCOUNT.ACCOUNTNO from 20 to 100. This column stores a generic account number. In case there is no localization module that supports a concrete bank account, the user can introduce here any possible value (for example a concatenation of a bank routing number, control digits, account number, etc.)

C_BP_BANKACCOUNT.DISPLAYEDACCOUNT from 34 to 120. This column is the one used as the official bank account number and it's automatically generated (read only) from other fields (like the generic account number, IBAN, SWIFT, or other fields introduced by a localization module)

FIN_FINANCIAL_ACCOUNT.ACCOUNTNO from 20 to 120. This column is the one used as the official bank account number and it's automatically generated (read only) from other fields (like the generic account number, IBAN, SWIFT, or other fields introduced by a localization module)



The impact of this API change should be low.
Code that can be affected is the one that expects values with the previous length and that can't manage the new one.
See http://builds.openbravo.com/view/try/job/try-api/1043/console [^]
No tags attached.
Issue History
2012-09-25 09:51vmromanosNew Issue
2012-09-25 09:51vmromanosAssigned To => iciordia
2012-09-25 09:51vmromanosModules => Core
2012-09-25 10:48vmromanosNote Added: 0052540
2012-09-25 11:14vmromanosNote Added: 0052541
2012-09-25 11:14vmromanosStatusnew => scheduled
2012-09-25 11:14vmromanosAssigned Toiciordia => vmromanos
2012-09-25 11:14vmromanosfix_in_branch => pi
2012-09-25 11:15hgbotCheckin
2012-09-25 11:15hgbotNote Added: 0052542
2012-09-25 11:15hgbotStatusscheduled => resolved
2012-09-25 11:15hgbotResolutionopen => fixed
2012-09-25 11:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/api-checks/rev/e020026239608299c99908ee446d7520f55677f7 [^]
2012-09-25 12:12vmromanosClosed by => vmromanos
2012-09-25 12:12vmromanosStatusresolved => closed
2012-09-25 16:03hgbotCheckin
2012-09-25 16:03hgbotNote Added: 0052588
2012-09-25 16:03hgbotStatusclosed => resolved
2012-09-25 16:03hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/api-checks/rev/e020026239608299c99908ee446d7520f55677f7 [^] => http://code.openbravo.com/erp/devel/api-checks/rev/e2de02cedf58b29fb872b97532e7ffef1795df67 [^]
2012-09-25 16:04vmromanosStatusresolved => closed

Notes
(0052540)
vmromanos   
2012-09-25 10:48   
Only one place affected: src-db/database/model/functions/C_PROJECT_WON.xml
"Process a Winning Bid". This process is used in the Service Project window, which is not shown by default.

The C_PROJECT.ACCOUNTNO length is 20.
The process declares variable v_Accountno NVARCHAR2(20)
The following cursor gets the accountno from the C_BP_BANKACCOUNT table (length > 20)
FOR Cur_CBPBancAcct IN
            (SELECT MAX(ACCOUNTNO) AS Accountno
            FROM C_BP_BANKACCOUNT
            WHERE C_BPARTNER_ID=v_cBPartnerId
              AND ISACTIVE='Y'
            )
          LOOP
            v_Accountno:=Cur_CBPBancAcct.Accountno;
            EXIT;
          END LOOP;


After that an update is done into the C_PROJECT table:
UPDATE C_PROJECT
          SET Updated=now(),
          UpdatedBy='0',
          C_BPartner_ID=v_cBPartnerId,
          C_BPartner_Location_ID=v_cBPartnerLocationId, --Salesrep_ID = v_adUserId,
          BillTo_ID=v_billToId,
          PaymentRule=v_paymentRule,
          FIN_paymentmethod_id=v_FINpayment,
          C_Paymentterm_ID=v_cPaymenttermId,
          accountno=v_Accountno
        WHERE C_Project_ID=v_cProjectId;

This can fail in case v_Accountno length > 20


Proposed solution:
Declare v_Accountno C_BP_BANKACCOUNT.ACCOUNTNO%TYPE;
Truncate v_Accountno to 20
(0052541)
vmromanos   
2012-09-25 11:14   
Approved by Ismael
(0052542)
hgbot   
2012-09-25 11:15   
Repository: erp/devel/api-checks
Changeset: e020026239608299c99908ee446d7520f55677f7
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Sep 25 11:15:23 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/e020026239608299c99908ee446d7520f55677f7 [^]

Fixed bug 21737: API Change new Bank Account Format Layout

---
M model/src-db/database/model/tables/C_BP_BANKACCOUNT.xml
M model/src-db/database/model/tables/FIN_FINANCIAL_ACCOUNT.xml
---
(0052588)
hgbot   
2012-09-25 16:03   
Repository: erp/devel/api-checks
Changeset: e2de02cedf58b29fb872b97532e7ffef1795df67
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Sep 25 11:15:23 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/e2de02cedf58b29fb872b97532e7ffef1795df67 [^]

Fixed bug 21737: API Change new Bank Account Format Layout

---
M model/src-db/database/model/tables/C_BP_BANKACCOUNT.xml
M model/src-db/database/model/tables/FIN_FINANCIAL_ACCOUNT.xml
---