mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
commonified totals calculation in js
This commit is contained in:
@@ -77,8 +77,7 @@ class BuyingController(StockController):
|
||||
if self.meta.get_field("base_in_words"):
|
||||
self.base_in_words = money_in_words(self.base_grand_total, company_currency)
|
||||
if self.meta.get_field("in_words"):
|
||||
self.in_words = money_in_words(self.grand_total,
|
||||
self.currency)
|
||||
self.in_words = money_in_words(self.grand_total, self.currency)
|
||||
|
||||
def calculate_taxes_and_totals(self):
|
||||
super(BuyingController, self).calculate_taxes_and_totals()
|
||||
@@ -174,11 +173,9 @@ class BuyingController(StockController):
|
||||
stock_items_amount += flt(d.base_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.tax_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:
|
||||
@@ -357,7 +354,6 @@ class BuyingController(StockController):
|
||||
|
||||
return self._purchase_items
|
||||
|
||||
|
||||
def is_item_table_empty(self):
|
||||
if not len(self.get("items")):
|
||||
frappe.throw(_("Item table can not be blank"))
|
||||
|
||||
Reference in New Issue
Block a user