mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 05:39:12 +00:00
Merge pull request #5130 from anandpdoshi/fix/validate-pos-paid-amount
[fix] POS paid amount validation using grand total
This commit is contained in:
@@ -375,7 +375,7 @@ class SalesInvoice(SellingController):
|
||||
frappe.throw(_("Cash or Bank Account is mandatory for making payment entry"))
|
||||
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) \
|
||||
- flt(self.base_grand_total) > 1/(10**(self.precision("base_grand_total") + 1)):
|
||||
- flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)):
|
||||
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
|
||||
|
||||
|
||||
|
||||
@@ -419,6 +419,8 @@ class calculate_taxes_and_totals(object):
|
||||
return
|
||||
|
||||
self.doc.round_floats_in(self.doc, ["grand_total", "total_advance", "write_off_amount"])
|
||||
self._set_in_company_currency(self.doc, ['write_off_amount'])
|
||||
|
||||
if self.doc.party_account_currency == self.doc.currency:
|
||||
total_amount_to_pay = flt(self.doc.grand_total - self.doc.total_advance
|
||||
- flt(self.doc.write_off_amount), self.doc.precision("grand_total"))
|
||||
|
||||
Reference in New Issue
Block a user