diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php index 6f3a46a6..dfc87eed 100755 --- a/controllers/jobs_controller.php +++ b/controllers/jobs_controller.php @@ -51,7 +51,7 @@ class JobsController extends AppController { $this->set('sale_category_options', $this->sale_category_options()); $this->set('sale_category_array', $this->sale_category_array()); $this->set('job_type_options', $this->job_type_options()); - $this->set('shipment_options', $this->shipment_options()); + $this->set('shipment_category_options', $this->shipment_category_options()); $this->set('freight_paid_by_options',$this->freight_paid_options()); $this->set('gst_options', $this->gst_options()); @@ -67,13 +67,12 @@ class JobsController extends AppController { $this->data = $job; - + $this->set('shipment_category_options', $this->shipment_category_options()); $this->set('yesNo', array(0=>'No', 1=>'Yes')); $this->set('currencies', $this->Job->Currency->find('list')); $this->set('sale_category_options', $this->sale_category_options()); $this->set('sale_category_array', $this->sale_category_array()); $this->set('job_type_options', $this->job_type_options()); - $this->set('shipment_options', $this->shipment_options()); $this->set('freight_paid_by_options',$this->freight_paid_options()); $this->set('gst_options', $this->gst_options()); $this->set('job_status_options', $this->job_status_options()); @@ -89,7 +88,7 @@ class JobsController extends AppController { $this->set('sale_category_options', $this->sale_category_options()); $this->set('sale_category_array', $this->sale_category_array()); $this->set('job_type_options', $this->job_type_options()); - $this->set('shipment_options', $this->shipment_options()); + $this->set('shipment_category_options', $this->shipment_category_options()); $this->set('freight_paid_by_options',$this->freight_paid_options()); $this->set('gst_options', $this->gst_options()); @@ -215,16 +214,16 @@ class JobsController extends AppController { function sale_category_options() { $options['Australian Sale'] = array( - 0 => "Australian Customer & Australian Destination (GST Applies)", - 1 => "Overseas Customer & Australian Destination (GST Applies)", - 2 => "Commission from Australian Company or Supplier (GST Applies)", + 0 => "AS: Australian Customer & Australian Destination (GST Applies)", + 1 => "AS: Overseas Customer & Australian Destination (GST Applies)", + 2 => "AS: Commission from Australian Company or Supplier (GST Applies)", ); $options['Exports'] = array( - 3 => "Overseas Customer & Overseas Destination (no GST)", - 4 => "Australian Customer & Overseas Destination (no GST)", - 5 => "Commission from Overseas Company (no GST)" + 3 => "EX: Overseas Customer & Overseas Destination (no GST)", + 4 => "EX: Australian Customer & Overseas Destination (no GST)", + 5 => "EX: Commission from Overseas Company (no GST)" ); @@ -234,32 +233,42 @@ class JobsController extends AppController { /** For viewing the sale Cat */ function sale_category_array() { $options = array( - 0 => "Australian Customer & Australian Destination (GST Applies)", - 1 => "Overseas Customer & Australian Destination (GST Applies)", - 2 => "Commission from Australian Company or Supplier (GST Applies)", - 3 => "Overseas Customer & Overseas Destination (no GST)", - 4 => "Australian Customer & Overseas Destination (no GST)", - 5 => "Commission from Overseas Company (no GST)" + 0 => "AS: Australian Customer & Australian Destination (GST Applies)", + 1 => "AS: Overseas Customer & Australian Destination (GST Applies)", + 2 => "AS: Commission from Australian Company or Supplier (GST Applies)", + 3 => "EX: Overseas Customer & Overseas Destination (no GST)", + 4 => "EX: Australian Customer & Overseas Destination (no GST)", + 5 => "EX: Commission from Overseas Company (no GST)" ); return $options; } + + + + /** * Build the Array for 'job_type' */ function job_type_options() { - $options = array('INDENT','STOCK','COMMISSION','SERVICE'); + //$options = array('INDENT','STOCK','COMMISSION','SERVICE'); + $options = array('GOODS','SERVICES'); $enumOpts = $this->buildEnumOpts($options); return $enumOpts; } - function shipment_options() { - $options = array('AUSTRALIA','EXPORT','DIRECT-INTL','DIRECT-AUST','NO-SHIP'); - $enumOpts = $this->buildEnumOpts($options); - return $enumOpts; + function shipment_category_options() { + $options = array( + 0 => 'Indent - via CMC', + 1 => 'Direct - Principle to final', + 2 => 'Stock', + 3 => 'No Shipment' + ); + + return $options; } function freight_paid_options() { @@ -286,7 +295,7 @@ class JobsController extends AppController { function ajax_edit() { if(!empty($this->data)) { - + print_r($this->data); if ($this->Job->save($this->data)) { echo "SUCCESS"; } diff --git a/models/job.php b/models/job.php index d6c9d8bc..380d4e50 100755 --- a/models/job.php +++ b/models/job.php @@ -49,13 +49,14 @@ class Job extends AppModel { 'Email' => array( 'className' => 'Email', 'joinTable' => 'emails_jobs', + ), + + 'ShipmentCategory' => array( + 'className' => 'ShipmentCategory', + 'joinTable' => 'jobs_shipment_categories' ) ); - - - function getJobsByWeekNumber() { - - } + } ?> \ No newline at end of file diff --git a/views/jobs/get_editable_row.ctp b/views/jobs/get_editable_row.ctp index f4c73cec..f977b0b6 100644 --- a/views/jobs/get_editable_row.ctp +++ b/views/jobs/get_editable_row.ctp @@ -31,6 +31,9 @@ }); + + + }); @@ -70,7 +73,9 @@ else { input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?> -input('shipment_category', array('options'=>$shipment_options, 'label'=>false,'selected'=>$job['Job']['shipment_category']));?> +input('shipment_category', array('options'=>$shipment_category_options, + 'type'=>'select','label'=>false,'value'=>$job['Job']['shipment_category']));?> + link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?> link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?> - + link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?> link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?> counter(array( -create('Job', array('action'=>'/jobs/ajax_edit'));?> +create('Job', array('action'=>'/jobs/ajax_edit', 'default'=>false));?>
@@ -93,7 +93,7 @@ echo $paginator->counter(array( - + - + @@ -81,7 +81,7 @@ - - - - -
link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?> link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?> Gross Sales AUD Net Sales AUD Gross Profit AUDNet Sales Converted to or Charge in AUDNet Export Sales Converted to Or Invoiced in AUD GP% Excl Commissions ATO Exchange Rate - + currency($job['Job']['company_gross_sales_aud']);?> - + currency($job['Job']['net_sales_aud']);?> - + currency($job['Job']['gross_profit_aud']);?> - + currency($job['Job']['gross_profit_exports_aud']);?> @@ -116,14 +116,14 @@ + currency($job['Job']['gross_australian_sales_foreign_currency'], $job['Currency']['iso4217']);?> - currency($job['Job']['net_australian_sales_foreign_currency'], $job['Currency']['iso4217']); if($doCount) { $net_australian_sales_foreign_currency_total += $job['Job']['net_australian_sales_foreign_currency']; @@ -131,7 +131,7 @@ ?> currency($job['Job']['gross_profit_value_australian_sales_foreign_currency'], $job['Currency']['iso4217']); if($doCount) { $gross_profit_value_australian_sales_foreign_currency_total += $job['Job']['gross_profit_value_australian_sales_foreign_currency']; @@ -139,7 +139,7 @@ ?> - currency($job['Job']['gross_export_sales_foreign_currency'],$job['Currency']['iso4217']); if($doCount) { @@ -147,13 +147,13 @@ } ?> currency($job['Job']['net_export_sales_foreign_currency'],$job['Currency']['iso4217']); if($doCount) { $net_export_sales_foreign_currency_total += $job['Job']['net_export_sales_foreign_currency']; } ?> currency($job['Job']['gross_profit_value_after_discount_exports_foreign_currency'],$job['Currency']['iso4217']); if($doCount) { $gross_profit_value_after_discount_exports_foreign_currency_total += $job['Job']['gross_profit_value_after_discount_exports_foreign_currency']; @@ -161,13 +161,13 @@ ?> - currency($job['Job']['gross_commissions']); if($doCount) { $gross_commissions_total += $job['Job']['gross_commissions']; } ?> currency($job['Job']['net_commissions']); if($doCount) { $net_commissions_total += $job['Job']['net_commissions']; } @@ -210,5 +210,5 @@ \ No newline at end of file diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index a0fbf23b..e34db6ae 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -1354,6 +1354,10 @@ select.job_status { overflow:scroll; } +select.shipmentCategories { + width: 200px; +} + /* CSS for the Job Reporting */ @@ -1388,10 +1392,12 @@ ul.monthList li { span.month { cursor: pointer; + font-size: 80% } span.year { cursor: pointer; + } tr.cancelled td { diff --git a/webroot/js/job_index.js b/webroot/js/job_index.js index 721745b9..81ba8b47 100644 --- a/webroot/js/job_index.js +++ b/webroot/js/job_index.js @@ -1,9 +1,10 @@ $(function() { -// $(".editButton").show(); + // $(".editButton").show(); + $(".editButton").live('click',function() { @@ -27,10 +28,31 @@ $(function() { var id = $(this).parents('tr').attr('id'); var thisJobInputs = $('#'+id).find('input,select'); + /*var selectedShipmentCategories = []; + $('#'+id+'_shipment_categories option').each(function(i) { + if (this.selected == true) { + selectedShipmentCategories.push(this.value); + } + }); + + alert(selectedShipmentCategories); + */ + + $.post('/jobs/ajax_edit', thisJobInputs, function(data) { getViewable(id); }); + /*$.ajax({ + type:"post", + url:"/ajax_edit", + data: { + 'job': thisJobInputs, + 'shipmentCategory': selectedShipmentCategories + } + }); */ + + return false; });