diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 45ed3385f5d..0355c269d0b 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -404,10 +404,10 @@ class calculate_taxes_and_totals(object): self.doc.total_advance = flt(total_allocated_amount, self.doc.precision("total_advance")) if self.doc.party_account_currency == self.doc.currency: - invoice_total = flt(self.doc.grand_total - self.doc.write_off_amount, + invoice_total = flt(self.doc.grand_total - flt(self.doc.write_off_amount), self.doc.precision("grand_total")) else: - base_write_off_amount = flt(self.doc.write_off_amount * self.doc.conversion_rate, + base_write_off_amount = flt(flt(self.doc.write_off_amount) * self.doc.conversion_rate, self.doc.precision("base_write_off_amount")) invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate, self.doc.precision("grand_total")) - base_write_off_amount