{% extends "base.html" %} {% from "_macros.html" import export_buttons, icon with context %} {% from "insights/_parts.html" import short with context %} {% block title %}{{ t('13-Week Cash Forecast') }}{% endblock %} {% block content %} {% set cur = fc.currency %}

{{ t('13-Week Cash Forecast') }}

{{ t('Bank and cash today, plus what is already known to come in and go out, week by week') }}
{{ export_buttons() }}
{{ t('Bank and Cash today') }}{{ icon('bank') }}
{{ fc.opening|money(cur) }}{{ cur }}
{{ t('Cash in, 13 weeks') }}{{ icon('down') }}
{{ fc.total_in|sum|money(cur) }}{{ cur }}
{% if fc.overdue['in'] %}{{ fc.overdue['in']|money(cur) }} {{ t('of it is overdue (shown in week 1)') }}{% endif %}
{{ t('Cash out, 13 weeks') }}{{ icon('wallet') }}
{{ fc.total_out|sum|money(cur) }}{{ cur }}
{% if fc.overdue['out'] %}{{ fc.overdue['out']|money(cur) }} {{ t('of it is overdue (shown in week 1)') }}{% endif %}
{{ t('Lowest balance') }}{{ icon('alert' if fc.lowest < 0 else 'check') }}
{{ fc.lowest|money(cur) }}{{ cur }}
{{ t('Cash runs short — arrange funding or delay payments.') if fc.lowest < 0 else t('Cash stays positive.') }}

{{ t('Closing cash by week') }}

{% set span = hi - lo %}
{% for w in fc.weeks %}{% set v = fc.closing[loop.index0] %}
{{ short(v) }}{{ w.strftime('%d/%m') }}
{% endfor %}
{% for w in fc.weeks %}{% endfor %}{% for w in fc.weeks %}{% endfor %} {% for lbl, vals in fc.inflow %}{% for v in vals %}{% endfor %}{% endfor %} {% for v in fc.total_in %}{% endfor %} {% for lbl, vals in fc.outflow %}{% for v in vals %}{% endfor %}{% endfor %} {% for v in fc.total_out %}{% endfor %}{% for v in fc.net %}{% endfor %}{% for v in fc.closing %}{% endfor %}
{{ t('Week of') }}{{ w.strftime('%d/%m') }}{{ t('Total') }}
{{ t('Opening cash') }}{{ (fc.opening if loop.first else fc.closing[loop.index0 - 1])|money(cur) }}
{{ t('Cash in') }}
{{ t(lbl) }}{{ v|money(cur) if v else '' }}{{ vals|sum|money(cur) }}
{{ t('Total cash in') }}{{ v|money(cur) }}{{ fc.total_in|sum|money(cur) }}
{{ t('Cash out') }}
{{ t(lbl) }}{{ v|money(cur) if v else '' }}{{ vals|sum|money(cur) }}
{{ t('Total cash out') }}{{ v|money(cur) }}{{ fc.total_out|sum|money(cur) }}
{{ t('Net cash flow') }}{{ v|money(cur) }}{{ fc.net|sum|money(cur) }}
{{ t('Closing cash') }}{{ v|money(cur) }}

{{ t('Overdue invoices and bills are shown in the first week. Orders not yet invoiced are placed at their expected date plus the partner’s payment terms. Salaries repeat the last posted payroll at each month end. Nothing here is posted to the books.') }}

{% endblock %}