From 0211c87741d0ab134b126fe2e12e9c228f43b499 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Sun, 9 Jun 2013 16:37:00 +1000 Subject: [PATCH] Work on packing lists. Fixed problem cloning products --- app/controllers/documents_controller.php | 9 +++++++++ app/controllers/products_controller.php | 3 +++ app/views/elements/document_orderack_view.ctp | 8 +++++++- app/webroot/js/document_add_edit.js | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/controllers/documents_controller.php b/app/controllers/documents_controller.php index 8a837f21..d746d712 100755 --- a/app/controllers/documents_controller.php +++ b/app/controllers/documents_controller.php @@ -82,6 +82,10 @@ class DocumentsController extends AppController { $this->set('currencies', $this->Document->OrderAcknowledgement->Currency->find('list')); $this->set('job', $this->Document->OrderAcknowledgement->Job->find('first', array('conditions'=>array('Job.id'=>$document['OrderAcknowledgement']['job_id'])))); $docTypeElement = 'document_orderack_view'; + + case 'packingList': + $docTypeElement = 'document_packinglist_view'; + break; } $this->set('docTypeElement', $docTypeElement); @@ -282,6 +286,11 @@ class DocumentsController extends AppController { $this->data['Document']['type'] = 'orderAck'; break; + + case "packingList"; + break; + + } if(isset($source_document_id)) { diff --git a/app/controllers/products_controller.php b/app/controllers/products_controller.php index 6a85856f..a8237c60 100755 --- a/app/controllers/products_controller.php +++ b/app/controllers/products_controller.php @@ -82,6 +82,9 @@ class ProductsController extends AppController { $this->data['Product']['principle_id'] = $product['Product']['principle_id']; $this->data['Product']['title'] = $product['Product']['title']; $this->data['Product']['description'] = $product['Product']['description']; + $this->data['Product']['item_code'] = $product['Product']['item_code']; + $this->data['Product']['item_description'] = $product['Product']['item_description']; + $principles = $this->Product->Principle->find('list'); $this->set(compact('principles', 'product_categories')); diff --git a/app/views/elements/document_orderack_view.ctp b/app/views/elements/document_orderack_view.ctp index fc6cae67..c47b25bf 100755 --- a/app/views/elements/document_orderack_view.ctp +++ b/app/views/elements/document_orderack_view.ctp @@ -12,7 +12,13 @@

Create new Documents based on this

diff --git a/app/webroot/js/document_add_edit.js b/app/webroot/js/document_add_edit.js index b4486fe0..f4f25629 100755 --- a/app/webroot/js/document_add_edit.js +++ b/app/webroot/js/document_add_edit.js @@ -398,7 +398,7 @@ $(function() { $("#addJobConfirmation").dialog('open'); }); - $("#createInvoice").click(function() { + $(".button-link").click(function() { location.href = $(this).data('href'); });