set tax amount also in base currency after manipulation

This commit is contained in:
Nabin Hait
2015-05-19 16:29:44 +05:30
parent c602396366
commit 8252117fe5
2 changed files with 8 additions and 0 deletions

View File

@@ -283,6 +283,9 @@ class calculate_taxes_and_totals(object):
last_tax.tax_amount_after_discount_amount += diff last_tax.tax_amount_after_discount_amount += diff
last_tax.total += diff last_tax.total += diff
self._set_in_company_currency(last_tax,
["total", "tax_amount", "tax_amount_after_discount_amount"])
def calculate_totals(self): def calculate_totals(self):
self.doc.grand_total = flt(self.doc.get("taxes")[-1].total self.doc.grand_total = flt(self.doc.get("taxes")[-1].total
if self.doc.get("taxes") else self.doc.net_total) if self.doc.get("taxes") else self.doc.net_total)

View File

@@ -319,6 +319,8 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount + tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
discount_amount_loss, precision("tax_amount", tax)); discount_amount_loss, precision("tax_amount", tax));
tax.total = flt(tax.total + discount_amount_loss, precision("total", tax)); tax.total = flt(tax.total + discount_amount_loss, precision("total", tax));
this.set_in_company_currency(tax, ["total", "tax_amount_after_discount_amount"]);
}, },
manipulate_grand_total_for_inclusive_tax: function() { manipulate_grand_total_for_inclusive_tax: function() {
@@ -338,6 +340,9 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
last_tax.tax_amount += diff; last_tax.tax_amount += diff;
last_tax.tax_amount_after_discount += diff; last_tax.tax_amount_after_discount += diff;
last_tax.total += diff; last_tax.total += diff;
this.set_in_company_currency(last_tax,
["total", "tax_amount", "tax_amount_after_discount_amount"]);
} }
} }
} }