Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015550Openbravo ERP09. Financial managementpublic2010-12-30 12:022011-03-18 12:05
xabiermerino 
dalsasua 
urgentmajoralways
closedfixed 
5
2.50MP24 
2.50MP262.50MP27 
Core
No
0015550: Bad behaviour when post a bank statement with a G/L Item
You have this accounting configuraion in the G/L Item:

- Glitem debit acct: 60900
- Glitem credit acct: 70900

When post a Bank statement with Ending Balance = -10:
 
        DEBIT CREDIT
57200 10
70900 10

When post a Bank statement with Ending Balance = 10:

        DEBIT CREDIT
57200 10
60900 10

- AS Openbravo Admin go to inancial Management || Accounting || Setup || G/L Item
- Create a new G/L Item and go to ACcounting
    - Glitem debit acct: 60900
    - Glitem credit acct: 70900

- Go to Financial Management || Receivables & Payables || Transactions || Bank Statement
- Create a new record and go to lines:
    -Statement Amount: 10
    - select the G/L Item created
- Process and post.

        DEBIT CREDIT
57200 10
60900 10


- Create a new record and go to lines:
    -Statement Amount: -10
    - select the G/L Item created
- Process and post.
        DEBIT CREDIT
57200 10
70900 10
No tags attached.
depends on defect 0015613 closed dalsasua Bad behaviour when post a bank statement with a G/L Item 
diff fix15550.diff (708) 2011-01-28 08:57
https://issues.openbravo.com/file_download.php?file_id=3555&type=bug
Issue History
2010-12-30 12:02xabiermerinoNew Issue
2010-12-30 12:02xabiermerinoAssigned To => dalsasua
2010-12-30 12:02xabiermerinoModules => Core
2010-12-30 12:02xabiermerinoIssue Monitored: networkb
2011-01-11 13:14adrianromeroStatusnew => scheduled
2011-01-11 13:14adrianromerofix_in_branch => pi
2011-01-11 13:14adrianromeroTypedefect => backport
2011-01-11 13:14adrianromerofix_in_branchpi =>
2011-01-11 13:15adrianromeroIssue cloned0015613
2011-01-11 13:15adrianromeroRelationship addeddepends on 0015613
2011-01-28 08:52dalsasuaNote Added: 0033942
2011-01-28 08:53dalsasuaNote Edited: 0033942bug_revision_view_page.php?bugnote_id=0033942#r1456
2011-01-28 08:55dalsasuafix_in_branch => 2.50
2011-01-28 08:57dalsasuaFile Added: fix15550.diff
2011-01-28 08:59dalsasuaNote Added: 0033944
2011-02-01 12:13hgbotCheckin
2011-02-01 12:13hgbotNote Added: 0033982
2011-02-01 12:13hgbotStatusscheduled => resolved
2011-02-01 12:13hgbotResolutionopen => fixed
2011-02-01 12:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.50/rev/2b30ee10302f9694744e1ea695075192a850720f [^]
2011-02-16 11:52jonalegriaesarteNote Added: 0034222
2011-02-16 11:52jonalegriaesarteStatusresolved => closed
2011-02-16 11:52jonalegriaesarteFixed in Version => 2.50MP27
2011-02-16 12:03jonalegriaesarteNote Added: 0034223
2011-02-16 12:03jonalegriaesarteStatusclosed => new
2011-02-16 12:03jonalegriaesarteResolutionfixed => open
2011-02-16 12:03jonalegriaesarteFixed in Version2.50MP27 =>
2011-02-16 12:33jonalegriaesarteStatusnew => scheduled
2011-02-16 12:33jonalegriaesartefix_in_branch2.50 => pi
2011-02-16 12:33jonalegriaesarteStatusscheduled => resolved
2011-02-16 12:33jonalegriaesarteResolutionopen => fixed
2011-02-16 12:34jonalegriaesarteNote Added: 0034227
2011-02-16 12:34jonalegriaesarteStatusresolved => closed
2011-02-16 12:34jonalegriaesarteFixed in Version => 2.50MP27
2011-03-18 12:04adrianromerofix_in_branchpi =>

Notes
(0033942)
dalsasua   
2011-01-28 08:52   
(edited on: 2011-01-28 08:53)
The issue has been detected, and will be fixed: it's taking the debit account when posting amounts in credit column, and the other way around.
In order to detect if any bank statement could be wrongly posted, next sql can be executed:
select b.name, b.description, b.statementdate
from c_bankstatement b, c_bankstatementline l, c_glitem g, c_glitem_acct ga,
     c_validcombination vcdebit, c_validcombination vccredit
where b.c_bankstatement_id = l.c_bankstatement_id
  and b.posted = 'Y'
  and l.c_glitem_id is not null
  and g.c_glitem_id = l.c_glitem_id
  and ga.c_glitem_id = g.c_glitem_id
  and ga.glitem_debit_acct = vcdebit.c_validcombination_id
  and ga.glitem_credit_acct = vccredit.c_validcombination_id
  and vcdebit.account_id <> vccredit.account_id

(0033944)
dalsasua   
2011-01-28 08:59   
Issue fix has been generated, and attached to the issue, just in case it's really urgent. Push to repository will be done as soon as the branch is un-frozen (actually, when MP26 is released)
(0033982)
hgbot   
2011-02-01 12:13   
Repository: erp/stable/2.50
Changeset: 2b30ee10302f9694744e1ea695075192a850720f
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Fri Jan 28 08:59:07 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/2b30ee10302f9694744e1ea695075192a850720f [^]

Fixes issue 15550: Bad behaviour when post a bank statement
Now it takes correctly debit/credit accounts, depending on the bank statement sign

---
M src/org/openbravo/erpCommon/ad_forms/DocLine_Bank.java
---
(0034222)
jonalegriaesarte   
2011-02-16 11:52   
Verified
(0034223)
jonalegriaesarte   
2011-02-16 12:03   
In postgreSQL it does not work fine. Sorry for the inconveniences.
(0034227)
jonalegriaesarte   
2011-02-16 12:34   
Verfied