Payment reco auto allocation and maintain same order of records (#12963)

* Automatically allocate amount after selecting invoice against a payment entry

* codacy fixes
This commit is contained in:
Nabin Hait
2018-02-16 13:14:20 +05:30
committed by GitHub
parent 103c4e9b92
commit cc98d40ff7
3 changed files with 21 additions and 1 deletions

View File

@@ -883,6 +883,7 @@ def get_advance_payment_entries(party_type, party, party_account,
t1.name = t2.parent and t1.{0} = %s and t1.payment_type = %s
and t1.party_type = %s and t1.party = %s and t1.docstatus = 1
and t2.reference_doctype = %s {1}
order by t1.posting_date
""".format(party_account_field, reference_condition),
[party_account, payment_type, party_type, party, order_doctype] + order_list, as_dict=1)
@@ -894,6 +895,7 @@ def get_advance_payment_entries(party_type, party, party_account,
where
{0} = %s and party_type = %s and party = %s and payment_type = %s
and docstatus = 1 and unallocated_amount > 0
order by posting_date
""".format(party_account_field), (party_account, party_type, party, payment_type), as_dict=1)
return list(payment_entries_against_order) + list(unallocated_payment_entries)