{$show_netto_column = false} {foreach $minibilling as $phone => $types}

{t a=$phone b=$datefrom c=$dateto}Minibilling for number $a (period{if $datefrom} from $b{/if}{if $dateto} to $c{/if}){/t}

{foreach $types as $type => $mb} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if} {$summary.total = 0} {$summary.billed = 0} {$summary.count = 0} {$summary.brutto = 0} {foreach $mb as $group => $row} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if} {$summary.billed = $summary.billed + $row.billed} {$summary.total = $summary.total + $row.time} {$summary.count = $summary.count + $row.count} {$summary.brutto = $summary.brutto + $row.brutto} {if !isset($summaries[$type][$group])} {$summaries[$type][$group].billed = 0} {$summaries[$type][$group].total = 0} {$summaries[$type][$group].count = 0} {$summaries[$type][$group].brutto = 0} {/if} {$summaries[$type][$group].billed = $summaries[$type][$group].billed + $row.billed} {$summaries[$type][$group].total = $summaries[$type][$group].total + $row.time} {$summaries[$type][$group].count = $summaries[$type][$group].count + $row.count} {$summaries[$type][$group].brutto = $summaries[$type][$group].brutto + $row.brutto} {/foreach} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if}
{if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {trans("Call type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {trans("SMS type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {trans("MMS type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {trans("Data transfer type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {trans("Video call type")} {/if} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {trans("Call time")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {trans("Count")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {trans("Count")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {trans("Volume")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {trans("Video call time")} {/if} {trans("Count")} {trans("Net value")} {trans("Gross value")}
{$group} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {$row.billed|duration_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {$row.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {$row.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {$row.billed|size_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {$row.billed|duration_format} {/if} {t a=$row.count}$a pcs.{/t} {moneyf($row.brutto / 1.23)} {moneyf($row.brutto)}
{trans("Total")} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {$summary.billed|duration_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {$summary.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {$summary.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {$summary.billed|size_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {$summary.billed|duration_format} {/if} {t a=$summary.count}$a pcs.{/t} {moneyf($summary.brutto / 1.23)} {moneyf($summary.brutto)}
{/foreach} {/foreach} {if isset($summaries) && count($minibilling) > 1}

{t a=$datefrom b=$dateto}Minibilling summary (period{if $datefrom} from $a{/if}{if $dateto} to $b{/if}){/t}

{foreach $summaries as $type => $summarygroups} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if} {$summary.billed = 0} {$summary.total = 0} {$summary.count = 0} {$summary.brutto = 0} {foreach $summarygroups as $group => $row} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if} {$summary.billed = $summary.billed + $row.billed} {$summary.total = $summary.total + $row.total} {$summary.count = $summary.count + $row.count} {$summary.brutto = $summary.brutto + $row.brutto} {/foreach} {if $type != $smarty.const.BILLING_RECORD_TYPE_SMS && $type != $smarty.const.BILLING_RECORD_TYPE_MMS} {/if} {if $show_netto_column} {/if}
{if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {trans("Call type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {trans("SMS type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {trans("MMS type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {trans("Data transfer type")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {trans("Video call type")} {/if} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {trans("Call time")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {trans("Count")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {trans("Count")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {trans("Volume")} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {trans("Video call time")} {/if} {trans("Count")} {trans("Net value")} {trans("Gross value")}
{$group} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {$row.billed|duration_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {$row.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {$row.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {$row.billed|size_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {$row.billed|duration_format} {/if} {t a=$row.count}$a pcs.{/t} {moneyf($row.brutto / 1.23)} {moneyf($row.brutto)}
{trans("Total")} {if $type == $smarty.const.BILLING_RECORD_TYPE_VOICE_CALL} {$summary.billed|duration_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_SMS} {$summary.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_MMS} {$summary.billed} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_DATA_TRANSFER} {$summary.billed|size_format} {elseif $type == $smarty.const.BILLING_RECORD_TYPE_VIDEO_CALL} {$summary.billed|duration_format} {/if} {t a=$summary.count}$a pcs.{/t} {moneyf($summary.brutto / 1.23)} {moneyf($summary.brutto)}
{/foreach} {/if}