fixes for base_rate, base_amount, tax_amount: mass search and replace

This commit is contained in:
Nabin Hait
2015-02-23 16:58:30 +05:30
parent 37b047d9a8
commit 82e3e25cdb
20 changed files with 113 additions and 91 deletions

View File

@@ -132,9 +132,9 @@ def period_wise_columns_query(filters, trans):
else:
pwc = [_(filters.get("fiscal_year")) + " ("+_("Qty") + "):Float:120",
_(filters.get("fiscal_year")) + " ("+ _("Amt") + "):Currency:120"]
query_details = " SUM(t2.qty), SUM(t2.base_amount),"
query_details = " SUM(t2.qty), SUM(t2.base_net_amount),"
query_details += 'SUM(t2.qty), SUM(t2.base_amount)'
query_details += 'SUM(t2.qty), SUM(t2.base_net_amount)'
return pwc, query_details
def get_period_wise_columns(bet_dates, period, pwc):
@@ -147,7 +147,7 @@ def get_period_wise_columns(bet_dates, period, pwc):
def get_period_wise_query(bet_dates, trans_date, query_details):
query_details += """SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.qty, NULL)),
SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.base_amount, NULL)),
SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.base_net_amount, NULL)),
""" % {"trans_date": trans_date, "sd": bet_dates[0],"ed": bet_dates[1]}
return query_details