UOM Conversion in selling

This commit is contained in:
Nabin Hait
2017-03-03 15:00:41 +05:30
parent 5a980ac87a
commit e68f32cf19
15 changed files with 38 additions and 34 deletions

View File

@@ -147,9 +147,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_net_amount),"
query_details = " SUM(t2.stock_qty), SUM(t2.base_net_amount),"
query_details += 'SUM(t2.qty), SUM(t2.base_net_amount)'
query_details += 'SUM(t2.stock_qty), SUM(t2.base_net_amount)'
return pwc, query_details
def get_period_wise_columns(bet_dates, period, pwc):
@@ -161,7 +161,7 @@ def get_period_wise_columns(bet_dates, period, pwc):
_(get_mon(bet_dates[0])) + "-" + _(get_mon(bet_dates[1])) + " (" + _("Amt") + "):Currency:120"]
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)),
query_details += """SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.stock_qty, 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