diff --git a/app/controllers/documents_controller.php b/app/controllers/documents_controller.php index 607ff6e3..a7f9fb44 100755 --- a/app/controllers/documents_controller.php +++ b/app/controllers/documents_controller.php @@ -98,6 +98,21 @@ ENDDETAILS; ) )); + $sql = "SELECT DISTINCT freight_forwarder_text FROM purchase_orders WHERE freight_forwarder_text != '' ORDER BY freight_forwarder_text ASC;"; + + $previousValues = $this->Document->query($sql); + $ffOptions = array( + "CMC will make the booking with Fedex Economy. We will send you the labels. Please send us the packing list, invoice, weights and dimensions.", + "FEDEX Airfreight Economy service on CMC Account #409368441", + "FEDEX INTERNATIONAL Priority on CMC Account #409368441" + ); + + foreach($previousValues as $val) { + array_push($ffOptions, $val["purchase_orders"]["freight_forwarder_text"]); + } + + asort($ffOptions); + $this->set('freightForwarderSelect', $ffOptions); break; case 'orderAck': $this->set('currencies', $this->Document->OrderAcknowledgement->Currency->find('list')); @@ -1087,10 +1102,6 @@ EOT; $label = ""; - if (count($results) == 0) { - return; - } - if (count($results) > 0) { $label = $results[0]["po"]["po_title"]; } @@ -1098,9 +1109,9 @@ EOT; foreach ($results as $result) { $label .= " / ". $result["j"]["job_title"]; } - + $ffText = $po['PurchaseOrder']['freight_forwarder_text']; echo <<FREIGHT FORWARDER: $ffText
PART SHIPMENT: Not Acceptable - please advise ASAP if production of an Item will Delay the Dispatch of the Complete Order by the Date Required stated above.
INSURANCE: DO NOT INSURE - Insurance effected by CMC
SECURITY: It is essential that the cargo is prepared & handled so as not to compromise its security standing.
diff --git a/app/views/documents/view.ctp b/app/views/documents/view.ctp index 075a523e..f083bd87 100755 --- a/app/views/documents/view.ctp +++ b/app/views/documents/view.ctp @@ -2,7 +2,7 @@ echo $javascript->link('ckeditor/ckeditor'); echo $javascript->link('ckeditor/adapters/jquery'); -echo $javascript->link('document_add_edit_20240421'); +echo $javascript->link('document_add_edit_20240918'); echo $javascript->link('document_attachments'); ?> diff --git a/app/views/elements/document_purchase_order_view.ctp b/app/views/elements/document_purchase_order_view.ctp index c1760347..5b52cddb 100755 --- a/app/views/elements/document_purchase_order_view.ctp +++ b/app/views/elements/document_purchase_order_view.ctp @@ -45,8 +45,21 @@ echo $form->input('PurchaseOrder.dispatch_by'); echo $form->input('PurchaseOrder.deliver_to'); +?> + +
+ +
+input('PurchaseOrder.freight_forwarder_text'); echo $form->input('PurchaseOrder.shipping_instructions'); ?> + +