Skip to content

Commit

Permalink
fix: better remarks on Cr note created by Reconciliation
Browse files Browse the repository at this point in the history
(cherry picked from commit 47cb349)

# Conflicts:
#	erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Aug 10, 2023
1 parent a864e07 commit 5443592
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
Expand All @@ -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)
},
],
}
Expand All @@ -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()

0 comments on commit 5443592

Please sign in to comment.