{% extends "base.html" %} {% block content %}

{{ _('Generate from Time, Costs & Goods') }}

{{ _('Select unbilled time entries, project costs, and extra goods to add to this invoice') }}

{{ _('Back to Edit') }}

{{ _('Unbilled Time Entries') }}

{% if grouped_time_entries %}
{% for day in grouped_time_entries %}
{{ day.date.strftime('%Y-%m-%d') if day.date else '-' }}
{{ '%.2f'|format(day.total_hours) }} {{ _('h') }} · {{ day.entries|length }} {{ _('entries') }}
{% for entry in day.entries %} {% endfor %}
{% endfor %}
{% elif time_entries %}
{% for entry in time_entries %} {% endfor %}
{% else %}
{{ _('No unbilled time entries found for this project.') }}
{% endif %}

{{ _('Uninvoiced Project Costs') }}

{% if project_costs %}
{% for cost in project_costs %} {% endfor %}
{% else %}
{{ _('No uninvoiced costs found for this project.') }}
{% endif %}

{{ _('Uninvoiced Billable Expenses') }}

{% if expenses %}
{% for expense in expenses %} {% endfor %}
{% else %}
{{ _('No uninvoiced billable expenses found for this project.') }}
{% endif %}

{{ _('Project Extra Goods') }}

{% if extra_goods %}
{% for good in extra_goods %} {% endfor %}
{% else %}
{{ _('No extra goods found for this project.') }}
{% endif %}
{{ _('Cancel') }}

{{ _('Selection Summary') }}

{{ _('Total available hours') }}: {{ '%.2f'|format(total_available_hours) }}
{{ _('Total available costs') }}: {{ '%.2f'|format(total_available_costs) }} {{ currency }}
{{ _('Total available expenses') }}: {{ '%.2f'|format(total_available_expenses) }} {{ currency }}
{{ _('Total available goods') }}: {{ '%.2f'|format(total_available_goods) }} {{ currency }}
{% if prepaid_plan_hours %}

{{ _('Prepaid Hours Overview') }}

{{ _('Plan includes %(hours)s hours per cycle (resets on day %(day)s).', hours='%.2f'|format(prepaid_plan_hours), day=prepaid_reset_day) }}

{% if prepaid_summary %}
    {% for item in prepaid_summary %}
  • {{ item.allocation_month_label }} {{ _('Consumed: %(consumed)s h • Remaining: %(remaining)s h', consumed='%.2f'|format(item.consumed_hours), remaining='%.2f'|format(item.remaining_hours)) }}
  • {% endfor %}
{% else %}

{{ _('No prepaid usage recorded for selected period yet.') }}

{% endif %}
{% endif %}

{{ _('Tips') }}

  • {{ _('You can select multiple time entries, costs, expenses, and extra goods.') }}
  • {{ _('Time entries are grouped by task or project at item creation.') }}
  • {{ _('Costs and extra goods are added as individual invoice items.') }}
  • {{ _('Expenses are linked to the invoice and appear in a separate section.') }}
{% endblock %} {% block scripts_extra %} {% endblock %}