Skip to content

Commit

Permalink
fix: Paid + Write Off Amount issue in Sales Invoice (backport #44763) (
Browse files Browse the repository at this point in the history
…#44874)

fix: Paid + Write Off Amount issue in Sales Invoice

(cherry picked from commit 1fd7ba7)

Co-authored-by: vishakhdesai <[email protected]>
  • Loading branch information
mergify[bot] and vishakhdesai authored Dec 24, 2024
1 parent f0671d4 commit ca7c229
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,9 @@ def validate_proj_cust(self):
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):
Expand Down

0 comments on commit ca7c229

Please sign in to comment.