mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 00:12:14 +00:00
fix: partial return on POS invoice
(cherry picked from commit 18bdd06652)
This commit is contained in:
committed by
Mergify
parent
b99ca7d9e9
commit
998fef779b
@@ -449,11 +449,11 @@ class POSInvoice(SalesInvoice):
|
|||||||
if self.is_return and entry.amount > 0:
|
if self.is_return and entry.amount > 0:
|
||||||
frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
|
frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
|
||||||
|
|
||||||
if self.is_return:
|
if self.is_return and self.docstatus != 0:
|
||||||
invoice_total = self.rounded_total or self.grand_total
|
invoice_total = self.rounded_total or self.grand_total
|
||||||
total_amount_in_payments = flt(total_amount_in_payments, self.precision("grand_total"))
|
total_amount_in_payments = flt(total_amount_in_payments, self.precision("grand_total"))
|
||||||
if total_amount_in_payments and total_amount_in_payments > invoice_total:
|
if total_amount_in_payments and total_amount_in_payments < invoice_total:
|
||||||
frappe.throw(_("Total payments amount can't be greater than {}").format(invoice_total))
|
frappe.throw(_("Total payments amount can't be greater than {}").format(-invoice_total))
|
||||||
|
|
||||||
def validate_company_with_pos_company(self):
|
def validate_company_with_pos_company(self):
|
||||||
if self.company != frappe.db.get_value("POS Profile", self.pos_profile, "company"):
|
if self.company != frappe.db.get_value("POS Profile", self.pos_profile, "company"):
|
||||||
|
|||||||
Reference in New Issue
Block a user