{* !!! Sales report sidebar temporarily commented out *}
[`Total profit`]
{$total.profit|wa_format_amount_currency:$def_cur}
{sprintf_wp('≈ %d%% of total sales (%s)', round($total.profit * 100 / ifempty($total.sales, 1)), "{$total.sales|wa_format_amount_currency:$def_cur}")}
[`Expenses`]
{$total.purchase|wa_format_amount_currency:$def_cur} [`Product purchase`]
{$total.shipping|wa_format_amount_currency:$def_cur} [`Shipping`]
{$total.tax|wa_format_amount_currency:$def_cur} [`Tax`]
[`Average daily profit`]
{sprintf_wp('%s/day', "{$avg_profit|wa_format_amount_currency:$def_cur}")}
{if $group_by == 'days'}
[`Profit by day`]
{else}
[`Profit by month`]
{/if}
{foreach array_reverse($by_day) as $d} {if $group_by == 'days'} {else} {/if} {/foreach}
{$d.date|wa_date:'humandate'}{_ws(date('F', strtotime($d.date)), date('F', strtotime($d.date)), '1')} {$d.date|wa_date:'Y'}{_ws(date('D', strtotime($d.date)))} {$d.total|wa_format_amount_currency:$def_cur}