error fixed in posting balance
This commit is contained in:
parent
2b9a13d81f
commit
cf907f98bd
@ -152,8 +152,12 @@ class DocType:
|
|||||||
amt = flt(self.doc.debit) - flt(self.doc.credit)
|
amt = flt(self.doc.debit) - flt(self.doc.credit)
|
||||||
if det[0][2] == 'Credit': amt = -amt
|
if det[0][2] == 'Credit': amt = -amt
|
||||||
|
|
||||||
debit = cancel and -1 * flt(self.doc.credit) or flt(self.doc.debit)
|
if cancel:
|
||||||
credit = cancel and -1 * flt(self.doc.debit) or flt(self.doc.credit)
|
debit = -1 * flt(self.doc.credit)
|
||||||
|
credit = -1 * flt(self.doc.debit)
|
||||||
|
else:
|
||||||
|
debit = flt(self.doc.debit)
|
||||||
|
credit = flt(self.doc.credit)
|
||||||
|
|
||||||
self.create_new_balances(det)
|
self.create_new_balances(det)
|
||||||
|
|
||||||
@ -197,7 +201,7 @@ class DocType:
|
|||||||
and ifnull(a.is_pl_account, 'No') = 'No'
|
and ifnull(a.is_pl_account, 'No') = 'No'
|
||||||
and ab.period = ab.fiscal_year
|
and ab.period = ab.fiscal_year
|
||||||
and fy.name = ab.fiscal_year
|
and fy.name = ab.fiscal_year
|
||||||
and fy.year_start_date > %(posting_date)s""" % p)
|
and fy.year_start_date > '%(posting_date)s'""" % p)
|
||||||
|
|
||||||
# Update balance for all period for future years
|
# Update balance for all period for future years
|
||||||
sql("""update `tabAccount Balance` ab, `tabAccount` a, `tabFiscal Year` fy
|
sql("""update `tabAccount Balance` ab, `tabAccount` a, `tabFiscal Year` fy
|
||||||
@ -209,7 +213,7 @@ class DocType:
|
|||||||
and ab.account = a.name
|
and ab.account = a.name
|
||||||
and ifnull(a.is_pl_account, 'No') = 'No'
|
and ifnull(a.is_pl_account, 'No') = 'No'
|
||||||
and fy.name = ab.fiscal_year
|
and fy.name = ab.fiscal_year
|
||||||
and fy.year_start_date > %(posting_date)s""" % p)
|
and fy.year_start_date > '%(posting_date)s'""" % p)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user