parent
ea599bbaad
commit
f5e303584b
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,10 @@ from reports import Report
|
||||||
from reports import report_view
|
from reports import report_view
|
||||||
|
|
||||||
|
|
||||||
|
def CURRENCY():
|
||||||
|
return models.DecimalField(decimal_places=2)
|
||||||
|
|
||||||
|
|
||||||
@user_passes_test(views._staff_only)
|
@user_passes_test(views._staff_only)
|
||||||
def reports_list(request):
|
def reports_list(request):
|
||||||
''' Lists all of the reports currently available. '''
|
''' Lists all of the reports currently available. '''
|
||||||
|
@ -101,7 +105,9 @@ def reconciliation(request, form):
|
||||||
invoice__status=commerce.Invoice.STATUS_PAID,
|
invoice__status=commerce.Invoice.STATUS_PAID,
|
||||||
).values(
|
).values(
|
||||||
"price", "quantity"
|
"price", "quantity"
|
||||||
).aggregate(total=Sum(F("price") * F("quantity")))
|
).aggregate(
|
||||||
|
total=Sum(F("price") * F("quantity"), output_field=CURRENCY()),
|
||||||
|
)
|
||||||
|
|
||||||
data.append(["Paid items", sales["total"]])
|
data.append(["Paid items", sales["total"]])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue