<table cellspacing="0" class="beterv_matrix">
	<tr>
		<th>&nbsp;</th>
		<th>facturen</th>
		<th class="cur_q_l">huidig</th>
		<th class="cur_q_r">kwartaal</th>
		{foreach name="q_list" from=$data item=d}
			{if $smarty.foreach.q_list.iteration > 1}
				{*<th>kwartaal min {$smarty.foreach.q_list.iteration-1}</th>*}
				<th>{$d.bek_kwartaal|substr:0:4} Q{$d.bek_kwartaal|substr:-1}</th>
			{/if}
		{/foreach}
	</tr>
	<tr class="beterv_matrix_totaal">
		<td class="title">Totaal</td>
		<td>{$list_totals_aantal|@array_sum}</td>
		<td>100%</td>
		{foreach name="q_list" from=$data item=d key=index}
			<td>{$list_totals_bedrag[$index]|number_format:0:",":"."}</td>
		{/foreach}
	</tr>

	{foreach from=$list_interval key=i_key item=i_title}
		{assign var="bedrag_key" value="bek_`$i_key`_bedrag"}
		{assign var="aantal_key" value="bek_`$i_key`_aantal"}

		<tr class="beterv_matrix_{$i_key}">
			<td class="title">{$i_title}</td>
			<td>{if $list_totals_aantal[$i_key]}{$list_totals_aantal[$i_key]}{else}&nbsp;{/if}</td>
			<td>{if $list_totals_aantal[$i_key]}{$list_percentage[$bedrag_key]|number_format:1:",":"."}%{else}&nbsp;{/if}</td>

			{foreach name="q_list" from=$data item=d}
				<td>{if $d[$bedrag_key]}{$d[$bedrag_key]|number_format:0:",":"."}{else}&nbsp;{/if}</td>
			{/foreach}

		</tr>
	{/foreach}
</table>
<style type="text/css">
{literal}
	table.beterv_matrix {
		width: 100%;
		font-size: 90%;
	}
		table.beterv_matrix th {
			padding: 3px 5px;
			font-weight: normal;
			border-right: 1px solid black;
			border-bottom: 0;
			width: 60px;
			text-align: right;
			line-height: 13px;
			white-space: nowrap;
		}
			table.beterv_matrix th.cur_q_l {
				text-align: right;
				border-right: 0;
				padding-right: 0;
			}
			table.beterv_matrix th.cur_q_r {
				text-align: left;
			}

		table.beterv_matrix td {
			padding: 3px;
			text-align: right;
			border-right: 1px solid black;
		}
			table.beterv_matrix td.title {
				text-align: left;
				white-space: nowrap;
			}

		table.beterv_matrix tr.beterv_matrix_totaal td {
			border-top: 2px solid black;
			border-bottom: 2px solid black;
			background-color: #C0C0C0;
		}

		table.beterv_matrix tr.beterv_matrix_0 td {}
		table.beterv_matrix tr.beterv_matrix_0_30 td {
			background-color: #C0C0C0;
		}
		table.beterv_matrix tr.beterv_matrix_31_60 td {}
		table.beterv_matrix tr.beterv_matrix_61_90 td {
			background-color: #C0C0C0;
		}
		table.beterv_matrix tr.beterv_matrix_91_120 td {}
		table.beterv_matrix tr.beterv_matrix_120 td {
			background-color: #C0C0C0;
		}

{/literal}
</style>
