diff --git a/controllers/documents_controller.php b/controllers/documents_controller.php index 598cf2c4..f370a516 100755 --- a/controllers/documents_controller.php +++ b/controllers/documents_controller.php @@ -292,16 +292,21 @@ class DocumentsController extends AppController { } - /*function delete($id = null) { - if (!$id) { - $this->Session->setFlash(__('Invalid id for Document', true)); - $this->redirect(array('action'=>'index')); - } - if ($this->Document->del($id)) { - $this->Session->setFlash(__('Document deleted', true)); - $this->redirect(array('action'=>'index')); - } - }*/ + function generateFirstPage($id = null) { + $this->layout = 'ajax'; + + if(!$id) { + return; + } + + $document = $this->Document->read(null, $id); + $this->set('document',$document); + + $enquiry = $this->Document->Quote->Enquiry->read(null, $document['Quote']['enquiry_id']); + $this->set('enquiry', $enquiry); + + + } } ?> \ No newline at end of file diff --git a/controllers/line_items_controller.php b/controllers/line_items_controller.php index c5a24914..d4278ba7 100755 --- a/controllers/line_items_controller.php +++ b/controllers/line_items_controller.php @@ -62,6 +62,10 @@ class LineItemsController extends AppController { } } + /** + * Get the products table with prices (for quotes, invoices etc) + * @param $documentID + */ function getTable($documentID = null) { $this->layout = 'ajax'; if($documentID == null) { @@ -72,7 +76,7 @@ class LineItemsController extends AppController { $this->set('document',$document); $enquiry = $this->LineItem->Document->getEnquiry($document); - + $this->set('enquiry', $enquiry); $gst = $this->LineItem->Document->gstApplies($enquiry); $this->set('gst',$gst); diff --git a/views/documents/generate_first_page.ctp b/views/documents/generate_first_page.ctp new file mode 100644 index 00000000..b2448f5f --- /dev/null +++ b/views/documents/generate_first_page.ctp @@ -0,0 +1,29 @@ +

Dear ,

+ +

Thank you for your enquiry. The following quotation is for:

+ + + + + + + + + + + + + +
ItemDescriptionQuantity
'; + } + ?>
+

If you have any further queries, please contact us at our office for assistance.

+

We look forward to your reply.

+ +

Regards,

+
+
+
+Attachments:
+CMC Technologies Terms & Conditions of Sale 1/7/06 (attached)
\ No newline at end of file diff --git a/views/elements/document_quote_view.ctp b/views/elements/document_quote_view.ctp index e66c4936..2621d28c 100644 --- a/views/elements/document_quote_view.ctp +++ b/views/elements/document_quote_view.ctp @@ -1,10 +1,10 @@

Quote: link($enquiry['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view',$enquiry['Enquiry']['id']));?> 0) { - echo "Revision {$document['Quote']['revision']} "; -} -?> -for -link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view',$enquiry['Customer']['id']));?> + if($document['Quote']['revision'] > 0) { + echo "Revision {$document['Quote']['revision']} "; + } + ?> + for + link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view',$enquiry['Customer']['id']));?>

@@ -16,6 +16,7 @@ echo $form->input('Document.id');
+ link('Generate PDF of this Quote', '/documents/pdf/'.$document['Document']['id']);?> @@ -25,13 +26,25 @@ echo $form->input('Document.id');
- $page):?> + $page):?> + +
input("DocPage.{$key}.id");?> - input("DocPage.{$key}.content", array('class'=>'page', 'label'=>'Page '.$page['page_number'], 'between'=>''));?> + input("DocPage.{$key}.content", array('class'=>$class, 'label'=>'Page '.$page['page_number'], 'between'=>''));?> input("DocPage.{$key}.document_id", array('type'=>'hidden'));?> - input("DocPage.{$key}.page_number", array('type'=>'hidden'));?> + input("DocPage.{$key}.page_number", array('type'=>'hidden'));?>
@@ -49,6 +62,10 @@ echo $form->input('Document.id'); ANY VARIATIONS ON ITEMS 5. TO 7. WILL BE TO YOUR ACCOUNT. THIS QUOTATION IS BASED ON QUANTITIES STATED AND IS SUBJECT TO CHANGE IF QUANTITIES VARY.
+ + + + data);?> diff --git a/views/enquiries/view.ctp b/views/enquiries/view.ctp index e250aaa1..73023b46 100755 --- a/views/enquiries/view.ctp +++ b/views/enquiries/view.ctp @@ -220,6 +220,10 @@ $class = ' class="altrow"';?> Redirecting you now to fill in the details. +
+ This will create a new Job and a Job number. Are you sure you want to do this? +
+