{% if projects|e %} {% for project in projects %}

{{ project.name }}

Due: {{ project.due_date }}

{{ project.current_hours }} / {{ project.budgeted_hours }}: (Hours / Budgeted Hours @ {{ project.task_rate }}) - Report generated on {{ "now"|date('Y-m-d') }}
{% if project.tasks is not empty %} {% for task in project.tasks %} {% for log in task.time_log%} {% endfor %} {% endfor %}
{{ t('date') }} {{ t('description') }} {{ t('duration') }}
{{ log.start_date }}
  • {{ log.description }}
  • {{ task.user.name }}
{{ log.duration|date('h:i:s')}}
{% endif %} {% if project.invoices %}

{{ t('invoices') }}

{% set total_amount = 0 %} {% set total_balance = 0 %} {% for invoice in project.invoices %} {% set total_amount = total_amount + invoice.amount_raw %} {% set total_balance = total_balance + invoice.balance_raw %} {% endfor%}
{{ t('date')}} {{ t('invoice_number')}} {{ t('amount') }} {{ t('balance') }}
{{ invoice.date }} {{ invoice.number }} {{ invoice.amount }} {{ invoice.balance }}
{{ total_amount|format_currency(currency_code) }} {{ total_balance|format_currency(currency_code) }}
{% endif %} {% if project.expenses %}

{{ t('expenses') }}

{% set total_expense_amount = 0 %} {% for expense in project.expenses %} {% set total_expense_amount = total_expense_amount + expense.amount_raw %} {% endfor%}
{{ t('date')}} {{ t('number')}} {{ t('amount') }}
{{ expense.date }} {{ expense.number }} {{ expense.amount }}
{{ total_expense_amount|format_currency(currency_code) }}
{% endif %}
{{ t('summary') }} {{ t('amount') }}
{{ t('project_value') }} {{ (project.budgeted_hours * project.task_rate_raw)|format_currency(currency_code) }}
{{ t('invoice_task_hours') }} {{ (project.current_hours * project.task_rate_raw)|format_currency(currency_code) }}
{{ t('invoiced') }} {{ total_amount|format_currency(currency_code) }}
{{ t('expenses') }} {{ total_expense_amount|format_currency(currency_code) }}
{{ t('profit') }} {{ (total_amount - total_expense_amount)|format_currency(currency_code) }}
{% endfor %} {% endif %}