mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-16 13:32:13 +00:00
fix: Paid + Write Off Amount issue in Sales Invoice
(cherry picked from commit 1fd7ba7c88)
Co-authored-by: vishakhdesai <vishakhdesai@gmail.com>
This commit is contained in:
@@ -1002,9 +1002,9 @@ class SalesInvoice(SellingController):
|
|||||||
def validate_pos(self):
|
def validate_pos(self):
|
||||||
if self.is_return:
|
if self.is_return:
|
||||||
invoice_total = self.rounded_total or self.grand_total
|
invoice_total = self.rounded_total or self.grand_total
|
||||||
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(invoice_total) > 1.0 / (
|
if abs(flt(self.paid_amount)) + abs(flt(self.write_off_amount)) - abs(
|
||||||
10.0 ** (self.precision("grand_total") + 1.0)
|
flt(invoice_total)
|
||||||
):
|
) > 1.0 / (10.0 ** (self.precision("grand_total") + 1.0)):
|
||||||
frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
|
frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
|
||||||
|
|
||||||
def validate_warehouse(self):
|
def validate_warehouse(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user