fix: cost center in exchange gain loss gl entry
This commit is contained in:
parent
dd2d039ca8
commit
78ad50efc2
@ -714,7 +714,7 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
gain_loss_account = frappe.db.get_value('Company', self.company, 'exchange_gain_loss_account')
|
gain_loss_account = frappe.db.get_value('Company', self.company, 'exchange_gain_loss_account')
|
||||||
if not gain_loss_account:
|
if not gain_loss_account:
|
||||||
frappe.throw(_("Please set Default Exchange Gain/Loss Account in Company {}")
|
frappe.throw(_("Please set default Exchange Gain/Loss Account in Company {}")
|
||||||
.format(self.get('company')))
|
.format(self.get('company')))
|
||||||
account_currency = get_account_currency(gain_loss_account)
|
account_currency = get_account_currency(gain_loss_account)
|
||||||
if account_currency != self.company_currency:
|
if account_currency != self.company_currency:
|
||||||
@ -733,7 +733,7 @@ class AccountsController(TransactionBase):
|
|||||||
"against": party,
|
"against": party,
|
||||||
dr_or_cr + "_in_account_currency": abs(d.exchange_gain_loss),
|
dr_or_cr + "_in_account_currency": abs(d.exchange_gain_loss),
|
||||||
dr_or_cr: abs(d.exchange_gain_loss),
|
dr_or_cr: abs(d.exchange_gain_loss),
|
||||||
"cost_center": self.cost_center,
|
"cost_center": self.cost_center or erpnext.get_default_cost_center(self.company),
|
||||||
"project": self.project
|
"project": self.project
|
||||||
}, item=d)
|
}, item=d)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user