<div class="invoices index">
	<h2><?php echo __('Invoices'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<thead>
	<tr>
			<th><?php echo $this->Paginator->sort('id'); ?></th>
			<th><?php echo $this->Paginator->sort('subscription_id'); ?></th>
			<th><?php echo $this->Paginator->sort('created'); ?></th>
			<th><?php echo $this->Paginator->sort('invoiceperiod'); ?></th>
			<th><?php echo $this->Paginator->sort('network_id'); ?></th>
			<th><?php echo $this->Paginator->sort('network_name'); ?></th>
			<th><?php echo $this->Paginator->sort('profile_id'); ?></th>
			<th><?php echo $this->Paginator->sort('profileEmail'); ?></th>
			<th><?php echo $this->Paginator->sort('invoiceninjaId'); ?></th>
			<th><?php echo $this->Paginator->sort('clientId'); ?></th>
			<th><?php echo $this->Paginator->sort('product_id'); ?></th>
			<th><?php echo $this->Paginator->sort('displayInvoiceId'); ?></th>
			<th><?php echo $this->Paginator->sort('serviceStartDate'); ?></th>
			<th><?php echo $this->Paginator->sort('serviceEndDate'); ?></th>
			<th><?php echo $this->Paginator->sort('country_id'); ?></th>
			<th><?php echo $this->Paginator->sort('paymentGateway'); ?></th>
			<th><?php echo $this->Paginator->sort('monthlyFee'); ?></th>
			<th><?php echo $this->Paginator->sort('userCount'); ?></th>
			<th><?php echo $this->Paginator->sort('usageFee'); ?></th>
			<th><?php echo $this->Paginator->sort('lateFee'); ?></th>
			<th><?php echo $this->Paginator->sort('paidStatus'); ?></th>
			<th><?php echo $this->Paginator->sort('paidAmount'); ?></th>
			<th><?php echo $this->Paginator->sort('paidDate'); ?></th>
			<th><?php echo $this->Paginator->sort('paidBy'); ?></th>
			<th><?php echo $this->Paginator->sort('batchProcessDate'); ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	</thead>
	<tbody>
	<?php foreach ($invoices as $invoice): ?>
	<tr>
		<td><?php echo h($invoice['Invoice']['id']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($invoice['Subscription']['id'], array('controller' => 'subscriptions', 'action' => 'view', $invoice['Subscription']['id'])); ?>
		</td>
		<td><?php echo h($invoice['Invoice']['created']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['invoiceperiod']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($invoice['Network']['title'], array('controller' => 'networks', 'action' => 'view', $invoice['Network']['id'])); ?>
		</td>
		<td><?php echo h($invoice['Invoice']['network_name']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($invoice['Profile']['id'], array('controller' => 'profiles', 'action' => 'view', $invoice['Profile']['id'])); ?>
		</td>
		<td><?php echo h($invoice['Invoice']['profileEmail']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['invoiceninjaId']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['clientId']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($invoice['Product']['name'], array('controller' => 'products', 'action' => 'view', $invoice['Product']['id'])); ?>
		</td>
		<td><?php echo h($invoice['Invoice']['displayInvoiceId']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['serviceStartDate']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['serviceEndDate']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($invoice['Country']['name'], array('controller' => 'countries', 'action' => 'view', $invoice['Country']['id'])); ?>
		</td>
		<td><?php echo h($invoice['Invoice']['paymentGateway']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['monthlyFee']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['userCount']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['usageFee']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['lateFee']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['paidStatus']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['paidAmount']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['paidDate']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['paidBy']); ?>&nbsp;</td>
		<td><?php echo h($invoice['Invoice']['batchProcessDate']); ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $invoice['Invoice']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $invoice['Invoice']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $invoice['Invoice']['id']), array('confirm' => __('Are you sure you want to delete # %s?', $invoice['Invoice']['id']))); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</tbody>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
		'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('New Invoice'), array('action' => 'add')); ?></li>
		<li><?php echo $this->Html->link(__('List Subscriptions'), array('controller' => 'subscriptions', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Subscription'), array('controller' => 'subscriptions', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Networks'), array('controller' => 'networks', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Network'), array('controller' => 'networks', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Profiles'), array('controller' => 'profiles', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Profile'), array('controller' => 'profiles', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Products'), array('controller' => 'products', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Product'), array('controller' => 'products', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Countries'), array('controller' => 'countries', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Country'), array('controller' => 'countries', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Sslpayments'), array('controller' => 'sslpayments', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Sslpayment'), array('controller' => 'sslpayments', 'action' => 'add')); ?> </li>
	</ul>
</div>
