Restored missing rounded_total fields

This commit is contained in:
Nabin Hait
2018-08-29 12:41:12 +05:30
parent af370c8147
commit 6b539d65d7
3 changed files with 142 additions and 13 deletions

View File

@@ -115,14 +115,17 @@ class BuyingController(StockController):
def set_total_in_words(self):
from frappe.utils import money_in_words
if self.meta.get_field("base_in_words"):
amount = (self.base_rounded_total
if not self.get("disable_rounded_total") else self.base_grand_total)
if self.meta.get_field("base_rounded_total") and not self.is_rounded_total_disabled():
amount = self.base_rounded_total
else:
amount = self.base_grand_total
self.base_in_words = money_in_words(amount, self.company_currency)
if self.meta.get_field("in_words"):
amount = (self.rounded_total
if not self.get("disable_rounded_total") else self.grand_total)
if self.meta.get_field("rounded_total") and not self.is_rounded_total_disabled():
amount = self.rounded_total
else:
amount = self.grand_total
self.in_words = money_in_words(amount, self.currency)