fix: type casting for None type value

This commit is contained in:
walstanb 2021-03-27 10:09:28 +05:30 committed by Sagar Vora
parent d5759bab11
commit 98dcf8a1fd

View File

@ -221,7 +221,7 @@ class POSInvoice(SalesInvoice):
base_grand_total = flt(self.base_rounded_total) or flt(self.base_grand_total) base_grand_total = flt(self.base_rounded_total) or flt(self.base_grand_total)
if not flt(self.change_amount) and grand_total < flt(self.paid_amount): if not flt(self.change_amount) and grand_total < flt(self.paid_amount):
self.change_amount = flt(self.paid_amount - grand_total + flt(self.write_off_amount)) self.change_amount = flt(self.paid_amount - grand_total + flt(self.write_off_amount))
self.base_change_amount = flt(self.base_paid_amount - base_grand_total + flt(self.base_write_off_amount)) self.base_change_amount = flt(self.base_paid_amount) - base_grand_total + flt(self.base_write_off_amount)
if flt(self.change_amount) and not self.account_for_change_amount: if flt(self.change_amount) and not self.account_for_change_amount:
frappe.msgprint(_("Please enter Account for Change Amount"), raise_exception=1) frappe.msgprint(_("Please enter Account for Change Amount"), raise_exception=1)