commonified totals calculation in js

This commit is contained in:
Nabin Hait
2015-02-12 17:55:50 +05:30
parent 5690be103c
commit 188f69a713
5 changed files with 74 additions and 113 deletions

View File

@@ -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"))