Profit/Loss Statement {% if report.startDate %} (From {{report.startDateUsingFormatter}} {% if report.endDate %} To {{report.endDateUsingFormatter}}) {% else %} To Present) {% /if %} {% /if %}

{% decimalMath totIncome = 0 %} {% decimalMath totExpense = 0 %} {% decimalMath profit = 0 %} {% for item in transactionsByClient %} {% if item.transaction.isPayment %} {% decimalMath totIncome = totIncome + item.transaction.transactionValue %} {% decimalMath profit = profit + item.transaction.transactionValue %} {% /if %} {% /for %} {% for entry in expenses %} {% decimalMath totExpense = totExpense + entry.cost %} {% decimalMath profit = profit - entry.cost %} {% /for %}
Income {{totIncome | currency_format}}
Expense {{totExpense | currency_format}}
Profit/Loss {{profit | currency_format}}

{% decimalMath totalPaid = 0 %} {% decimalMath clientPaid = 0 %} {% decimalMath start = 0 %} {% for item in transactionsByClient %} {% if start == 0 %} {% set clientId item.transaction.client.uuid %} {% decimalMath start = 1 %} {% else %} {% if clientId isnotequaltostring item.transaction.client.uuid %} {% decimalMath clientPaid = 0 %} {% /if %} {% /if %} {% set clientId item.transaction.client.uuid %} {% if item.transaction.isPayment %} {% decimalMath totalPaid = totalPaid + item.transaction.transactionValue %} {% decimalMath clientPaid = clientPaid + item.transaction.transactionValue %} {% /if %} {% /for %} {% if start == 1 %} {% /if %}
Income Total
{{ item.transaction.client.displayName.escapedForHTML }}{{clientPaid | currency_format}}
{{ item.transaction.client.displayName.escapedForHTML }}{{clientPaid | currency_format}}
Income Totals: {{totalPaid | currency_format}}
{% decimalMath catExpense = 0 %} {% decimalMath totExpense = 0 %} {% for cat in expenseCategories %} {% for entry in expenses %} {% if cat.name isequaltostring entry.expenseCategoryName %} {% decimalMath catExpense = catExpense + entry.cost %} {% decimalMath totExpense = totExpense + entry.cost %} {% /if %} {% /for %} {% decimalMath catExpense = 0 %} {% /for %}
Expenses Amount
{{ cat.name }} {{catExpense | currency_format}}
Expense Total: {{totExpense | currency_format}}

Reported generated on {% now | date_format: "MMM dd yyyy 'at' HH:mm:ss" %}.