{strip}
    {if !isset($loop_count)}
        {$loop_count = 0}
    {/if}
    {if $loop_count === 0}
        "{$i.reporting_rep_date|forcsv}"{chr(9)}
        "{$i.reporting_staff|forcsv}"{chr(9)}
        {foreach item=project from=$projects_list}
            "{$project->project|forcsv}"{chr(9)}
        {/foreach}
        "{$i.reporting_target_day|forcsv}"{chr(9)}
        "{$i.reporting_actual|forcsv}"{chr(9)}
        {foreach item=overtime_rate from=$overtime_rates}
            {if $overtime_rate->print neq 0}"{$overtime_rate->name|forcsv}"{chr(9)}{/if}
        {/foreach}
        "{$i.reporting_set_times_from|forcsv}"{chr(9)}
        "{$i.reporting_set_times_to|forcsv}"{chr(9)}
        "{$i.reporting_set_times_deduct|forcsv}"{chr(9)}
        "{$i.reporting_pause|forcsv}"{chr(9)}
        "{$i.reporting_overtime_storage|forcsv}"
        {if $home_office_use}
            {chr(9)}"{$trans_home_office|forcsv}"
        {/if}
        {"\n"}
    {/if}
{/strip}{foreach item=total from=$totals name=totals}{strip}
    {$total->date->us_date()|forcsv}{chr(9)}
    {$staff_info->staff_name|forcsv}{chr(9)}
    {foreach item=project from=$projects_list}
        {assign var="numbername" value="number`$project->id`"}
        {if !empty($total->$numbername)}{isfloat value=$total->$numbername}{/if}{chr(9)}
    {/foreach}
    {if empty($total->target_hours)}{isfloat value=0}{else}{isfloat value=$total->target_hours}{/if}{chr(9)}
    {if empty($total->number_all)}{isfloat value=0}{else}{isfloat value=$total->number_all}{/if}{chr(9)}
    {foreach item=overtime_rate from=$overtime_rates}
        {if $overtime_rate->print neq 0}
            {assign var="overtimename" value="overtime`$overtime_rate->id`"}
            {if !empty($total->$overtimename)}{isfloat value=$total->$overtimename}{/if}{chr(9)}
        {/if}
    {/foreach}
    {if isset($total->set_info) && $total->set_info}
        {* Start end Times *}
        {$total->set_start_time}{chr(9)}
        {$total->set_end_time}{chr(9)}
        {float_to_usnumber($total->set_time_deduct, 2)}{chr(9)}
        {* NO pause info*}""{chr(9)}
    {elseif !$total->time_from->is_null()}
        {* Min and Max from times *}
        {$total->time_from->us_stime()}{chr(9)}
        {$total->time_to->us_stime()}{chr(9)}
        {* NO deduct info*}""{chr(9)}
        {if isset($total->breaks) && !empty($total->breaks)}
            {$ii = 0}
            "{foreach item=break from=$total->breaks name=breaks}{*
                *}{if $break->diff>=$timelog_break_min}{*
                *}{if $ii > 0} | {/if}{*
                *}{$break->last_time_to->us_stime()} - {$break->time_from->us_stime()} ({$break->diff}){*
                *}{$ii = $ii + 1}{*
                *}{/if}{*
            *}{/foreach}"
        {/if}{chr(9)}
    {else}
        {chr(9)}
        {chr(9)}
        {chr(9)}
        {* NO pause info*}""{chr(9)}
    {/if}
    "{$total->overtime_storage|forcsv}"
    {if $home_office_use}
        {chr(9)}{if $total->home_office && !empty($total->number_all)}"{$i.basic_yes}"{/if}
    {/if}
    {if $smarty.foreach.totals.last === false}
        {"\n"}
    {/if}
{/strip}{foreachelse}
{$no_rows_msg}
{/foreach}

