Simplified the code in the cash_summary() and ledger() views in the accounting application.
This commit is contained in:
parent
ba119c4ed0
commit
4fec46413f
@ -353,7 +353,7 @@ ORDER BY month""",
|
|||||||
))
|
))
|
||||||
pagination = Pagination(request, records, True)
|
pagination = Pagination(request, records, True)
|
||||||
shortcut_subjects = settings.ACCOUNTING["CASH_SHORTCUT_SUBJECTS"]
|
shortcut_subjects = settings.ACCOUNTING["CASH_SHORTCUT_SUBJECTS"]
|
||||||
params = {
|
return render(request, "accounting/cash_summary.html", {
|
||||||
"records": pagination.records,
|
"records": pagination.records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"current_subject": current_subject,
|
"current_subject": current_subject,
|
||||||
@ -362,8 +362,7 @@ ORDER BY month""",
|
|||||||
x.code in shortcut_subjects],
|
x.code in shortcut_subjects],
|
||||||
"all_subjects": [x for x in subjects if
|
"all_subjects": [x for x in subjects if
|
||||||
x.code not in shortcut_subjects],
|
x.code not in shortcut_subjects],
|
||||||
}
|
})
|
||||||
return render(request, "accounting/cash_summary.html", params)
|
|
||||||
|
|
||||||
|
|
||||||
def _ledger_subjects():
|
def _ledger_subjects():
|
||||||
@ -448,12 +447,11 @@ def ledger(request, subject_code, period_spec):
|
|||||||
records = pagination.records
|
records = pagination.records
|
||||||
_find_imbalanced(records)
|
_find_imbalanced(records)
|
||||||
_find_order_holes(records)
|
_find_order_holes(records)
|
||||||
params = {
|
return render(request, "accounting/ledger.html", {
|
||||||
"records": records,
|
"records": records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"current_subject": current_subject,
|
"current_subject": current_subject,
|
||||||
"period": period,
|
"period": period,
|
||||||
"reports": ReportUrl(ledger=current_subject, period=period),
|
"reports": ReportUrl(ledger=current_subject, period=period),
|
||||||
"subjects": subjects,
|
"subjects": subjects,
|
||||||
}
|
})
|
||||||
return render(request, "accounting/ledger.html", params)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user