Added bill_to and ship_to to Documents [Invoices OAs]
This commit is contained in:
parent
dae68692fa
commit
7d22714d9d
|
|
@ -26,7 +26,7 @@ class DocumentsController extends AppController {
|
||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action'=>'index'));
|
||||||
}
|
}
|
||||||
$document = $this->Document->read(null,$id);
|
$document = $this->Document->read(null,$id);
|
||||||
//$document = $this->Document->find('first',array('conditions'=>array('Document.id'=>$id), 'recursive'=>2));
|
//$document = $this->Document->find('first',array('conditions'=>array('Document.id'=>$id), 'recursive'=>2));
|
||||||
$this->set('document', $document);
|
$this->set('document', $document);
|
||||||
|
|
||||||
$this->data = $document;
|
$this->data = $document;
|
||||||
|
|
@ -155,7 +155,7 @@ class DocumentsController extends AppController {
|
||||||
$this->data['Invoice']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
$this->data['Invoice']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
||||||
|
|
||||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||||
//$number_of_revisions = $this->Document->Invoice->findCount('Invoice.enquiry_id ='. $enquiryid);
|
//$number_of_revisions = $this->Document->Invoice->findCount('Invoice.enquiry_id ='. $enquiryid);
|
||||||
$this->data['Document']['revision'] = 0; //No revisions for Invoices. I have decreed it!
|
$this->data['Document']['revision'] = 0; //No revisions for Invoices. I have decreed it!
|
||||||
$this->data['Document']['type'] = 'invoice';
|
$this->data['Document']['type'] = 'invoice';
|
||||||
|
|
||||||
|
|
@ -218,7 +218,7 @@ class DocumentsController extends AppController {
|
||||||
}
|
}
|
||||||
else if (!empty($document['Quote']['id'])) {
|
else if (!empty($document['Quote']['id'])) {
|
||||||
|
|
||||||
//First setup the Date and default valid until date. (30 days from today).
|
//First setup the Date and default valid until date. (30 days from today).
|
||||||
|
|
||||||
$today_date = date("Y-m-d");
|
$today_date = date("Y-m-d");
|
||||||
$valid_until = date("Y-m-d", strtotime("+30 days"));
|
$valid_until = date("Y-m-d", strtotime("+30 days"));
|
||||||
|
|
@ -310,6 +310,7 @@ class DocumentsController extends AppController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function pdf($id = null) {
|
function pdf($id = null) {
|
||||||
//Configure::write('debug',0);
|
//Configure::write('debug',0);
|
||||||
|
|
@ -449,7 +450,7 @@ class DocumentsController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Called via AJAX to generate Quotation First Pages.
|
//Called via AJAX to generate Quotation First Pages.
|
||||||
function generateFirstPage($id = null) {
|
function generateFirstPage($id = null) {
|
||||||
$this->layout = 'ajax';
|
$this->layout = 'ajax';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ $this->element('pdf_output', array('pdfdoc'=>$pdfdoc));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//window.location.replace("/documents/view/<?=$document['Document']['id']?>");
|
window.location.replace("/documents/view/<?=$document['Document']['id']?>");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<? debug($document); ?>
|
<? //debug($document); ?>
|
||||||
<? //debug($enquiry); ?>
|
<? //debug($enquiry); ?>
|
||||||
|
|
@ -15,6 +15,10 @@
|
||||||
echo $form->input('Invoice.currency_id');
|
echo $form->input('Invoice.currency_id');
|
||||||
echo $form->input('Invoice.issue_date');
|
echo $form->input('Invoice.issue_date');
|
||||||
echo $form->input('Invoice.due_date');
|
echo $form->input('Invoice.due_date');
|
||||||
|
|
||||||
|
echo $form->input('Document.bill_to');
|
||||||
|
echo $form->input('Document.ship_to');
|
||||||
|
|
||||||
echo $form->input('Invoice.ship_via');
|
echo $form->input('Invoice.ship_via');
|
||||||
echo $form->input('Invoice.fob');
|
echo $form->input('Invoice.fob');
|
||||||
echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
|
echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@
|
||||||
echo $form->input('OrderAcknowledgement.currency_id');
|
echo $form->input('OrderAcknowledgement.currency_id');
|
||||||
echo $form->input('OrderAcknowledgement.issue_date');
|
echo $form->input('OrderAcknowledgement.issue_date');
|
||||||
|
|
||||||
|
echo $form->input('Document.bill_to');
|
||||||
|
echo $form->input('Document.ship_to');
|
||||||
|
|
||||||
|
|
||||||
echo $form->input('OrderAcknowledgement.ship_via');
|
echo $form->input('OrderAcknowledgement.ship_via');
|
||||||
echo $form->input('OrderAcknowledgement.fob');
|
echo $form->input('OrderAcknowledgement.fob');
|
||||||
echo $form->input('OrderAcknowledgement.estimated_delivery');
|
echo $form->input('OrderAcknowledgement.estimated_delivery');
|
||||||
|
|
|
||||||
|
|
@ -25,23 +25,11 @@ $col3width = '30%';
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: <?=$col1width?>; border-top: 1px solid black; border-left: 1px solid black; border-bottom: 1px solid black">
|
<td style="width: <?=$col1width?>; border-top: 1px solid black; border-left: 1px solid black; border-bottom: 1px solid black;">
|
||||||
<span style="font-weight: bold;"><?=$enquiry['Customer']['name'];?></span><br>
|
<?=$document['Document']['bill_to'];?>
|
||||||
<? if(!empty($enquiry['BillingAddress']['id'])):?>
|
|
||||||
<?=$enquiry['BillingAddress']['address'];?><br>
|
|
||||||
<?=$enquiry['BillingAddress']['city'];?><br>
|
|
||||||
<?=$enquiry['BillingAddress']['postcode'];?>
|
|
||||||
<?=strtoupper($states[$enquiry['BillingAddress']['state_id']]);?><br>
|
|
||||||
<? endif;?>
|
|
||||||
</td>
|
</td>
|
||||||
<td style="width: <?=$col1width?>; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black">
|
<td style="width: <?=$col1width?>; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black;">
|
||||||
<span style="font-weight: bold;"><?=$enquiry['Customer']['name'];?></span><br>
|
<?=$document['Document']['ship_to'];?>
|
||||||
<? if(!empty($enquiry['ShippingAddress']['id'])):?>
|
|
||||||
<?=$enquiry['ShippingAddress']['address'];?><br>
|
|
||||||
<?=$enquiry['ShippingAddress']['city'];?><br>
|
|
||||||
<?=$enquiry['ShippingAddress']['postcode'];?>
|
|
||||||
<?=strtoupper($states[$enquiry['ShippingAddress']['state_id']]);?><br>
|
|
||||||
<? endif; ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,9 @@ $(function() {
|
||||||
|
|
||||||
//Invoice View
|
//Invoice View
|
||||||
$('#shippingDetails').ckeditor(config);
|
$('#shippingDetails').ckeditor(config);
|
||||||
|
|
||||||
|
$("#DocumentBillTo").ckeditor(config);
|
||||||
|
$("#DocumentShipTo").ckeditor(config);
|
||||||
|
|
||||||
$("#saveInvoiceButton").click(function() {
|
$("#saveInvoiceButton").click(function() {
|
||||||
|
|
||||||
|
|
@ -334,6 +337,12 @@ $(function() {
|
||||||
this.updateElement();
|
this.updateElement();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#DocumentBillTo").ckeditor(function() {
|
||||||
|
this.updateElement();
|
||||||
|
});
|
||||||
|
$("#DocumentShipTo").ckeditor(function() {
|
||||||
|
this.updateElement();
|
||||||
|
});
|
||||||
var invoiceDetails = $('#DocumentEditForm').find('input,select,textarea');
|
var invoiceDetails = $('#DocumentEditForm').find('input,select,textarea');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue