%inherit file="/page.mako" />
% for e in exps:
% if len(exps) > 1:
${get_d(e)}
% endif
% for c in e.catexps:
<%self:detail name="${c.cat.name}" sum="${c.expense}" set="${c.all}" args="exp">
${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}
%self:detail>
% endfor
<%self:detail name="Constant" sum="${e.constsum}" set="${e.consts}" args="exp">
${exp.monthly} -- ${exp.description}
%self:detail>
<%self:detail name="In Summa" sum="${e.sum}" set="${e.all}" args="exp">
${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}
%self:detail>
% endfor
<%
if e.date.month == 1:
date = "%s/12" % (e.date.year - 1)
else:
date = "%s/%s" % (e.date.year, e.date.month - 1)
%>
${self.left_arrow(date, date)}
% if not is_last:
<%
if e.date.month == 13 - len(exps):
date = "%s/1" % (e.date.year + 1)
else:
date = "%s/%s" % (e.date.year, e.date.month + len(exps))
%>
${self.right_arrow(date, date)}
% endif
<%def name="heading()">
% if len(exps) > 1:
Current expenses
% else:
Expenses for ${get_d(exps[0])}
% endif
%def>
<%def name="get_d(e)">
${e.date.year}/${e.date.month}
%def>
<%def name="js()">
${parent.js()}
%def>
<%def name="detail(name, sum, set)">
${name}: ${sum}
% for exp in set:
- ${caller.body(exp)}
% endfor
%def>