diff options
Diffstat (limited to 'templates/report')
-rw-r--r-- | templates/report/list.j2 | 14 | ||||
-rw-r--r-- | templates/report/report.j2 | 50 |
2 files changed, 64 insertions, 0 deletions
diff --git a/templates/report/list.j2 b/templates/report/list.j2 new file mode 100644 index 0000000..ef53244 --- /dev/null +++ b/templates/report/list.j2 @@ -0,0 +1,14 @@ +{% macro list(resource, action, xs) -%} + +{% if xs -%} + + {% set s = xs | length | pluralize -%} + + {{ xs | length }} {{ resource }}{{ s }} {{ action }}{{ s }} : + + {% for x in xs -%} + - {{ x.date }} {{ x.name }} {{ x.amount | euros() }} + {% endfor %} +{% endif -%} + +{% endmacro paging %} diff --git a/templates/report/report.j2 b/templates/report/report.j2 new file mode 100644 index 0000000..d36f3ce --- /dev/null +++ b/templates/report/report.j2 @@ -0,0 +1,50 @@ +{% import "report/list.j2" as list %} + +{% if exceeding_payers -%} + + Équilibre : + + {% for exceeding_payer in exceeding_payers -%} + - {{ exceeding_payer.0 }} : +{{ exceeding_payer.1 | euros() }} + {% endfor %} +{% else -%} + + Les paiements sont équilibrés. + +{% endif %}{# + +#}{{ list::list( + resource="paiement", + action="créé", + xs=payments | filter(attribute="action", value="Created") +) }}{# + +#}{{ list::list( + resource="paiement", + action="modifié", + xs=payments | filter(attribute="action", value="Updated") +) }}{# + +#}{{ list::list( + resource="paiement", + action="supprimé", + xs=payments | filter(attribute="action", value="Deleted") +) }}{# + +#}{{ list::list( + resource="revenu", + action="créé", + xs=incomes | filter(attribute="action", value="Created") +) }}{# + +#}{{ list::list( + resource="revenu", + action="modifié", + xs=incomes | filter(attribute="action", value="Updated") +) }}{# + +#}{{ list::list( + resource="revenu", + action="supprimé", + xs=incomes | filter(attribute="action", value="Deleted") +) }} |