Merge pull request #18785 from rohitwaghchaure/payment_recon_for_debit_entry_not_working_properly_develop
fix: debit note not reconciled with another purchase invoice using pa…
This commit is contained in:
commit
a23fc327df
@ -257,11 +257,8 @@ def reconcile_dr_cr_note(dr_cr_notes):
|
|||||||
voucher_type = ('Credit Note'
|
voucher_type = ('Credit Note'
|
||||||
if d.voucher_type == 'Sales Invoice' else 'Debit Note')
|
if d.voucher_type == 'Sales Invoice' else 'Debit Note')
|
||||||
|
|
||||||
dr_or_cr = ('credit_in_account_currency'
|
|
||||||
if d.reference_type == 'Sales Invoice' else 'debit_in_account_currency')
|
|
||||||
|
|
||||||
reconcile_dr_or_cr = ('debit_in_account_currency'
|
reconcile_dr_or_cr = ('debit_in_account_currency'
|
||||||
if dr_or_cr == 'credit_in_account_currency' else 'credit_in_account_currency')
|
if d.dr_or_cr == 'credit_in_account_currency' else 'credit_in_account_currency')
|
||||||
|
|
||||||
jv = frappe.get_doc({
|
jv = frappe.get_doc({
|
||||||
"doctype": "Journal Entry",
|
"doctype": "Journal Entry",
|
||||||
@ -272,8 +269,7 @@ def reconcile_dr_cr_note(dr_cr_notes):
|
|||||||
'account': d.account,
|
'account': d.account,
|
||||||
'party': d.party,
|
'party': d.party,
|
||||||
'party_type': d.party_type,
|
'party_type': d.party_type,
|
||||||
reconcile_dr_or_cr: (abs(d.allocated_amount)
|
d.dr_or_cr: abs(d.allocated_amount),
|
||||||
if abs(d.unadjusted_amount) > abs(d.allocated_amount) else abs(d.unadjusted_amount)),
|
|
||||||
'reference_type': d.against_voucher_type,
|
'reference_type': d.against_voucher_type,
|
||||||
'reference_name': d.against_voucher
|
'reference_name': d.against_voucher
|
||||||
},
|
},
|
||||||
@ -281,7 +277,8 @@ def reconcile_dr_cr_note(dr_cr_notes):
|
|||||||
'account': d.account,
|
'account': d.account,
|
||||||
'party': d.party,
|
'party': d.party,
|
||||||
'party_type': d.party_type,
|
'party_type': d.party_type,
|
||||||
dr_or_cr: abs(d.allocated_amount),
|
reconcile_dr_or_cr: (abs(d.allocated_amount)
|
||||||
|
if abs(d.unadjusted_amount) > abs(d.allocated_amount) else abs(d.unadjusted_amount)),
|
||||||
'reference_type': d.voucher_type,
|
'reference_type': d.voucher_type,
|
||||||
'reference_name': d.voucher_no
|
'reference_name': d.voucher_no
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user