Improvements to jobs list
This commit is contained in:
parent
634683fafc
commit
a56679ed54
|
|
@ -24,22 +24,26 @@ $recordObj->records = $totalNoRecords;
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($jobs as $job) {
|
foreach($jobs as $job) {
|
||||||
|
|
||||||
|
|
||||||
$cellArray = array(
|
$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($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'])),
|
$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']['customer_order_number'],
|
||||||
$job['Job']['supplier_reference'],
|
|
||||||
$job['Job']['date_order_received'],
|
$job['Job']['date_order_received'],
|
||||||
|
|
||||||
|
$job['Job']['supplier_reference'],
|
||||||
$job['Job']['date_order_placed_on_principle'],
|
$job['Job']['date_order_placed_on_principle'],
|
||||||
|
|
||||||
$job['Job']['date_scheduled_ex_works'],
|
$job['Job']['date_scheduled_ex_works'],
|
||||||
$job['Job']['date_order_sent_to_customer'],
|
$job['Job']['date_order_sent_to_customer'],
|
||||||
$job['Job']['domestic_freight_paid_by'],
|
$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']['company_gross_sales_aud'],
|
||||||
$job['Job']['net_sales_aud'],
|
$job['Job']['net_sales_aud'],
|
||||||
$job['Job']['gross_profit_aud'],
|
$job['Job']['gross_profit_aud'],
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ $.jgrid = {
|
||||||
formatter : {
|
formatter : {
|
||||||
integer : {thousandsSeparator: " ", defaultValue: '0'},
|
integer : {thousandsSeparator: " ", defaultValue: '0'},
|
||||||
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
|
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 : {
|
date : {
|
||||||
dayNames: [
|
dayNames: [
|
||||||
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
|
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,41 @@ jQuery(document).ready(function(){
|
||||||
var numColWidth = 100;
|
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({
|
jQuery("#grid").jqGrid({
|
||||||
url:'/jobs/build_jobs_json/',
|
url:'/jobs/build_jobs_json/',
|
||||||
datatype: "json",
|
datatype: "json",
|
||||||
mtype: 'GET',
|
mtype: 'GET',
|
||||||
colNames:[
|
colNames:[
|
||||||
//'id',
|
//'id',
|
||||||
'Job Number','customer','Customer Ref','Supplier Ref','Order Received',
|
'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','domestic_freight_paid_by',
|
'Order Placed Principle','date_scheduled_ex_works','date_order_sent_to_customer','Freight Paid By',
|
||||||
'sale_category','shipment_category','comments','company_gross_sales_aud','net_sales_aud','gross_profit_aud','ato_exchange_rate',
|
'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',
|
'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_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_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'
|
'gross_profit_value_after_discount_exports_foreign_currency','gross_commissions','net_commissions'
|
||||||
|
|
@ -36,13 +61,29 @@ jQuery(document).ready(function(){
|
||||||
|
|
||||||
colModel:[
|
colModel:[
|
||||||
|
|
||||||
/*{
|
{
|
||||||
name:'id',
|
name:'sale_category',
|
||||||
index:'id',
|
index:'sale_category',
|
||||||
width:200,
|
width:130,
|
||||||
editable:false
|
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',
|
name:'title',
|
||||||
|
|
@ -60,15 +101,16 @@ jQuery(document).ready(function(){
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'customer_order_number',
|
name:'comments',
|
||||||
index:'customer_order_number',
|
index:'comments',
|
||||||
width:100,
|
width:200,
|
||||||
editable:true
|
editable:true,
|
||||||
|
edittype:"textarea",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'supplier_reference',
|
name:'customer_order_number',
|
||||||
index:'supplier_reference',
|
index:'customer_order_number',
|
||||||
width:100,
|
width:100,
|
||||||
editable:true
|
editable:true
|
||||||
},
|
},
|
||||||
|
|
@ -81,6 +123,13 @@ jQuery(document).ready(function(){
|
||||||
sorttype:"date"
|
sorttype:"date"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name:'supplier_reference',
|
||||||
|
index:'supplier_reference',
|
||||||
|
width:100,
|
||||||
|
editable:true
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'date_order_placed_on_principle',
|
name:'date_order_placed_on_principle',
|
||||||
index:'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',
|
name:'company_gross_sales_aud',
|
||||||
index:'company_gross_sales_aud',
|
index:'company_gross_sales_aud',
|
||||||
width:numColWidth,
|
width:numColWidth,
|
||||||
editable:true
|
editable:true,
|
||||||
|
formatter: 'currency'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'net_sales_aud',
|
name:'net_sales_aud',
|
||||||
index:'net_sales_aud',
|
index:'net_sales_aud',
|
||||||
width:numColWidth,
|
width:numColWidth,
|
||||||
editable:true
|
editable:true,
|
||||||
|
formatter: 'currency'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'gross_profit_aud',
|
name:'gross_profit_aud',
|
||||||
index:'gross_profit_aud',
|
index:'gross_profit_aud',
|
||||||
width:numColWidth,
|
width:numColWidth,
|
||||||
editable:true
|
editable:true,
|
||||||
|
formatter: 'currency'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -177,14 +199,24 @@ jQuery(document).ready(function(){
|
||||||
{
|
{
|
||||||
name:'gst',
|
name:'gst',
|
||||||
width:numColWidth,
|
width:numColWidth,
|
||||||
editable:true
|
editable:true,
|
||||||
|
edittype:"select",
|
||||||
|
formatter: "select",
|
||||||
|
editoptions: {
|
||||||
|
value: "1:YES;0:NO"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'currency_id',
|
name:'currency_id',
|
||||||
index:'currency_id',
|
index:'currency_id',
|
||||||
width:numColWidth,
|
width:180,
|
||||||
editable:true
|
editable:true,
|
||||||
|
edittype:"select",
|
||||||
|
formatter: "select",
|
||||||
|
editoptions: {
|
||||||
|
value: currenciesList
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue