Raport sprzedaż w grupach

Data wygenerowania raportu:
{$smarty.now|date_format:"%d.%m.%Y %H:%M:%S"}
Rok:
Miesiąc:
{foreach from=$list_group_ks key=groups_key item=group_ks} {if in_array($groups_key,$types_prod_req)} {else} {/if} {/foreach} {foreach from=$table_array key=year_key item=year name=year_name} {assign var=count_month value=0} {* Generate sum all types for years column *} {assign var=sum_type value=0} {foreach from=$year key=month_key item=month name=month_name} {math assign=sum_type equation="x + y" x=$sum_type y=$month|@count} {/foreach} {foreach from=$year key=month_key item=month name=month_name} {assign var=count_type value=0} {foreach from=$month key=type_key item=type name=type_name} {if $count_type == 0} {if $count_month == 0} {/if} {/if} {if in_array($type_key,$types_group_req)} {if !empty($list_types.$type_key)} {else} {/if} {foreach from=$list_group_ks key=groups_key item=groups} {assign var=found value=0} {foreach from=$type.accounts_type key=group_key item=group name=group_name} {if in_array($group_key,$types_prod_req)} {if $groups_key == $group_key} {assign var=found value=1} {/if} {/if} {/foreach} {if $found==0} {/if} {/foreach} {/if} {assign var=count_type value=$count_type+1} {/foreach} {assign var=count_month value=$count_month+1} {/foreach} {/foreach}
ROK MIESIĄC PROFIL GŁÓWNY ILU ODBIORCÓW W LICZBACH ILE DOKUMENTÓW{$group_ks} Pozostałe
{$year_key}{$months[$month_key]}{$list_types.$type_key}Pozostałe{$type.accounts_count} {$type.documents_count} {$group|number_format:2:",":"."}-{$type.accounts_type.total|number_format:2:".":","}