{box title="Your subscriptions"} {$show_speeds = ConfigHelper::checkConfig('userpanel.show_speeds')} {$show_period = ConfigHelper::checkConfig('userpanel.show_period')} {$show_discount = ConfigHelper::checkConfig('userpanel.show_discount')} {$show_discounted_value = ConfigHelper::checkConfig('userpanel.show_discounted_value')} {$show_invoice_flag = ConfigHelper::checkConfig('userpanel.show_invoice_flag')} {$show_all_assignments = ConfigHelper::checkConfig('userpanel.show_all_assignments')} {$speed_unit_type = ConfigHelper::getConfig('userpanel.speed_unit_type')} {$speed_unit_aggregation_threshold = ConfigHelper::getConfig('userpanel.speed_unit_aggregation_threshold')} {$count = 0}
{if $show_discount} {/if} {if $show_speeds} {/if} {if $show_invoice_flag} {/if} {if $show_period} {/if} {$total_real_value = array()} {$total_real_disc_value = array()} {$total_real_downrate = 0} {$total_real_uprate = 0} {$total_real_downceil = 0} {$total_real_upceil = 0} {foreach $assignments as $assignment} {if ($assignment.tariffid || $assignment.liabilityid) && !$assignment.suspended && ($show_all_assignments || ($assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)))} {if $show_discounted_value} {else} {/if} {if $show_discount} {/if} {if $show_speeds} {/if} {if $show_invoice_flag} {/if} {if $show_period} {/if} {$count = $count +1} {/if} {foreachelse} {/foreach} {if $count > 1} {if $show_discount} {/if} {if $show_speeds} {/if} {if $show_invoice_flag} {/if} {if $show_period} {/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.discounted_value, $assignment.currency)} {if !isset($total_real_value[$assignment.currency])} {$total_real_value[$assignment.currency] = 0} {/if} {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_value[$assignment.currency] = $total_real_value[$assignment.currency] + $assignment.discounted_value} {/if} {moneyf($assignment.real_value, $assignment.currency)} {if !isset($total_real_value[$assignment.currency])} {$total_real_value[$assignment.currency] = 0} {/if} {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_value[$assignment.currency] = $total_real_value[$assignment.currency] + $assignment.real_value} {/if} {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} {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_disc_value[$assignment.currency] = $total_real_disc_value[$assignment.currency] + $assignment.real_disc_value} {/if} {$assignment.payday} {if empty($assignment.downrate)} - {else} {convert_to_units($assignment.downrate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_downrate = $total_real_downrate + $assignment.downrate} {/if} {/if} ({if empty($assignment.downceil)} - {else} {convert_to_units($assignment.downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_downceil = $total_real_downceil + $assignment.downceil} {/if} {/if}) {if empty($assignment.uprate)} - {else} {convert_to_units($assignment.uprate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_uprate = $total_real_uprate + $assignment.uprate} {/if} {/if} ({if empty($assignment.upceil)} - {else} {convert_to_units($assignment.upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $assignment.datefrom <= $smarty.now && (empty($assignment.dateto) || $assignment.dateto >= $smarty.now)} {$total_real_upceil = $total_real_upceil + $assignment.upceil} {/if} {/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})
  {if $total_real_downrate} {convert_to_units($total_real_downrate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {else} - {/if} ({if $total_real_downceil} {convert_to_units($total_real_downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {else} - {/if}) {if $total_real_uprate} {convert_to_units($total_real_uprate * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {else} - {/if} ({if $total_real_upceil} {convert_to_units($total_real_upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {else} - {/if})   
{/box}