mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
refactor: cr/dr note will be on single exchange rate
(cherry picked from commit c87332d5da)
# Conflicts:
# erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
This commit is contained in:
@@ -756,18 +756,23 @@ class JournalEntry(AccountsController):
|
|||||||
)
|
)
|
||||||
):
|
):
|
||||||
|
|
||||||
# Modified to include the posting date for which to retreive the exchange rate
|
ignore_exchange_rate = False
|
||||||
d.exchange_rate = get_exchange_rate(
|
if self.get("flags") and self.flags.get("ignore_exchange_rate"):
|
||||||
self.posting_date,
|
ignore_exchange_rate = True
|
||||||
d.account,
|
|
||||||
d.account_currency,
|
if not ignore_exchange_rate:
|
||||||
self.company,
|
# Modified to include the posting date for which to retreive the exchange rate
|
||||||
d.reference_type,
|
d.exchange_rate = get_exchange_rate(
|
||||||
d.reference_name,
|
self.posting_date,
|
||||||
d.debit,
|
d.account,
|
||||||
d.credit,
|
d.account_currency,
|
||||||
d.exchange_rate,
|
self.company,
|
||||||
)
|
d.reference_type,
|
||||||
|
d.reference_name,
|
||||||
|
d.debit,
|
||||||
|
d.credit,
|
||||||
|
d.exchange_rate,
|
||||||
|
)
|
||||||
|
|
||||||
if not d.exchange_rate:
|
if not d.exchange_rate:
|
||||||
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
|
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
|
||||||
|
|||||||
@@ -634,7 +634,11 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
|||||||
"reference_type": inv.against_voucher_type,
|
"reference_type": inv.against_voucher_type,
|
||||||
"reference_name": inv.against_voucher,
|
"reference_name": inv.against_voucher,
|
||||||
"cost_center": erpnext.get_default_cost_center(company),
|
"cost_center": erpnext.get_default_cost_center(company),
|
||||||
|
<<<<<<< HEAD
|
||||||
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} against {inv.against_voucher}",
|
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} against {inv.against_voucher}",
|
||||||
|
=======
|
||||||
|
"exchange_rate": inv.exchange_rate,
|
||||||
|
>>>>>>> c87332d5da (refactor: cr/dr note will be on single exchange rate)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"account": inv.account,
|
"account": inv.account,
|
||||||
@@ -648,17 +652,23 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
|||||||
"reference_type": inv.voucher_type,
|
"reference_type": inv.voucher_type,
|
||||||
"reference_name": inv.voucher_no,
|
"reference_name": inv.voucher_no,
|
||||||
"cost_center": erpnext.get_default_cost_center(company),
|
"cost_center": erpnext.get_default_cost_center(company),
|
||||||
|
<<<<<<< HEAD
|
||||||
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} from {inv.voucher_no}",
|
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} from {inv.voucher_no}",
|
||||||
|
=======
|
||||||
|
"exchange_rate": inv.exchange_rate,
|
||||||
|
>>>>>>> c87332d5da (refactor: cr/dr note will be on single exchange rate)
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if difference_entry := get_difference_row(inv):
|
|
||||||
jv.append("accounts", difference_entry)
|
|
||||||
|
|
||||||
jv.flags.ignore_mandatory = True
|
jv.flags.ignore_mandatory = True
|
||||||
|
<<<<<<< HEAD
|
||||||
jv.remark = None
|
jv.remark = None
|
||||||
jv.flags.skip_remarks_creation = True
|
jv.flags.skip_remarks_creation = True
|
||||||
jv.is_system_generated = True
|
jv.is_system_generated = True
|
||||||
|
=======
|
||||||
|
jv.flags.ignore_exchange_rate = True
|
||||||
|
>>>>>>> c87332d5da (refactor: cr/dr note will be on single exchange rate)
|
||||||
jv.submit()
|
jv.submit()
|
||||||
|
jv.make_exchange_gain_loss_journal(args=[inv])
|
||||||
|
|||||||
Reference in New Issue
Block a user