<div class="purchaseOrders view">
<h2><?php  __('PurchaseOrder');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Issue Date'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['issue_date']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dispatch Date'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['dispatch_date']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date Arrived'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['date_arrived']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['title']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($purchaseOrder['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $purchaseOrder['Principle']['id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle Reference'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $purchaseOrder['PurchaseOrder']['principle_reference']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $html->link($purchaseOrder['Document']['id'], array('controller' => 'documents', 'action' => 'view', $purchaseOrder['Document']['id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit PurchaseOrder', true), array('action' => 'edit', $purchaseOrder['PurchaseOrder']['id'])); ?> </li>
	</ul>
</div>
<div class="related">
	<h3>PO for these Jobs</h3>
	<?php if (!empty($purchaseOrder['Job'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
	
		<th><?php __('Created'); ?></th>
		<th><?php __('Title'); ?></th>
		<th><?php __('Enquiry Id'); ?></th>
		<th><?php __('Comments'); ?></th>
		<th><?php __('Date Order Received'); ?></th>
		<th><?php __('Date Order Sent To Customer'); ?></th>
		<th><?php __('Customer Order Number'); ?></th>
		<th><?php __('Domestic Freight Paid By'); ?></th>
		<th><?php __('Sale Category'); ?></th>
		<th><?php __('Shipment Category'); ?></th>
		<th><?php __('Company Gross Sales Aud'); ?></th>
		<th><?php __('Net Sales Aud'); ?></th>
		<th><?php __('Gross Profit Aud'); ?></th>
		<th><?php __('Ato Exchange Rate'); ?></th>
		<th><?php __('Gst'); ?></th>
		<th><?php __('Currency Id'); ?></th>
		<th><?php __('Gst Amount'); ?></th>
		<th><?php __('Gross Commisions'); ?></th>
		<th><?php __('Invoiced Amount Inc Gst'); ?></th>
		<th><?php __('Net Export Sales Aud'); ?></th>
		<th><?php __('Gross Profit Exports Aud'); ?></th>
		<th><?php __('Gp Percent'); ?></th>
		<th><?php __('Gross Australian Sales Foreign Currency'); ?></th>
		<th><?php __('Net Australian Sales Foreign Currency'); ?></th>
		<th><?php __('Gross Profit Value Australian Sales Foreign Currency'); ?></th>
		<th><?php __('Gross Export Sales Foreign Currency'); ?></th>
		<th><?php __('Net Export Sales Foreign Currency'); ?></th>
		<th><?php __('Gross Profit Value After Discount Exports Foreign Currency'); ?></th>
		<th><?php __('Gross Commissions'); ?></th>
		<th><?php __('Net Commissions'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($purchaseOrder['Job'] as $job):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			
			<td><?php echo $job['created'];?></td>
			<td><?php echo $job['title'];?></td>
			<td><?php echo $job['enquiry_id'];?></td>
			<td><?php echo $job['comments'];?></td>
			<td><?php echo $job['date_order_received'];?></td>
			<td><?php echo $job['date_order_sent_to_customer'];?></td>
			<td><?php echo $job['customer_order_number'];?></td>
			<td><?php echo $job['domestic_freight_paid_by'];?></td>
			<td><?php echo $job['sale_category'];?></td>
			<td><?php echo $job['shipment_category'];?></td>
			<td><?php echo $job['company_gross_sales_aud'];?></td>
			<td><?php echo $job['net_sales_aud'];?></td>
			<td><?php echo $job['gross_profit_aud'];?></td>
			<td><?php echo $job['ato_exchange_rate'];?></td>
			<td><?php echo $job['gst'];?></td>
			<td><?php echo $job['currency_id'];?></td>
			<td><?php echo $job['gst_amount'];?></td>
			<td><?php echo $job['gross_commisions'];?></td>
			<td><?php echo $job['invoiced_amount_inc_gst'];?></td>
			<td><?php echo $job['net_export_sales_aud'];?></td>
			<td><?php echo $job['gross_profit_exports_aud'];?></td>
			<td><?php echo $job['gp_percent'];?></td>
			<td><?php echo $job['gross_australian_sales_foreign_currency'];?></td>
			<td><?php echo $job['net_australian_sales_foreign_currency'];?></td>
			<td><?php echo $job['gross_profit_value_australian_sales_foreign_currency'];?></td>
			<td><?php echo $job['gross_export_sales_foreign_currency'];?></td>
			<td><?php echo $job['net_export_sales_foreign_currency'];?></td>
			<td><?php echo $job['gross_profit_value_after_discount_exports_foreign_currency'];?></td>
			<td><?php echo $job['gross_commissions'];?></td>
			<td><?php echo $job['net_commissions'];?></td>
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller' => 'jobs', 'action' => 'view', $job['id'])); ?>
				<?php echo $html->link(__('Edit', true), array('controller' => 'jobs', 'action' => 'edit', $job['id'])); ?>
				<?php echo $html->link(__('Delete', true), array('controller' => 'jobs', 'action' => 'delete', $job['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
