Fixed the cash report to display income first then expense in a transaction, to prevent negative cash balance.
This commit is contained in:
parent
fd47f7bd94
commit
500467432a
@ -94,7 +94,7 @@ def cash(request: HttpRequest, account: Account,
|
|||||||
~Q(account__code__startswith="21"),
|
~Q(account__code__startswith="21"),
|
||||||
~Q(account__code__startswith="22"))
|
~Q(account__code__startswith="22"))
|
||||||
.order_by("transaction__date", "transaction__ord",
|
.order_by("transaction__date", "transaction__ord",
|
||||||
"is_credit", "ord"))
|
"-is_credit", "ord"))
|
||||||
balance_before = Record.objects \
|
balance_before = Record.objects \
|
||||||
.filter(
|
.filter(
|
||||||
Q(transaction__date__lt=period.start),
|
Q(transaction__date__lt=period.start),
|
||||||
@ -116,7 +116,7 @@ def cash(request: HttpRequest, account: Account,
|
|||||||
Q(record__account__code__startswith=account.code))),
|
Q(record__account__code__startswith=account.code))),
|
||||||
~Q(account__code__startswith=account.code))
|
~Q(account__code__startswith=account.code))
|
||||||
.order_by("transaction__date", "transaction__ord",
|
.order_by("transaction__date", "transaction__ord",
|
||||||
"is_credit", "ord"))
|
"-is_credit", "ord"))
|
||||||
balance_before = Record.objects \
|
balance_before = Record.objects \
|
||||||
.filter(
|
.filter(
|
||||||
transaction__date__lt=period.start,
|
transaction__date__lt=period.start,
|
||||||
|
Loading…
Reference in New Issue
Block a user