fix: incorrect status of the returned purchase receipt (backport #37300) (#37380)

fix: incorrect status of the returned purchase receipt (#37300)

(cherry picked from commit 63f45739e0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2023-10-06 14:43:13 +05:30
committed by GitHub
parent d2aa4d5d6b
commit 10c666bf69
4 changed files with 42 additions and 2 deletions

View File

@@ -190,7 +190,9 @@ class calculate_taxes_and_totals(object):
item.net_rate = item.rate
if not item.qty and self.doc.get("is_return"):
if (
not item.qty and self.doc.get("is_return") and self.doc.get("doctype") != "Purchase Receipt"
):
item.amount = flt(-1 * item.rate, item.precision("amount"))
elif not item.qty and self.doc.get("is_debit_note"):
item.amount = flt(item.rate, item.precision("amount"))