fix: Payment reco error in multicompany setup
This commit is contained in:
parent
e5d9ebe32e
commit
e2fdff5777
@ -170,7 +170,7 @@ class PaymentReconciliation(Document):
|
||||
reconcile_against_document(lst)
|
||||
|
||||
if dr_or_cr_notes:
|
||||
reconcile_dr_cr_note(dr_or_cr_notes)
|
||||
reconcile_dr_cr_note(dr_or_cr_notes, self.receivable_payable_account)
|
||||
|
||||
msgprint(_("Successfully Reconciled"))
|
||||
self.get_unreconciled_entries()
|
||||
@ -261,7 +261,8 @@ class PaymentReconciliation(Document):
|
||||
|
||||
return cond
|
||||
|
||||
def reconcile_dr_cr_note(dr_cr_notes):
|
||||
def reconcile_dr_cr_note(dr_cr_notes, receivable_payable_account):
|
||||
company = frappe.db.get_value('Account', receivable_payable_account, 'company')
|
||||
for d in dr_cr_notes:
|
||||
voucher_type = ('Credit Note'
|
||||
if d.voucher_type == 'Sales Invoice' else 'Debit Note')
|
||||
@ -273,6 +274,7 @@ def reconcile_dr_cr_note(dr_cr_notes):
|
||||
"doctype": "Journal Entry",
|
||||
"voucher_type": voucher_type,
|
||||
"posting_date": today(),
|
||||
"company": company,
|
||||
"accounts": [
|
||||
{
|
||||
'account': d.account,
|
||||
|
Loading…
x
Reference in New Issue
Block a user