Initial commit
This commit is contained in:
10
reports/cost.md.jinja
Normal file
10
reports/cost.md.jinja
Normal file
@@ -0,0 +1,10 @@
|
||||
# Cost Report
|
||||
{% set ns = namespace() %}
|
||||
{%- set ns.total = 0 %}
|
||||
{%- for ingredient in ingredients %}
|
||||
{%- set price = db(ingredient.name ~ '.shopping.price_per_unit') * (ingredient.quantity.value | float) %}
|
||||
* {{ ingredient.name }}: {{ price | number_to_currency }}
|
||||
{%- set ns.total = ns.total + price %}
|
||||
{%- endfor %}
|
||||
|
||||
Total: ${{ ns.total | format_price }}
|
||||
Reference in New Issue
Block a user