From 5443592d84c180e27168afb624d43e36645f42f8 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 9 Aug 2023 20:43:51 +0530 Subject: [PATCH] fix: better remarks on Cr note created by Reconciliation (cherry picked from commit 47cb349362cd6a03cd544abea5483aff23b27e7e) # Conflicts: # erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py --- .../doctype/journal_entry/journal_entry.py | 3 +++ .../payment_reconciliation.py | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 594339591f52..8c5cc2c921f7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -775,6 +775,9 @@ def set_exchange_rate(self): def create_remarks(self): r = [] + if self.flags.skip_remarks_creation: + return + if self.user_remark: r.append(_("Note: {0}").format(self.user_remark)) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 216d4eccac7f..cc9e2bc5a11e 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -6,7 +6,7 @@ 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 get_difference_row(inv): "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 get_difference_row(inv): "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 get_difference_row(inv): 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()