Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041136Openbravo ERP09. Financial managementpublic2019-06-20 14:042019-08-22 14:44
joniturralde93 
AtulOpenbravo 
highminoralways
closedfixed 
5
 
3.0PR19Q4 
Sandrahuguet
Core
No
0041136: Import bank statement doesn't consider Business partner if included in the statement (fix included)
A partner has customized statements which include the business partner. In their case, the process does not have into account this information but it searches by BP name (they got a business partner with the same name but not the one they had included)

Added a possible fix done by the partner for themselves.
1. Import a statement which has a line for business partner
2. The process doesn't consider it and result can be wrong

(Partner has not provided us with an example of these customized statements, nor a test environment, but code can be checked in FIN_BankStatementImport)
Attached patch
No tags attached.
diff FIN_BankStatementImport.diff (785) 2019-06-20 14:04
https://issues.openbravo.com/file_download.php?file_id=13030&type=bug
csv exampleGenericCSVfile1.csv (136) 2019-06-28 08:24
https://issues.openbravo.com/file_download.php?file_id=13063&type=bug
Issue History
2019-06-20 14:04joniturralde93New Issue
2019-06-20 14:04joniturralde93Assigned To => Triage Finance
2019-06-20 14:04joniturralde93File Added: FIN_BankStatementImport.diff
2019-06-20 14:04joniturralde93Modules => Core
2019-06-20 14:04joniturralde93Triggers an Emergency Pack => No
2019-06-20 14:47PracticsIssue Monitored: Practics
2019-06-21 12:06joniturralde93Resolution time => 1562882400
2019-06-21 12:06joniturralde93Typefeature request => defect
2019-06-24 12:50SandrahuguetAssigned ToTriage Finance => AtulOpenbravo
2019-06-24 21:42AtulOpenbravoStatusnew => scheduled
2019-06-27 19:57AtulOpenbravoNote Added: 0113079
2019-06-28 08:24AtulOpenbravoFile Added: exampleGenericCSVfile1.csv
2019-07-04 12:30hgbotCheckin
2019-07-04 12:30hgbotNote Added: 0113175
2019-07-04 12:30hgbotStatusscheduled => resolved
2019-07-04 12:30hgbotResolutionopen => fixed
2019-07-04 12:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ff3059878ae0b64dc2190b038024b7d6c86f1133 [^]
2019-07-04 12:31SandrahuguetReview Assigned To => Sandrahuguet
2019-07-04 12:31SandrahuguetNote Added: 0113176
2019-07-04 12:31SandrahuguetStatusresolved => closed
2019-07-04 12:31SandrahuguetFixed in Version => 3.0PR19Q4
2019-08-22 14:44hudsonbotCheckin
2019-08-22 14:44hudsonbotNote Added: 0114135

Notes
(0113079)
AtulOpenbravo   
2019-06-27 19:57   
Test Plan

- Install modules
  org.openbravo.bankstatement.importer.generic.csv
  org.openbravo.utility.opencsv

- In method createFIN_BankStatementLine of Utility class in module org.openbravo.bankstatement.importer.generic.csv before line

return newBankStatementLine;

add the below code.

// For testing, set a business partner when loading BSL as Healthy Food Supermarkets, Co.

newBankStatementLine.setBusinessPartner(OBDal.getInstance().get(BusinessPartner.class, "B3ABB0B4AFEA4541AC1E29891D496079"));

// For testing, set a business partner when loading BSL as Company Capital

newBankStatementLine.setGLItem(OBDal.getInstance().get(GLItem.class, "DE339E8EE03D431B8456AEF76C23D09A"));


- Using Enterprise Management Module apply dataset for bank statement importer module.

- Navigate to Financial Account "Bank - Account 1"
- Run import statement process
  select the Bank File (attachement file exampleGenericCSVfile1.csv)
  select File Format as Generic CSV Importer
- Realize that Bank Statement is created with BSL having line information as below:

Though the Business Partner in the csv file is "Sleep Well Hotels, Co." but while importing / loading line it was set as "Healthy Food Supermarkets, Co." and GLItem as Company Capital

In this case BSL is kept with the same information as the that was set during importing/loading line.

Now remove lines added in Utility class. (Do not set Business Partner and GL item while importing/loading)

- BSL would be created with Business Partner as "Sleep Well Hotels, Co." that is fetched from matchBusinessPartner method based on business partner name.
- Edit the BSL created in previous step and Set GL Item to it as "Funds transfer" to the processed BSL line.

- Edit the information in the attached file for eg: Date as 11-09-2019, amount IN = 150,00

- Again run the import statement process with the modified file. Now the BSL is set with business partner as "Sleep Well Hotels, Co." and GLItem as "Funds transfer". This is based on matchPreviousBSL method.
(0113175)
hgbot   
2019-07-04 12:30   
Repository: erp/devel/pi
Changeset: ff3059878ae0b64dc2190b038024b7d6c86f1133
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Jun 27 19:42:05 2019 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ff3059878ae0b64dc2190b038024b7d6c86f1133 [^]

Fixes Issue 0041136: Import bank statement doesn't consider Business
partner if included in the statement

**Set the business partner and GLItem in BSL only if BSL does not
have this information at the time of importing/loading BSL's.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
---
(0113176)
Sandrahuguet   
2019-07-04 12:31   
code review + testing ok
(0114135)
hudsonbot   
2019-08-22 14:44   
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/ad3efd3bd07c [^]
Maturity status: Test