{css} {assign var=today value=$smarty.now|date_format:"%x 00:00:00"}{assign var=today value=$today|date_format:"%s"} {$speed_unit_type = ConfigHelper::getConfig('phpui.speed_unit_type', 1000)} {$speed_unit_aggregation_threshold = ConfigHelper::getConfig('phpui.speed_unit_aggregation_threshold', 5)} {if !isset($tab_id)} {$tab_id = "customerassignments"} {/if} {if !isset($content_id)} {$content_id = "customerassignmentpanel"} {/if}
{if !isset($data_label)}{$data_label="Customer Liabilities"}{/if} {tab_container id=$tab_id label=$data_label} {tab_header content_id=$content_id} {tab_header_cell icon="lms-ui-icon-assignment"} {if isset($tab_label)}{$tab_label}{else}{trans("Customer Liabilities:")}{/if} {/tab_header_cell} {tab_header_cell} {if !$customerinfo.deleted} {trans("New Liability")} » {trans("Delete all")} » {/if} {/tab_header_cell} {/tab_header} {tab_contents id=$content_id class="assignmentpanel"} {tab_table} {if $assignments} {block name=$tab_id|cat:"-list-header"}
{trans("Liability:")}
{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')} {trans("Value:")} {/if}
{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')} {trans("Discount:")} {/if}
{trans("Accounting:")}
{trans("Downceil:")}
{trans("Upceil:")}
{trans("Options:")}
{trans("Period:")}
 
{/block} {/if} {foreach $assignments as $a} {block name=$tab_id|cat:"-list-row"}
{if !$a.tariffid && !$a.liabilityid} {trans("Suspending of all liabilities")} {else} {if $a.tariffid} {$a.name} {if count($assignments)>1} ({$a.id}){/if} {if $a.attribute} - {$a.attribute}{/if} {if $a.flags & $smarty.const.TARIFF_FLAG_REWARD_PENALTY} {if $a.value < 0} {icon name="reward" tip="reward"} {else} {icon name="penalty" tip="penalty"} {/if} {/if} {else} {$a.name} {/if} {if $a.nodes} ({foreach $a.nodes as $v}{$v.name}{if !empty($v.netdev_name) && $v.netdev_ownerid == $customerinfo.id} / {$v.netdev_name}{/if}{if !$v@last}, {/if}{/foreach}) {/if} {if $a.phones} ({foreach $a.phones as $v}{trans("phone:")} {$v.phone}{if !$v@last}, {/if}{/foreach}) {/if} {/if}
{if $a.tariffid || $a.liabilityid} {if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')} {moneyf($a.value, $a.currency)} {if $a.count != 1}({$a.unitary_value} x {$a.count}){/if} {/if} {/if}
{if $a.tariffid || $a.liabilityid} {if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')} {if $a.pdiscount != 0}{$a.pdiscount}%{elseif $a.vdiscount != 0}{moneyf($a.vdiscount, $a.currency)} {if $a.count != 1}({$a.unitary_vdiscount} x {$a.count}){/if}{else}-{/if} {/if} {/if}
{if $a.tariffid || $a.liabilityid} {$a.payday}{if $a.backwardperiod} {icon name="lms-ui-icon-previous" tip="backward"}{/if} {/if}
{if $a.tariffid || $a.liabilityid} {if $a.downceil} {convert_to_units($a.downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $a.count != 1}({convert_to_units($a.unitary_downceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)} x {$a.count}){/if} {else}-{/if} {/if}
{if $a.tariffid || $a.liabilityid} {if $a.upceil} {convert_to_units($a.upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)}/s {if $a.count != 1}({convert_to_units($a.unitary_upceil * $speed_unit_type, $speed_unit_aggregation_threshold, $speed_unit_type)} x {$a.count}){/if} {else}-{/if} {/if}
{if $a.tariffid || $a.liabilityid} {/if}
{if $a.datefrom}{trans("from")} {$a.datefrom|date_format:"%Y/%m/%d"}{/if} {if $a.dateto}{trans("to")} {$a.dateto|date_format:"%Y/%m/%d"}{/if} {if !$a.datefrom && !$a.dateto}-{/if}
{if ($a.tariffid || $a.liabilityid) && (($a.dateto > $today || !$a.dateto) || ($a.liabilityid && $a.at > $today))} {button type="link" icon="wait" href="?m=customerassignmentedit&action=suspend&id={$a.id}&suspend={if $a.suspended}0{else}1{/if}" tip="{if $a.suspended}Enable{else}Disable{/if} accounting of selected liability"} {/if} {button type="link" icon="delete" class="delete-assignment" href="?m=customerassignmentdel&id={$a.id}" tip="Delete customer's liability"} {button type="link" icon="edit" href="?m=customerassignmentedit&id={$a.id}" tip="Edit"}
{/block} {foreachelse} {block name=$tab_id|cat:"-list-empty-row"}
{trans("That customer hasn't got any assigned subscriptions.")}
{/block} {/foreach} {if $assignments} {block name=$tab_id|cat:"-list-footer"} {/block} {/if} {/tab_table} {if $assignments} {tab_button_panel} {tab_buttons} {/tab_buttons} {tab_buttons} {button class="delete-assignments" icon="delete" label="Delete"} {/tab_buttons} {/tab_button_panel} {/if} {/tab_contents} {/tab_container}