fix: better remarks on Cr note created by Reconciliation

(cherry picked from commit 47cb349362)

# Conflicts:
#	erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
This commit is contained in:
ruthra kumar
2023-08-09 20:43:51 +05:30
committed by Mergify
parent a864e07d4f
commit 5443592d84
2 changed files with 20 additions and 1 deletions

View File

@@ -775,6 +775,9 @@ class JournalEntry(AccountsController):
def create_remarks(self):
r = []
if self.flags.skip_remarks_creation:
return
if self.user_remark:
r.append(_("Note: {0}").format(self.user_remark))

View File

@@ -6,7 +6,7 @@ import frappe
from frappe import _, msgprint, qb
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, get_link_to_form, getdate, nowdate, today
from frappe.utils import flt, fmt_money, get_link_to_form, getdate, nowdate, today
import erpnext
from erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation import (
@@ -640,6 +640,11 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
"reference_type": inv.against_voucher_type,
"reference_name": inv.against_voucher,
"cost_center": erpnext.get_default_cost_center(company),
<<<<<<< HEAD
=======
"exchange_rate": inv.exchange_rate,
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} against {inv.against_voucher}",
>>>>>>> 47cb349362 (fix: better remarks on Cr note created by Reconciliation)
},
{
"account": inv.account,
@@ -653,6 +658,11 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
"reference_type": inv.voucher_type,
"reference_name": inv.voucher_no,
"cost_center": erpnext.get_default_cost_center(company),
<<<<<<< HEAD
=======
"exchange_rate": inv.exchange_rate,
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} from {inv.voucher_no}",
>>>>>>> 47cb349362 (fix: better remarks on Cr note created by Reconciliation)
},
],
}
@@ -662,4 +672,10 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
jv.append("accounts", difference_entry)
jv.flags.ignore_mandatory = True
<<<<<<< HEAD
=======
jv.flags.ignore_exchange_rate = True
jv.remark = None
jv.flags.skip_remarks_creation = True
>>>>>>> 47cb349362 (fix: better remarks on Cr note created by Reconciliation)
jv.submit()