mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-26 16:14:18 +00:00
fix(period closing voucher): closing account head debit and debit in account currency should be equal
This commit is contained in:
@@ -206,6 +206,9 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
return gl_entry
|
return gl_entry
|
||||||
|
|
||||||
def get_gle_for_closing_account(self, acc):
|
def get_gle_for_closing_account(self, acc):
|
||||||
|
debit = abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0
|
||||||
|
credit = abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0
|
||||||
|
|
||||||
gl_entry = self.get_gl_dict(
|
gl_entry = self.get_gl_dict(
|
||||||
{
|
{
|
||||||
"company": self.company,
|
"company": self.company,
|
||||||
@@ -214,16 +217,10 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
"cost_center": acc.cost_center,
|
"cost_center": acc.cost_center,
|
||||||
"finance_book": acc.finance_book,
|
"finance_book": acc.finance_book,
|
||||||
"account_currency": acc.account_currency,
|
"account_currency": acc.account_currency,
|
||||||
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency))
|
"debit_in_account_currency": debit,
|
||||||
if flt(acc.bal_in_account_currency) > 0
|
"debit": debit,
|
||||||
else 0,
|
"credit_in_account_currency": credit,
|
||||||
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0,
|
"credit": credit,
|
||||||
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency))
|
|
||||||
if flt(acc.bal_in_account_currency) < 0
|
|
||||||
else 0,
|
|
||||||
"credit": abs(flt(acc.bal_in_company_currency))
|
|
||||||
if flt(acc.bal_in_company_currency) < 0
|
|
||||||
else 0,
|
|
||||||
"is_period_closing_voucher_entry": 1,
|
"is_period_closing_voucher_entry": 1,
|
||||||
},
|
},
|
||||||
item=acc,
|
item=acc,
|
||||||
|
|||||||
Reference in New Issue
Block a user