Adds multiply as a template filter (for invoices)

This commit is contained in:
Christopher Neugebauer 2016-04-01 14:58:29 +11:00
parent 8324b51094
commit aa6377f4ce

View file

@ -49,3 +49,8 @@ def items_purchased(context):
quantity = pp.aggregate(Sum("quantity"))["quantity__sum"] quantity = pp.aggregate(Sum("quantity"))["quantity__sum"]
out.append(ProductAndQuantity(product, quantity)) out.append(ProductAndQuantity(product, quantity))
return out return out
@register.filter
def multiply(value, arg):
''' Multiplies value by arg '''
return value * arg