<h2>Order Acknowledgement: <span class="job-title"><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></span> for <?=$html->link($enquiry['Customer']['name'], '/customers/view/'.$enquiry['Customer']['id']);?></h2>

<div id="flashMessage" class="message">
</div>

<div class="docButtons">
    <?=$html->link('Generate PDF of this Order Acknowledgement', '/documents/pdf/'.$document['Document']['id']);?>
    <?=$html->link('Email PDF to Customer', '/documents/email_pdf/'.$document['Document']['id']);?>
</div>

<div class="docOperations">
	<h3>Create new Documents based on this</h3>
	<ul class="document-buttons">
		<li>
			<button id="createInvoice" class="button-link" data-href="/documents/newDocument/invoice/<?=$enquiry['Enquiry']['id']?>/<?=$job['Job']['id']?>/<?=$document['Document']['id']?>">Create Invoice</button>


		</li>
		
		<li>
			<button id="createPackingList" class="button-link" data-href="/documents/newDocument/packingList/<?=$enquiry['Enquiry']['id']?>/<?=$job['Job']['id']?>/<?=$document['Document']['id']?>">Create Packing List</button>
		
		</li>
	</ul>
</div>


<div id="invoiceDetails" class="documentDetails">
    <fieldset>
	<? echo $form->create('Document',array('type'=>'post','action'=>'edit', 'default'=>false));
	echo $form->input('Document.id');
	echo $form->input('OrderAcknowledgement.id');
	echo $form->input('OrderAcknowledgement.job_id');
	echo $form->input('OrderAcknowledgement.currency_id');
	echo $form->input('OrderAcknowledgement.issue_date');

	echo $form->input('billing_address_id', array('div' => 'addressradio', 'legend' => 'Select Billing Address', 'options' => $billing_addresses_list, 'type' => 'radio', 'class'=>'billing_address'));
	echo $form->input('Document.bill_to');
	
	
	echo $form->input('shipping_address_id', array('div' => 'addressradio','legend' => 'Select Shipping Address', 'options' => $shipping_addresses_list, 'type' => 'radio', 'class' => 'shipping_address'));
	echo $form->input('Document.ship_to');


	echo $form->input('OrderAcknowledgement.ship_via');
	echo $form->input('OrderAcknowledgement.fob');
	echo $form->input('OrderAcknowledgement.estimated_delivery');
  echo $form->input('OrderAcknowledgement.signature_required', array('options' => array('1' => 'Yes', '0' => 'No')));
	echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
	echo $form->end(array('label'=>'Save OA Details', 'id'=>'saveOAButton'));
	?>
    </fieldset>
</div>


<span id="orderAckID" style="display: none;"><?=$document['OrderAcknowledgement']['id']?></span>
<? //debug($this->data);?>
<? //debug($enquiry);?>
<?php  // debug($job);?>
<?php //debug($docType);?>

<? //debug($invoice); ?>

<?php // debug($job);?>
