Order Acknowledgement: =$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?> for =$html->link($enquiry['Customer']['name'], '/customers/view/'.$enquiry['Customer']['id']);?>
+
Order Acknowledgement: =$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?> for =$html->link($enquiry['Customer']['name'], '/customers/view/'.$enquiry['Customer']['id']);?>
+
=$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']);?>
-
+
Create an Invoice from this OA
=$html->link('Create an Invoice based on this OA', '/documents/convert_to_invoice/'.$document['Document']['id'], array('class'=>'actionLink'));?>
Has =$html->link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view',$enquiry['Customer']['id']));?> placed an order for this Quote?
- //$html->link('Convert this Enquiry to a new Job and Generate an Order Acknowledgement', '/documents/convert_to_oa/'.$document['Document']['id'], array('class'=>'actionLink'));?>
-
+
- This will create a new job and an Order Acknowledgement based on this Quote
+ This will create an Order Acknowledgement based on this Quote The Enquiry will also be marked as "Job Won - Order Placed"
+ You can create a new Job now, or add it to an existing Job later
echo $form->create('Document',array('type'=>'post','action'=>'convert_to_oa'));
- echo $form->input('Document.id');
- echo $form->input('Job.customer_order_number');
+ echo $form->input('Document.id');
+ echo $form->input('Job.create_new_job', array('type'=>'select', 'options'=> array('No', 'Yes')));
+ echo $form->input('Job.customer_order_number');
echo $form->end();
?>
//debug($this->data);?>
- //debug($enquiry);?>
+ //print_r($enquiry);?>
diff --git a/app/webroot/js/document_add_edit.js b/app/webroot/js/document_add_edit.js
index 83f21492..7247d73f 100755
--- a/app/webroot/js/document_add_edit.js
+++ b/app/webroot/js/document_add_edit.js
@@ -337,13 +337,8 @@ $(function() {
});
$.get('/quotes/edit/'+quoteID, function(data) {
-
-
-
$("#QuoteDetails").html(data);
-
$('#QuoteCommercialComments').ckeditor(config);
-
$("#QuoteDetails").dialog('open');
});
});
@@ -416,11 +411,11 @@ $(function() {
updateTextFields(); //Update the CKEditor instances.
- var invoiceDetails = $('#DocumentEditForm').find('input,select,textarea');
+ var oaDetails = $('#DocumentEditForm').find('input,select,textarea');
- $.post('/documents/ajax_edit', invoiceDetails, function(data) {
+ $.post('/documents/ajax_edit', oaDetails, function(data) {
if(data =='SUCCESS') {
$("#flashMessage").html("Order Acknowledgement Saved Successfully");
}
@@ -428,6 +423,7 @@ $(function() {
$("#flashMessage").html("Unable to Save Order Acknowledgement");
}
+ $('.job-title').html($("#OrderAcknowledgementJobId :selected").text());
$("#flashMessage").show();
@@ -438,10 +434,29 @@ $(function() {
- $("#createJobAndOA").click(function() {
+ $("#createOA").click(function() {
$("#addJobConfirmation").dialog('open');
});
+ $(".billing_address").click(function() {
+ if($(this).val() > 0 ) {
+ var address = $(this).next().html();
+ var c = confirm("Set the 'Bill To' field to this address?");
+ if(c) {
+ $("#DocumentBillTo").val(address);
+ }
+ }
+ });
+
+ $(".shipping_address").click(function() {
+ if($(this).val() > 0 ) {
+ var address = $(this).next().html();
+ var c = confirm("Set the 'Ship To' field to this address?");
+ if(c) {
+ $("#DocumentShipTo").val(address);
+ }
+ }
+ });
});