fix: Payment reco query with max invocie and payment amount limit
(cherry picked from commit 4008c95ac6afc3b06a0a602e3f469db61e1f0453)
This commit is contained in:
parent
5ed9b9f42f
commit
e6cb948a96
@ -350,9 +350,13 @@ class PaymentReconciliation(Document):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if self.minimum_invoice_amount:
|
if self.minimum_invoice_amount:
|
||||||
condition += " and `{0}` >= {1}".format(dr_or_cr, flt(self.minimum_invoice_amount))
|
condition += " and {dr_or_cr} >= {amount}".format(
|
||||||
|
dr_or_cr=dr_or_cr, amount=flt(self.minimum_invoice_amount)
|
||||||
|
)
|
||||||
if self.maximum_invoice_amount:
|
if self.maximum_invoice_amount:
|
||||||
condition += " and `{0}` <= {1}".format(dr_or_cr, flt(self.maximum_invoice_amount))
|
condition += " and {dr_or_cr} <= {amount}".format(
|
||||||
|
dr_or_cr=dr_or_cr, amount=flt(self.maximum_invoice_amount)
|
||||||
|
)
|
||||||
|
|
||||||
elif get_return_invoices:
|
elif get_return_invoices:
|
||||||
condition = " and doc.company = '{0}' ".format(self.company)
|
condition = " and doc.company = '{0}' ".format(self.company)
|
||||||
@ -367,15 +371,19 @@ class PaymentReconciliation(Document):
|
|||||||
else ""
|
else ""
|
||||||
)
|
)
|
||||||
dr_or_cr = (
|
dr_or_cr = (
|
||||||
"gl.debit_in_account_currency"
|
"debit_in_account_currency"
|
||||||
if erpnext.get_party_account_type(self.party_type) == "Receivable"
|
if erpnext.get_party_account_type(self.party_type) == "Receivable"
|
||||||
else "gl.credit_in_account_currency"
|
else "credit_in_account_currency"
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.minimum_invoice_amount:
|
if self.minimum_invoice_amount:
|
||||||
condition += " and `{0}` >= {1}".format(dr_or_cr, flt(self.minimum_payment_amount))
|
condition += " and gl.{dr_or_cr} >= {amount}".format(
|
||||||
|
dr_or_cr=dr_or_cr, amount=flt(self.minimum_payment_amount)
|
||||||
|
)
|
||||||
if self.maximum_invoice_amount:
|
if self.maximum_invoice_amount:
|
||||||
condition += " and `{0}` <= {1}".format(dr_or_cr, flt(self.maximum_payment_amount))
|
condition += " and gl.{dr_or_cr} <= {amount}".format(
|
||||||
|
dr_or_cr=dr_or_cr, amount=flt(self.maximum_payment_amount)
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
condition += (
|
condition += (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user