<!-- @todo NEEDS TO BE TRANSLATED -->
<table width="100%">
	<tr>
		<td>
			<!-- Service Information -->
			<table class="box-full">
				<tr>
					<td style="width: 40%;">Account</td>
					<td style="width: 60%;" class="data"><?php printf('%s (%s)',$so->account->name(),$so->account->accnum()); ?></td>
				</tr>
				<tr>
					<td>Service Active</td>
					<td class="data"><?php echo $so->display('active'); ?></td>
				</tr>
				<tr>
					<td>Billing Period</td>
					<td class="data"><?php echo $so->display('recur_schedule');?></td>
				</tr>
				<tr>
					<td>Cost</td>
					<td class="data"><?php echo $so->price(TRUE,TRUE); ?></td>
				</tr>
				<?php if (is_null($so->price) OR ($so->price<=$so->product->price($so->price_group,$so->recur_schedule,'price_base'))) { ?>
				<tr>
					<td>Service</td>
					<td class="data"><?php echo HTML::anchor('product/view/'.$so->product_id,$so->product->name()); ?></td>
				</tr>
				<?php } ?>
				<tr>
					<td>Date Next Invoice</td>
					<td class="data"><?php echo $so->display('date_next_invoice'); ?></td>
				</tr>
				<tr>
					<td>Current Invoices Due</td>
					<td class="data"><?php echo Currency::display($so->account->invoices_due_total()); ?></td>
				</tr>
				<?php if ($so->service_billing->loaded()) { ?>
				<tr>
					<td>Direct Debit</td>
					<td class="data"><?php echo $so->service_billing->checkout->name; ?></td>
				</tr>
				<?php } ?>
			</table>
			<!-- END Service Information -->
		</td>
		<td style="vertical-align: top;">
			<!-- Product Summary Info -->
			<?php echo $so->product_feature_summary(); ?>
			<!-- END Product Summary Info -->
		</td>
	</tr>
</table>
<br/>
<?php echo $so->service_view(); ?>
<br/>
<table class="box-left" width="50%">
	<tr>
		<td class="head" colspan="2">Invoices for this service</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td colspan="2">Number</td>
		<td>Invoice Date</td>
		<td>Due Date</td>
		<td>Total</td>
		<td>Balance</td>
	</tr>
	<?php $i=0; foreach ($so->invoice->distinct('id')->order_by('id DESC')->find_all() as $io) { ?>
	<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
		<td class="icon" width="20px"><?php echo HTML::anchor('/user/invoice/download/'.$io->id,HTML::image('media/img/gnome-pdf.png',array('alt'=>_('Download'),'width'=>20))); ?></td>
		<td class="data"><?php echo HTML::anchor('/user/invoice/view/'.$io->id,$io->id()); ?></td>
		<td class="data"><?php echo $io->display('date_orig'); ?></td>
		<td class="data"><?php echo $io->display('due_date'); ?></td>
		<td class="data"><?php echo $io->total(TRUE); ?></td>
		<td class="data"><?php echo $io->due(TRUE); ?></td>
	</tr>
	<?php } ?>
</table>
