<table class="table table-striped table-condensed table-hover">
	<thead>
		<tr>
			<th>Invoice</th>
			<th>Date Issue</th>
			<th>Date Due</th>
			<th class="text-right">Total</th>
			<th class="text-right">Payments</th>
			<th class="text-right">Due</th>
			<th class="text-right">Alloc</th>
		</tr>
	</thead>

	<tbody>
		<?php $c=0;foreach ($o->subitems('ALLOC') as $pio) : ?>
		<tr>
			<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$pio->invoice_id),$pio->invoice->id()); ?></td>
			<td><?php echo $pio->invoice->display('date_orig'); ?></td>
			<td><?php echo $pio->invoice->display('due_date'); ?></td>
			<td class="text-right"><?php echo $pio->invoice->total(TRUE); ?></td>
			<td class="text-right"><?php echo $pio->invoice->payments_total(TRUE); ?></td>
			<td class="text-right"><?php echo $pio->invoice->due(TRUE); ?></td>
			<td class="text-right"><?php echo Form::input('payment_item['.$pio->invoice_id.']',$pio->display('alloc_amt'),array('class'=>'span1','nocg'=>TRUE,'tabindex'=>++$c)); ?></td>
		</tr>
		<?php endforeach ?>
	
		<tr>
			<td class="text-right" colspan="6">Unapplied</td>
			<td class="text-right"><?php echo Form::input('invoice_item[excess]',$o->balance(TRUE),array('class'=>'span1','nocg'=>TRUE,'disabled'=>'disabled')); ?></td>
		</tr>
	</tbody>
</table>
