[FIX] account: fixes analytic balance report problem.
bzr revid: vra@tinyerp.com-20100924131357-v5sjt29lb0peebcm
This commit is contained in:
parent
7f998140f3
commit
49c75feee7
|
@ -64,7 +64,6 @@ class account_analytic_balance(report_sxw.rml_parse):
|
|||
self.empty_acc = empty_acc
|
||||
self.read_data = []
|
||||
self.get_children(self.ids)
|
||||
|
||||
return self.read_data
|
||||
|
||||
def _lines_g(self, account_id, date1, date2):
|
||||
|
@ -104,14 +103,14 @@ class account_analytic_balance(report_sxw.rml_parse):
|
|||
|
||||
query_params = (tuple(ids), date1, date2)
|
||||
if option == "credit" :
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
|
||||
elif option == "debit" :
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s\
|
||||
AND date>=%s AND date<=%s AND amount>0",query_params)
|
||||
elif option == "quantity" :
|
||||
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s\
|
||||
AND date>=%s AND date<=%s",query_params)
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
@ -132,15 +131,16 @@ class account_analytic_balance(report_sxw.rml_parse):
|
|||
self.acc_sum_list = ids2
|
||||
else:
|
||||
ids2 = self.acc_sum_list
|
||||
query_params = (tuple(ids2), date1, date2)
|
||||
|
||||
query_params = (tuple(ids2), date1, date2)
|
||||
if option == "debit" :
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
|
||||
elif option == "credit" :
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
|
||||
elif option == "quantity" :
|
||||
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
|
||||
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
|
||||
WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">
|
||||
<font color="white"> </font>
|
||||
<font color="white"></font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -147,9 +147,6 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
|
||||
<blockTable colWidths="55.0,221.0,56.0,50.0,62.0,38.0" style="Table3">
|
||||
|
|
Loading…
Reference in New Issue