<?php if ($o->pending_change()) : ?>
	<div class="span5">
		Pending change to: <?php echo $o->service_change->list_details(); ?>
	</div> <!-- /span -->
<?php endif ?>

<div class="span6">
	<fieldset>
		<legend>Service Transaction Details</legend>

		<table class="table table-striped table-condensed table-hover" id="list-table">
			<thead>
				<tr>
					<th>ID</th>
					<th>Invoice</th>
					<th>IT</th>
					<th>RS</th>
					<th class="text-right">Start</th>
					<th class="text-right">Stop</th>
					<th class="text-right">Quantity</th>
					<th class="text-right">Charge</th>
					<th>Desc</th>
				</tr>
			</thead>

			<tbody>
				<?php $lp=NULL; foreach ($o->transactions()->find_all() as $iio) : ?>
					<?php if (! is_null($iio->product_id) AND $lp != $iio->product_id) : $lp = $iio->product_id; ?>
						<tr>
							<th><?php echo $iio->product_id; ?></th>
							<th colspan="9"><?php echo $iio->product->title(); ?></th>
						</tr>
					<?php endif ?>

					<tr>
						<td><?php echo $iio->id; ?></td>
						<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$iio->invoice_id),$iio->invoice_id); ?></td>
						<td><?php echo $iio->display('item_type'); ?></td>
						<td><?php echo $iio->display('recurring_schedule'); ?></td>
						<td class="text-right"><?php echo $iio->display('date_start'); ?></td>
						<td class="text-right"><?php echo $iio->display('date_stop'); ?></td>
						<td class="text-right"><?php echo $iio->display('quantity'); ?></td>
						<td class="text-right"><?php echo $iio->display('price_base'); ?></td>
						<td><?php echo $iio->display('product_name'); ?></td>
					</tr>
				<?php endforeach ?>
			</tbody>
		</table>
	</fieldset>
</div> <!-- /span -->
