Merge pull request #44763 from vishakhdesai/fix-si-issue

fix: Paid + Write Off Amount issue in Sales Invoice
This commit is contained in:
ruthra kumar
2024-12-24 10:17:16 +05:30
committed by GitHub

View File

@@ -1010,9 +1010,9 @@ class SalesInvoice(SellingController):
def validate_pos(self):
if self.is_return:
invoice_total = self.rounded_total or self.grand_total
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(invoice_total) > 1.0 / (
10.0 ** (self.precision("grand_total") + 1.0)
):
if abs(flt(self.paid_amount)) + abs(flt(self.write_off_amount)) - abs(
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"))
def validate_warehouse(self):