Merge pull request #29142 from ruchamahabal/accounting-dimension-mapping

fix: map Accounting Dimensions for Bank Entry against Payroll Entry
This commit is contained in:
Deepesh Garg 2022-01-04 20:27:22 +05:30 committed by GitHub
commit ae3d2b4438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,23 +398,24 @@ class PayrollEntry(Document):
currencies = []
multi_currency = 0
company_currency = erpnext.get_company_currency(self.company)
accounting_dimensions = get_accounting_dimensions() or []
exchange_rate, amount = self.get_amount_and_exchange_rate_for_journal_entry(self.payment_account, je_payment_amount, company_currency, currencies)
accounts.append({
accounts.append(self.update_accounting_dimensions({
"account": self.payment_account,
"bank_account": self.bank_account,
"credit_in_account_currency": flt(amount, precision),
"exchange_rate": flt(exchange_rate),
})
}, accounting_dimensions))
exchange_rate, amount = self.get_amount_and_exchange_rate_for_journal_entry(payroll_payable_account, je_payment_amount, company_currency, currencies)
accounts.append({
accounts.append(self.update_accounting_dimensions({
"account": payroll_payable_account,
"debit_in_account_currency": flt(amount, precision),
"exchange_rate": flt(exchange_rate),
"reference_type": self.doctype,
"reference_name": self.name
})
}, accounting_dimensions))
if len(currencies) > 1:
multi_currency = 1