fix: better remarks on Cr note created by Reconciliation
This commit is contained in:
parent
b0c79a0467
commit
47cb349362
@ -797,6 +797,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))
|
||||
|
||||
|
@ -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 (
|
||||
@ -657,6 +657,7 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
||||
"reference_name": inv.against_voucher,
|
||||
"cost_center": erpnext.get_default_cost_center(company),
|
||||
"exchange_rate": inv.exchange_rate,
|
||||
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} against {inv.against_voucher}",
|
||||
},
|
||||
{
|
||||
"account": inv.account,
|
||||
@ -671,6 +672,7 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
||||
"reference_name": inv.voucher_no,
|
||||
"cost_center": erpnext.get_default_cost_center(company),
|
||||
"exchange_rate": inv.exchange_rate,
|
||||
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} from {inv.voucher_no}",
|
||||
},
|
||||
],
|
||||
}
|
||||
@ -678,6 +680,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
||||
|
||||
jv.flags.ignore_mandatory = True
|
||||
jv.flags.ignore_exchange_rate = True
|
||||
jv.remark = None
|
||||
jv.flags.skip_remarks_creation = True
|
||||
jv.submit()
|
||||
|
||||
if inv.difference_amount != 0:
|
||||
|
Loading…
Reference in New Issue
Block a user