mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 18:45:20 +00:00
fixes for base_rate, base_amount, tax_amount: mass search and replace
This commit is contained in:
@@ -94,16 +94,16 @@ class BuyingController(StockController):
|
||||
for d in self.get(parentfield):
|
||||
if d.item_code and d.item_code in stock_items:
|
||||
stock_items_qty += flt(d.qty)
|
||||
stock_items_amount += flt(d.base_amount)
|
||||
stock_items_amount += flt(d.base_net_amount)
|
||||
last_stock_item_idx = d.idx
|
||||
|
||||
total_valuation_amount = sum([flt(d.tax_amount) for d in self.get("taxes")
|
||||
total_valuation_amount = sum([flt(d.base_tax_amount_after_discount_amount) for d in self.get("taxes")
|
||||
if d.category in ["Valuation", "Valuation and Total"]])
|
||||
|
||||
valuation_amount_adjustment = total_valuation_amount
|
||||
for i, item in enumerate(self.get(parentfield)):
|
||||
if item.item_code and item.qty and item.item_code in stock_items:
|
||||
item_proportion = flt(item.base_amount) / stock_items_amount if stock_items_amount \
|
||||
item_proportion = flt(item.base_net_amount) / stock_items_amount if stock_items_amount \
|
||||
else flt(item.qty) / stock_items_qty
|
||||
|
||||
if i == (last_stock_item_idx - 1):
|
||||
@@ -124,7 +124,7 @@ class BuyingController(StockController):
|
||||
landed_cost_voucher_amount = flt(item.landed_cost_voucher_amount) \
|
||||
if self.doctype == "Purchase Receipt" else 0.0
|
||||
|
||||
item.valuation_rate = ((item.base_amount + item.item_tax_amount + rm_supp_cost
|
||||
item.valuation_rate = ((item.base_net_amount + item.item_tax_amount + rm_supp_cost
|
||||
+ landed_cost_voucher_amount) / qty_in_stock_uom)
|
||||
else:
|
||||
item.valuation_rate = 0.0
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user