Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0008606Openbravo ERP09. Financial managementpublic2009-04-16 18:312009-05-05 00:00
networkb 
alostale 
immediatemajoralways
closedfixed 
30
2.40MP3 
2.50MP1 
Core
No
0008606: In the cash Journal lines, when you have many lines selected with the mouse over the amount header the status bar shows 0
In the cash Journal lines, in the grid, when you have many lines selected with the mouse over the amount header the status bar shows 0, when it should show the total amount of the lines selected.

This works properly in other windows, if the firefox is correctly configured.
In about:config window the
"dom.disable_window_status_change" preference has to befalse
-Go to the cash journal window
-go to the lines tab.
-Go to relation view.
-Select some lines.
-Put the mouse over the amount header.
-In the status bar the amount showed is 0 and should be the total amount selected.
*Notice that

250MP1
depends on backport 0008701 closed alostale In the cash Journal lines, when you have many lines selected with the mouse over the amount header the status bar shows 0 
Issue History
2009-04-16 18:31networkbNew Issue
2009-04-16 18:31networkbAssigned To => rafaroda
2009-04-16 18:31networkbRegression testing => No
2009-04-22 10:19psarobeStatusnew => scheduled
2009-04-22 10:19psarobeAssigned Torafaroda => dbaz
2009-04-22 10:19psarobefix_in_branch => pi
2009-04-23 00:54dbazNote Added: 0015587
2009-04-23 00:56dbazAssigned Todbaz => alostale
2009-04-23 10:03alostaleNote Added: 0015596
2009-04-23 10:04hgbotCheckin
2009-04-23 10:04hgbotNote Added: 0015597
2009-04-23 10:04hgbotStatusscheduled => resolved
2009-04-23 10:04hgbotResolutionopen => fixed
2009-04-23 10:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/06150656664d49b1e2b7ac33e940355f8838cf71 [^]
2009-04-23 18:26psarobeTag Attached: 250MP1
2009-05-04 23:44psarobeStatusresolved => closed
2009-05-05 00:00anonymoussf_bug_id0 => 2786905

Notes
(0015587)
dbaz   
2009-04-23 00:54   
It seems to be a problem with the SQL that should return the sum.

For example with "pi" current sampledata, if we go to the lines of the Cash Book which name is "2006-03-31 EUR" we see that there is only one line which description is "Edison Energy Company" and amount "-634.81". If the hover over the "Amount" column we obtain the correct result. The SQL that is executed in the server is

SELECT SUM(Amount) AS TOTAL
FROM C_CashLine
left join (SELECT C_Cash_ID, Name FROM C_Cash) td0 on
C_CashLine.C_Cash_ID = td0.C_Cash_ID

left join (select IsActive, ad_ref_list_id, ad_reference_id, value, name
from ad_ref_list) td1 on C_CashLine.CashType = td1.value AND
td1.ad_reference_id = '217'
left join (SELECT ad_language, name, ad_ref_list_id from
ad_ref_list_trl) td_trl1 on td1.ad_ref_list_id = td_trl1.ad_ref_list_id
AND td_trl1.ad_language = 'en_US'
left join (SELECT C_Glitem_ID, Name FROM C_Glitem) td2 on
C_CashLine.C_Glitem_ID = td2.C_Glitem_ID

left join (SELECT C_Currency_ID, ISO_Code FROM C_Currency) td3 on
C_CashLine.C_Currency_ID = td3.C_Currency_ID

left join (SELECT C_Debt_Payment_ID, C_BPartner_ID, PaymentRule,
Dateplanned, Amount, IsReceipt FROM C_Debt_Payment) td4 on
C_CashLine.C_Debt_Payment_ID = td4.C_Debt_Payment_ID

left join (SELECT C_BPartner_ID, Name FROM C_BPartner) td5 on
td4.C_BPartner_ID= td5.C_BPartner_ID

left join (select IsActive, ad_ref_list_id, ad_reference_id, value, name
from ad_ref_list) td6 on td4.PaymentRule = td6.value AND
td6.ad_reference_id = '195'
left join (SELECT ad_language, name, ad_ref_list_id from
ad_ref_list_trl) td_trl6 on td6.ad_ref_list_id = td_trl6.ad_ref_list_id
AND td_trl6.ad_language = 'en_US'
left join (SELECT C_Order_ID, DocumentNo, DateOrdered, GrandTotal FROM
C_Order)td7 on C_CashLine.C_Order_ID = td7.C_Order_ID

WHERE (C_CashLine.C_CashLine_ID) IN (SELECT C_CashLine_ID
 FROM C_CashLine
 WHERE C_CashLine.AD_Client_ID IN ('0','1000000')
 AND C_CashLine.AD_Org_ID IN
('0','1000000','1000002','1000003','1000004','1000005','1000006','1000008','1000009','1000007')
 AND C_CashLine.C_Cash_ID = '1000000'
 AND C_CashLine.C_CashLine_ID IN ('1000000')
)

if we add more lines, the SQL to obtain the sum of "Amount" will be the same but changing the last row
 AND C_CashLine.C_CashLine_ID IN ('1000000')
and instead of 1000000 the UUID generated for the new value. (or an array of IDs if we select various lines in the grid)

With this new SQL the DDBB returns a "null" instead of the right sum. So it is a problem with the SQL
(0015596)
alostale   
2009-04-23 10:03   
Note that in your example it appears 634.81 instead of -634.81.

This happens only in Oracle, in PostgreSQL the SQL directly fails.
(0015597)
hgbot   
2009-04-23 10:04   
Repository: erp/devel/pi
Changeset: 06150656664d49b1e2b7ac33e940355f8838cf71
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Apr 23 10:03:39 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/06150656664d49b1e2b7ac33e940355f8838cf71 [^]

fixed bug 0008606: In the cash Journal lines, when you have many lines selected with the mouse over the amount header the status bar shows 0

---
M src/org/openbravo/erpCommon/utility/DataGrid.java
---