fix(test): do not enable negative stock

(cherry picked from commit 75256863c6)
This commit is contained in:
Saqib Ansari
2022-02-09 10:05:06 +05:30
committed by mergify-bot
parent e2d8fce3c5
commit 7835e86da0
2 changed files with 17 additions and 7 deletions

View File

@@ -653,7 +653,7 @@ class calculate_taxes_and_totals(object):
base_grand_total = self.doc.base_rounded_total or self.doc.base_grand_total
if self.doc.doctype == "Sales Invoice" \
and self.doc.paid_amount > grand_total and not self.doc.is_return \
and self.doc.paid_amount > grand_total and not self.doc.is_return \
and any(d.type == "Cash" for d in self.doc.payments):
self.doc.change_amount = flt(self.doc.paid_amount - grand_total +