{include file="clearheader.html"}
<!--// $Id$ //-->
<TABLE WIDTH="100%" CELLPADDING="3" ALIGN="CENTER">
	<TR>
		<TD WIDTH="535" VALIGN="TOP">
			<H1>{$layout.pagetitle}</H1>
		</TD>
		<TD WIDTH="180" ALIGN="RIGHT" NOWRAP>
			LMS {$layout.lmsv} @ {$layout.hostname}<BR>
			{t a=trans($smarty.now|date_format:"l") b=$smarty.now|date_format:"Y-m-d"}<!date-format>$a, $b{/t}
			<br>
			{t a=$layout.logname}Prepared by: $a{/t}
		</TD>
	</TR>
</TABLE>
<BR>
<TABLE WIDTH="100%" CELLPADDING="3" BORDER="1" ALIGN="CENTER">
	<TR>
		<TD WIDTH="15" ALIGN="CENTER" CLASS="HEAD">
			{trans("No.")}
		</TD>
		<TD WIDTH="30" CLASS="HEAD nobr" ALIGN="CENTER">
			{trans("ID")}
		</TD>
		<TD WIDTH="30" CLASS="HEAD nobr" ALIGN="CENTER">
			{trans("External ID")}
		</TD>
		<TD WIDTH="{if $customernodes}250{else}400{/if}" CLASS="HEAD">
			<B>{trans("First/last name")} / {trans("Name")}</B><BR>
			{trans("Address")}<BR>
			{trans("Phone")}
		</TD>
		{if $customernodes}
			<td width="150" class="HEADER" align="right">
				{trans("Nodes")}
			</td>
		{/if}
		<TD WIDTH="150" CLASS="HEAD" ALIGN="RIGHT">
			{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')}{trans("Subscription")}<BR>{/if}
			{trans("E-mail")}<BR>
			{trans("TEN/SSN")}
		</TD>
		{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')}
		<TD WIDTH="50" CLASS="HEAD" ALIGN="RIGHT">
			{trans("Balance")}
		</TD>
		{/if}
	</TR>
	{cycle values="white,grey" print=false}
	{foreach $customerlist as $customer}
		{if !empty($customer.id)}
			<tr class="{cycle}">
				{$cid = $customer.id}
				<td class="text-center">
					{counter}.
				</td>
				<td class="text-center">
					{$customer.id|string_format:"%04d"}
				</td>
				<td class="text-center">
					{if $customer.extid}
						{$customer.extid|escape}
					{/if}
				</td>
				<td>
					<strong>{$customer.customername}</strong>
					<br>
					{$customer.zip} {$customer.city}{if $customer.city != ""},{/if}
					{$customer.address}
					<br>
					{if $contactlist.$cid.type}
						{trans("<!print>mobile")}
					{else}
						{trans("phone<!plural>")}
					{/if}
					{$contactlist.$cid.phone}
				</td>
				{if $customernodes}
					<td class="text-right">
						{foreach $customer.nodes as $node}
							{$node.name} ({$node.ip} / {$node.mac})
							{if !$node@last}<br>{/if}
						{/foreach}
					</td>
				{/if}
				<td class="text-right" style="max-width: 200ch;">
					{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')}
						{$customer.tariffvalue|money_format}
						<br>
					{/if}
					{if $customer.email}
						{$customer.email|replace:",":', '}
						<br>
					{/if}
					{if $customer.ten}{trans("TEN:")}
						{$customer.ten}
					{elseif $customer.ssn}{trans("SSN:")}
						{if empty($listdata.hidessn)}
							{$customer.ssn}
						{else}
							{trans("(hidden)")}
						{/if}
					{/if}
				</td>
				{if ConfigHelper::checkConfig('privileges.superuser') || !ConfigHelper::checkConfig('privileges.hide_finances')}
				<td class="text-right nobr">
					{$customer.balance|money_format}
				</td>
				{/if}
			</tr>
		{/if}
	{/foreach}
	{if ConfigHelper::checkConfig('privileges.superuser') || (!ConfigHelper::checkConfig('privileges.hide_finances') && !ConfigHelper::checkConfig('privileges.hide_summaries'))}
	<TR>
		<TD CLASS="HEADGREY" COLSPAN="{if $customernodes}5{else}4{/if}" ALIGN="RIGHT"><B>{trans("Total:")}</B></TD>
		<TD CLASS="HEADGREY" ALIGN="RIGHT" NOWRAP><B>{sum array=$customerlist column="tariffvalue" string_format=Localisation::getCurrentMoneyFormat()}</B></TD>
		<TD CLASS="HEADGREY" ALIGN="RIGHT" NOWRAP><B>{sum array=$customerlist column="balance" string_format=Localisation::getCurrentMoneyFormat()}</B></TD>
	</TR>
	{/if}
</TABLE>
{include file="clearfooter.html"}
