Changed the cumulative_balance property in RecordSummary from a decorated @property to a simple property in the accounting application.
This commit is contained in:
parent
a9a47f8526
commit
18161c3fb2
@ -388,7 +388,7 @@ class RecordSummary(DirtyFieldsMixin, models.Model):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(RecordSummary, self).__init__(*args, **kwargs)
|
super(RecordSummary, self).__init__(*args, **kwargs)
|
||||||
self._label = None
|
self._label = None
|
||||||
self._cumulative_balance = None
|
self.cumulative_balance = None
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = None
|
db_table = None
|
||||||
@ -403,11 +403,3 @@ class RecordSummary(DirtyFieldsMixin, models.Model):
|
|||||||
@label.setter
|
@label.setter
|
||||||
def label(self, value):
|
def label(self, value):
|
||||||
self._label = value
|
self._label = value
|
||||||
|
|
||||||
@property
|
|
||||||
def cumulative_balance(self):
|
|
||||||
return self._cumulative_balance
|
|
||||||
|
|
||||||
@cumulative_balance.setter
|
|
||||||
def cumulative_balance(self, value):
|
|
||||||
self._cumulative_balance = value
|
|
||||||
|
@ -245,8 +245,8 @@ def cash_summary(request, account):
|
|||||||
credit=sum([x.credit for x in months]),
|
credit=sum([x.credit for x in months]),
|
||||||
debit=sum([x.debit for x in months]),
|
debit=sum([x.debit for x in months]),
|
||||||
balance=sum([x.balance for x in months]),
|
balance=sum([x.balance for x in months]),
|
||||||
cumulative_balance=cumulative_balance,
|
|
||||||
)
|
)
|
||||||
|
total.cumulative_balance = cumulative_balance
|
||||||
total.label = pgettext("Accounting|", "Total")
|
total.label = pgettext("Accounting|", "Total")
|
||||||
months.append(total)
|
months.append(total)
|
||||||
pagination = Pagination(request, months, True)
|
pagination = Pagination(request, months, True)
|
||||||
@ -388,8 +388,8 @@ def ledger_summary(request, account):
|
|||||||
credit=sum([x.credit for x in months]),
|
credit=sum([x.credit for x in months]),
|
||||||
debit=sum([x.debit for x in months]),
|
debit=sum([x.debit for x in months]),
|
||||||
balance=sum([x.balance for x in months]),
|
balance=sum([x.balance for x in months]),
|
||||||
cumulative_balance=cumulative_balance,
|
|
||||||
)
|
)
|
||||||
|
total.cumulative_balance = cumulative_balance
|
||||||
total.label = pgettext("Accounting|", "Total")
|
total.label = pgettext("Accounting|", "Total")
|
||||||
months.append(total)
|
months.append(total)
|
||||||
pagination = Pagination(request, months, True)
|
pagination = Pagination(request, months, True)
|
||||||
|
Loading…
Reference in New Issue
Block a user