mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
refactor: use dr / cr account currency field for journals
(cherry picked from commit 9c1a4e284c)
This commit is contained in:
@@ -2583,7 +2583,11 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
for x in advance_doctype_references:
|
for x in advance_doctype_references:
|
||||||
# Looking for payments
|
# Looking for payments
|
||||||
dr_or_cr = "credit" if x.account_type == "Receivable" else "debit"
|
dr_or_cr = (
|
||||||
|
"credit_in_account_currency"
|
||||||
|
if x.account_type == "Receivable"
|
||||||
|
else "debit_in_account_currency"
|
||||||
|
)
|
||||||
|
|
||||||
amount = x.get(dr_or_cr)
|
amount = x.get(dr_or_cr)
|
||||||
if amount > 0:
|
if amount > 0:
|
||||||
@@ -2595,6 +2599,7 @@ class AccountsController(TransactionBase):
|
|||||||
doc.against_voucher_no = x.reference_name
|
doc.against_voucher_no = x.reference_name
|
||||||
doc.amount = amount if self.docstatus == 1 else -1 * amount
|
doc.amount = amount if self.docstatus == 1 else -1 * amount
|
||||||
doc.event = "Submit" if self.docstatus == 1 else "Cancel"
|
doc.event = "Submit" if self.docstatus == 1 else "Cancel"
|
||||||
|
doc.currency = x.account_currency
|
||||||
doc.save()
|
doc.save()
|
||||||
|
|
||||||
def make_advance_payment_ledger_for_payment(self):
|
def make_advance_payment_ledger_for_payment(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user