fix: validate payment request total of partly paid invoice
(cherry picked from commit 899c18df18)
This commit is contained in:
@@ -775,7 +775,10 @@ def get_existing_paid_amount(doctype, name):
|
|||||||
frappe.qb.from_(PL)
|
frappe.qb.from_(PL)
|
||||||
.left_join(PER)
|
.left_join(PER)
|
||||||
.on(
|
.on(
|
||||||
(PER.reference_doctype == PL.against_voucher_type) & (PER.reference_name == PL.against_voucher_no)
|
(PL.against_voucher_type == PER.reference_doctype)
|
||||||
|
& (PL.against_voucher_no == PER.reference_name)
|
||||||
|
& (PL.voucher_type == PER.parenttype)
|
||||||
|
& (PL.voucher_no == PER.parent)
|
||||||
)
|
)
|
||||||
.select(Abs(Sum(PL.amount)).as_("total_paid_amount"))
|
.select(Abs(Sum(PL.amount)).as_("total_paid_amount"))
|
||||||
.where(PL.against_voucher_type.eq(doctype))
|
.where(PL.against_voucher_type.eq(doctype))
|
||||||
|
|||||||
Reference in New Issue
Block a user