Revised the indent in the views of the accounting application.
This commit is contained in:
parent
36c9aaa975
commit
119349868d
@ -162,8 +162,9 @@ def cash(request, subject_code, period_spec):
|
||||
Q(subject__code__startswith="12") |
|
||||
Q(subject__code__startswith="21") |
|
||||
Q(subject__code__startswith="21")))\
|
||||
.aggregate(balance=Coalesce(Sum(Case(When(
|
||||
is_credit=True, then=-1),
|
||||
.aggregate(
|
||||
balance=Coalesce(Sum(Case(
|
||||
When(is_credit=True, then=-1),
|
||||
default=1) * F("amount")), 0))["balance"]
|
||||
else:
|
||||
records = list(Record.objects.filter(
|
||||
@ -176,7 +177,8 @@ def cash(request, subject_code, period_spec):
|
||||
balance_before = Record.objects.filter(
|
||||
transaction__date__lt=period.start,
|
||||
subject__code__startswith=current_subject.code)\
|
||||
.aggregate(balance=Coalesce(Sum(Case(When(
|
||||
.aggregate(
|
||||
balance=Coalesce(Sum(Case(When(
|
||||
is_credit=True, then=-1),
|
||||
default=1) * F("amount")), 0))["balance"]
|
||||
balance = balance_before
|
||||
@ -343,7 +345,8 @@ def ledger(request, subject_code, period_spec):
|
||||
balance = Record.objects.filter(
|
||||
transaction__date__lt=period.start,
|
||||
subject__code__startswith=current_subject.code)\
|
||||
.aggregate(balance=Coalesce(Sum(Case(When(
|
||||
.aggregate(
|
||||
balance=Coalesce(Sum(Case(When(
|
||||
is_credit=True, then=-1),
|
||||
default=1) * F("amount")), 0))["balance"]
|
||||
record_brought_forward = Record(
|
||||
|
Loading…
Reference in New Issue
Block a user