{box title="Your subscriptions"} {$show_speeds = ConfigHelper::checkConfig('userpanel.show_speeds')} {$show_period = ConfigHelper::checkConfig('userpanel.show_period')} {$speed_unit_type = ConfigHelper::getConfig('userpanel.speed_unit_type')} {$speed_unit_aggregation_threshold = ConfigHelper::getConfig('userpanel.speed_unit_aggregation_threshold')} {$count = 0}
{if $show_speeds} {/if} {if $show_period} {/if} {$total_real_value = array()} {$total_real_disc_value = array()} {foreach $assignments as $assignment} {if ($assignment.tariffid || $assignment.liabilityid) && !($assignment.suspended || ($assignment.dateto < $smarty.now && $assignment.dateto) || ($assignment.datefrom > $smarty.now && $assignment.datefrom))} {if $show_speeds} {/if} {if $show_period} {/if} {$count = $count +1} {/if} {foreachelse} {/foreach} {if $count > 1} {if $show_speeds} {/if} {/if}
{trans("Tariff")} {trans("Subscription")} {trans("Discount")} {trans("Accounting day")}{trans("Downrate (ceil):")} {trans("Uprate (ceil):")}{trans("Invoice")}{trans("Period")}
{if ConfigHelper::checkConfig('userpanel.show_tariffname')}{$assignment.name}{/if} {moneyf($assignment.real_value, $assignment.currency)} {if !isset($total_real_value[$assignment.currency])} {$total_real_value[$assignment.currency] = 0} {/if} {$total_real_value[$assignment.currency] = $total_real_value[$assignment.currency] + $assignment.real_value} {if $assignment.pdiscount > 0} {$assignment.pdiscount}% {else} {if $assignment.vdiscount > 0} {moneyf($assignment.vdiscount, $assignment.currency)} {else} - {/if} {/if} {if !isset($total_real_disc_value[$assignment.currency])} {$total_real_disc_value[$assignment.currency] = 0} {/if} {$total_real_disc_value[$assignment.currency] = $total_real_disc_value[$assignment.currency] + $assignment.real_disc_value} {$assignment.payday} {if empty($assignment.downrate)}-{else}{convert_to_units($assignment.downrate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{/if} ({if empty($assignment.downceil)}-{else}{convert_to_units($assignment.downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{/if}) {if empty($assignment.uprate)}-{else}{convert_to_units($assignment.uprate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{/if} ({if empty($assignment.upceil)}-{else}{convert_to_units($assignment.upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{/if}) {if $assignment.invoice}{trans("yes")}{else} {/if} {if $assignment.datefrom}{trans("from")} {$assignment.datefrom|date_format:"%Y/%m/%d"}{/if} {if $assignment.dateto}{trans("to")} {$assignment.dateto|date_format:"%Y/%m/%d"}{/if}
{trans("You haven't got any assigned subscriptions.")}
{trans("Total:")} {foreach $total_real_value as $currency => $total_value} {if !$total_value@first}
{/if} {moneyf($total_value, $currency)} {/foreach}
({foreach $total_real_disc_value as $currency => $total_disc_value}{if !$total_disc_value@first}
{/if}{moneyf($total_disc_value, $currency)}{foreachelse}-{/foreach})
  {sum array=$assignments column="real_downrate" default="-" assign="real_downrate"} {sum array=$assignments column="real_downceil" default="-" assign="real_downceil"} {if $real_downrate}{convert_to_units($real_downrate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{else}-{/if} ({if $real_downceil}{convert_to_units($real_downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{else}-{/if}) {sum array=$assignments column="real_uprate" default="-" assign="real_uprate"} {sum array=$assignments column="real_upceil" default="-" assign="real_upceil"} {if $real_uprate}{convert_to_units($real_uprate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{else}-{/if} ({if $real_upceil}{convert_to_units($real_upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s{else}-{/if})    
{/box}