diff --git a/views/jobs/build_jobs_json.ctp b/views/jobs/build_jobs_json.ctp index c9f6b94b..aabb8214 100644 --- a/views/jobs/build_jobs_json.ctp +++ b/views/jobs/build_jobs_json.ctp @@ -24,22 +24,26 @@ $recordObj->records = $totalNoRecords; $i=0; foreach($jobs as $job) { - + $cellArray = array( - // $job['Job']['id'], + // $job['Job']['id'], + $job['Job']['sale_category'], + $job['Job']['shipment_category'], $html->link($job['Job']['title'], array('controller'=>'jobs','action'=>'view', $job['Job']['id'])), $html->link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers','action'=>'view', $job['Enquiry']['customer_id'])), + $job['Job']['comments'], $job['Job']['customer_order_number'], - $job['Job']['supplier_reference'], $job['Job']['date_order_received'], + + $job['Job']['supplier_reference'], $job['Job']['date_order_placed_on_principle'], + $job['Job']['date_scheduled_ex_works'], $job['Job']['date_order_sent_to_customer'], $job['Job']['domestic_freight_paid_by'], - $job['Job']['sale_category'], - $job['Job']['shipment_category'], - $job['Job']['comments'], + + $job['Job']['company_gross_sales_aud'], $job['Job']['net_sales_aud'], $job['Job']['gross_profit_aud'], diff --git a/webroot/js/i18n/grid.locale-en.js b/webroot/js/i18n/grid.locale-en.js index 64dc885c..0912bda1 100755 --- a/webroot/js/i18n/grid.locale-en.js +++ b/webroot/js/i18n/grid.locale-en.js @@ -89,7 +89,7 @@ $.jgrid = { formatter : { integer : {thousandsSeparator: " ", defaultValue: '0'}, number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'}, - currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'}, + currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'}, date : { dayNames: [ "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat", diff --git a/webroot/js/job_grid.js b/webroot/js/job_grid.js index 629aa32b..9447973d 100644 --- a/webroot/js/job_grid.js +++ b/webroot/js/job_grid.js @@ -8,16 +8,41 @@ jQuery(document).ready(function(){ var numColWidth = 100; + var currencies = {}; + + var currenciesList = []; + + + /* $.getJSON('/currencies/jsonlist', function(data) { + currencies = data; + });*/ + + $.ajax({ + url: '/currencies/jsonlist', + async: false, + dataType: 'json', + success: function(data) { + currencies = data; + } + }); + + console.log(currencies); + + $.each(currencies, function(key, obj) { + currenciesList[key] = obj.name; + }); + + jQuery("#grid").jqGrid({ url:'/jobs/build_jobs_json/', datatype: "json", mtype: 'GET', colNames:[ //'id', - 'Job Number','customer','Customer Ref','Supplier Ref','Order Received', - 'Order Placed Principle','date_scheduled_ex_works','date_order_sent_to_customer','domestic_freight_paid_by', - 'sale_category','shipment_category','comments','company_gross_sales_aud','net_sales_aud','gross_profit_aud','ato_exchange_rate', - 'gst','currency_id','gst_amount','gross_commisions','invoiced_amount_inc_gst','net_export_sales_aud', + 'Sale Cat.','Shipment Cat.','Job Number','Customer','Description','Customer O/N','Order Received','Supplier Ref', + 'Order Placed Principle','date_scheduled_ex_works','date_order_sent_to_customer','Freight Paid By', + 'company_gross_sales_aud','net_sales_aud','gross_profit_aud','ato_exchange_rate', + 'gst','Sale Currency','gst_amount','gross_commisions','invoiced_amount_inc_gst','net_export_sales_aud', 'gross_profit_exports_aud','gp_percent','gross_australian_sales_foreign_currency','net_australian_sales_foreign_currency', 'gross_profit_value_australian_sales_foreign_currency','gross_export_sales_foreign_currency','net_export_sales_foreign_currency', 'gross_profit_value_after_discount_exports_foreign_currency','gross_commissions','net_commissions' @@ -36,13 +61,29 @@ jQuery(document).ready(function(){ colModel:[ - /*{ - name:'id', - index:'id', - width:200, - editable:false - },*/ - + { + name:'sale_category', + index:'sale_category', + width:130, + editable:true, + edittype:"select", + editoptions:{ + value:"INDENT:INDENT;STOCK:STOCK;COMMISSION:COMMISSION;SERVICE:SERVICE" + } + }, + + { + name:'shipment_category', + index:'shipment_category', + width:130, + editable:true, + edittype:"select", + editoptions:{ + value:"AUSTRALIA:AUSTRALIA;EXPORT:EXPORT;DIRECT-INTL:DIRECT-INTL;DIRECT-AUST:DIRECT-AUST;NO-SHIP:NO-SHIP" + } + }, + + { name:'title', @@ -60,15 +101,16 @@ jQuery(document).ready(function(){ }, { - name:'customer_order_number', - index:'customer_order_number', - width:100, - editable:true + name:'comments', + index:'comments', + width:200, + editable:true, + edittype:"textarea", }, { - name:'supplier_reference', - index:'supplier_reference', + name:'customer_order_number', + index:'customer_order_number', width:100, editable:true }, @@ -81,6 +123,13 @@ jQuery(document).ready(function(){ sorttype:"date" }, + { + name:'supplier_reference', + index:'supplier_reference', + width:100, + editable:true + }, + { name:'date_order_placed_on_principle', index:'date_order_placed_on_principle', @@ -116,55 +165,28 @@ jQuery(document).ready(function(){ } }, - { - name:'sale_category', - index:'sale_category', - width:120, - editable:true, - edittype:"select", - editoptions:{ - value:"INDENT:INDENT;STOCK:STOCK;COMMISSION:COMMISSION" - } - }, - - { - name:'shipment_category', - index:'shipment_category', - width:140, - editable:true, - edittype:"select", - editoptions:{ - value:"AUSTRALIA:AUSTRALIA;EXPORT:EXPORT;DIRECT-INTL:DIRECT-INTL;DIRECT-AUST:DIRECT-AUST;NO-SHIP:NO-SHIP" - } - }, - - { - name:'comments', - index:'comments', - width:200, - editable:true, - edittype:"textarea", - }, - { name:'company_gross_sales_aud', index:'company_gross_sales_aud', width:numColWidth, - editable:true + editable:true, + formatter: 'currency' }, { name:'net_sales_aud', index:'net_sales_aud', width:numColWidth, - editable:true + editable:true, + formatter: 'currency' }, { name:'gross_profit_aud', index:'gross_profit_aud', width:numColWidth, - editable:true + editable:true, + formatter: 'currency' }, { @@ -177,14 +199,24 @@ jQuery(document).ready(function(){ { name:'gst', width:numColWidth, - editable:true + editable:true, + edittype:"select", + formatter: "select", + editoptions: { + value: "1:YES;0:NO" + } }, { name:'currency_id', index:'currency_id', - width:numColWidth, - editable:true + width:180, + editable:true, + edittype:"select", + formatter: "select", + editoptions: { + value: currenciesList + } }, {