diff --git a/controllers/countries_controller.php b/controllers/countries_controller.php
index 2e58a07a..dc2e2a77 100755
--- a/controllers/countries_controller.php
+++ b/controllers/countries_controller.php
@@ -76,23 +76,26 @@ class CountriesController extends AppController {
$query = Sanitize::clean($query);
- $countries = $this->Country->find('all', array(
+ $countries = $this->Country->find('list', array(
'conditions' => array(
'Country.name LIKE' => '%'.$query.'%'
- ),'fields' => array('Country.name'), 'order' =>array('Country.name ASC')
+ ),'fields' => array('Country.id', 'Country.name'), 'order' =>array('Country.name ASC')
));
+ //print_r($countries);
- foreach ($countries as $country) {
- $countryid = $country['Country']['id'];
- $country_list[] = array('id'=> $countryid, 'label' => $country['Country']['name']);
+ foreach ($countries as $id => $country) {
+
+ $country_list[] = array('id'=> $id, 'label' => $country);
}
- $countries_json = json_encode($country_list);
+ //$countries_json = json_encode($country_list);
+
+ $countries_json = json_encode($country_list);
$this->set('countries_json', $countries_json);
diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php
index 85c7c1ca..0e91edea 100755
--- a/controllers/jobs_controller.php
+++ b/controllers/jobs_controller.php
@@ -15,7 +15,7 @@ class JobsController extends AppController {
);
function index() {
- //$this->Job->recursive = 1;
+ $this->Job->recursive = 1;
$this->set('jobs', $this->paginate());
$this->set('customers', $this->Job->Enquiry->Customer->find('list'));
$this->set('currencies', $this->Job->Currency->find('list'));
@@ -23,8 +23,60 @@ class JobsController extends AppController {
+
+
function index_grid() {
+ $this->layout = 'jqgrid';
+ //$jobs = $this->paginate();
+
+ /*$jobs = $this->Job->find('all', array('recursive'=>0));
+
+ $this->set('jobs', $jobs);
+
+ $customers = $this->Job->Enquiry->Customer->find('list');
+ $this->set('customers', $customers);
+ $this->set('currencies', $this->Job->Currency->find('list'));*/
+
+ }
+
+
+ function build_jobs_json() {
+
+ $this->layout = 'ajax';
+ $jobs = $this->paginate();
+
+ $this->set('jobs', $jobs);
+
+ $customers = $this->Job->Enquiry->Customer->find('list');
+ $this->set('customers', $customers);
+ $this->set('currencies', $this->Job->Currency->find('list'));
+ }
+
+
+ function ajax_edit() {
+ if(isset($this->params['form'])) {
+
+ $job = $this->params['form'];
+
+
+ if ($this->Job->save($job)) {
+ echo "SUCCESS";
+ }
+ else {
+ echo "FAILURE";
+ }
+
+
+ }
+ else {
+ return;
+ }
+
+ }
+
+ function index_oldgrid() {
+
$this->layout = 'grid';
$jobs = $this->paginate();
diff --git a/views/countries/complete_country.ctp b/views/countries/complete_country.ctp
index 22a1c5ef..b25e67cb 100755
--- a/views/countries/complete_country.ctp
+++ b/views/countries/complete_country.ctp
@@ -2,5 +2,4 @@
if(isset($countries_json)) {
echo $countries_json;
}
-
?>
\ No newline at end of file
diff --git a/views/elements/principle_contacts.ctp b/views/elements/principle_contacts.ctp
index 5a07febe..46db2b02 100755
--- a/views/elements/principle_contacts.ctp
+++ b/views/elements/principle_contacts.ctp
@@ -37,8 +37,8 @@ foreach ($principleContacts as $principleContact):
+ counter(array(
+ 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+ ));
+ ?>
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/views/jobs/index.ctp b/views/jobs/index.ctp
old mode 100755
new mode 100644
index a0b40b37..59fbfc41
--- a/views/jobs/index.ctp
+++ b/views/jobs/index.ctp
@@ -3,271 +3,23 @@
//echo $javascript->link('jquery.jeditable.mini');
//echo $javascript->link('jobindex_editinplace');
//echo $javascript->link('addjob');
-echo $javascript->link('job_index');
+//echo $javascript->link('job_index');
?>
-
- /*
-
- counter(array(
- 'format' => __('Page %page% of %pages%, showing %current% Jobs out of %count% total, starting on record %start%, ending on %end%', true)
- ));
- ?>
-
- prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | numbers();?>
- next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
-
-
-
-
-
-
-
-
- sort('created');?>
- sort('Job Number');?>
- sort('enquiry_id');?>
- sort('Customer');?>
- sort('customer_order_number');?>
- sort('supplier_reference');?>
-
-
- sort('date_order_received');?>
- sort('date_order_placed_on_principle');?>
- sort('date_scheduled_ex_works');?>
- sort('date_order_sent_to_customer');?>
-
- sort('domestic_freight_paid_by');?>
- sort('sale_category');?>
- sort('shipment_category');?>
- sort('comments');?>
-
- sort('company_gross_sales_aud');?>
- sort('net_sales_aud');?>
- sort('gross_profit_aud');?>
- sort('ato_exchange_rate');?>
- sort('gst');?>
- sort('currency_id');?>
- sort('gst_amount');?>
- sort('gross_commisions');?>
- sort('invoiced_amount_inc_gst');?>
- sort('net_export_sales_aud');?>
- sort('gross_profit_exports_aud');?>
- sort('gp_percent');?>
- sort('gross_australian_sales_foreign_currency');?>
- sort('net_australian_sales_foreign_currency');?>
- sort('gross_profit_value_australian_sales_foreign_currency');?>
- sort('gross_export_sales_foreign_currency');?>
- sort('net_export_sales_foreign_currency');?>
- sort('gross_profit_value_after_discount_exports_foreign_currency');?>
- sort('gross_commissions');?>
- sort('net_commissions');?>
-
-
-
-
-
-
-
-
-
-
- toUnix($job['Job']['created'])); ?>
-
-
-
- link(__($job['Job']['title'], true), array('action' => 'view', $job['Job']['id'])); ?>
-
-
- link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
-
-
- link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers',
- 'action'=>'view', $job['Enquiry']['customer_id'])); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
- link(__('Edit', true), array('action' => 'edit', $job['Job']['id']), array('class'=>'editWindow', 'name'=>$job['Job']['id'])); ?>
-
-
-
-
-
-
-
-
- prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | numbers();?>
- next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
-
-
-
-
-
\ No newline at end of file
+=debug($jobs);?>
\ No newline at end of file
diff --git a/views/jobs/index_datatable.ctp b/views/jobs/index_datatable.ctp
new file mode 100644
index 00000000..1e8be4be
--- /dev/null
+++ b/views/jobs/index_datatable.ctp
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+
+
+ Created
+ Job Number
+ Enquiry
+ Customer
+ Customer order No
+ Supplier Reference
+
+
+ Date Order Received
+ Date Order Placed On 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
+ 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
+
+
+
+ // ?>
+
+
+
+
+
+
+
+
+
+
+ toUnix($job['Job']['created'])); ?>
+
+
+
+ link(__($job['Job']['title'], true), array('action' => 'view', $job['Job']['id'])); ?>
+
+
+ link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
+
+
+ link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers',
+ 'action'=>'view', $job['Enquiry']['customer_id'])); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /*
+ link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
+ link(__('Edit', true), array('action' => 'edit', $job['Job']['id']), array('class'=>'editWindow', 'name'=>$job['Job']['id'])); ?>
+ */ ?>
+
+
+
+
+
+
+
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+
+
+
+
+
+
diff --git a/views/jobs/index_grid.ctp b/views/jobs/index_grid.ctp
index fef96279..3ccbbfdb 100644
--- a/views/jobs/index_grid.ctp
+++ b/views/jobs/index_grid.ctp
@@ -1,20 +1,5 @@
+ echo $javascript->link('job_grid'); ?>
+
-
-
-
-
-
=$jsonObj?>
- create('Job', array('action' => 'save_jobs'));?>
-
- echo $form->input('newData', array('type'=>'hidden', 'value'=>'' ,'id'=>'newData')); ?>
- //
=$jsonObj; ?>
-
- end(); ?>
-
-
debug($jobs); ?>
\ No newline at end of file
+
\ No newline at end of file
diff --git a/views/jobs/index_table.ctp b/views/jobs/index_table.ctp
new file mode 100755
index 00000000..9f927c1e
--- /dev/null
+++ b/views/jobs/index_table.ctp
@@ -0,0 +1,295 @@
+link('jquery.jeditable.mini');
+//echo $javascript->link('jobindex_editinplace');
+//echo $javascript->link('addjob');
+//echo $javascript->link('job_index');
+
+?>
+
+
+
+
+
+ Edit Jobs
+
+
+
+ View Jobs
+
+
+
+ counter(array(
+ 'format' => __('Page %page% of %pages%, showing %current% Jobs out of %count% total, starting on record %start%, ending on %end%', true)
+ ));
+ ?>
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+
+
+
+
+
+
+ sort('created');?>
+ sort('Job Number');?>
+ sort('enquiry_id');?>
+ sort('Customer');?>
+ sort('customer_order_number');?>
+ sort('supplier_reference');?>
+
+
+ sort('date_order_received');?>
+ sort('date_order_placed_on_principle');?>
+ sort('date_scheduled_ex_works');?>
+ sort('date_order_sent_to_customer');?>
+
+ sort('domestic_freight_paid_by');?>
+ sort('sale_category');?>
+ sort('shipment_category');?>
+ sort('comments');?>
+
+ sort('company_gross_sales_aud');?>
+ sort('net_sales_aud');?>
+ sort('gross_profit_aud');?>
+ sort('ato_exchange_rate');?>
+ sort('gst');?>
+ sort('currency_id');?>
+ sort('gst_amount');?>
+ sort('gross_commisions');?>
+ sort('invoiced_amount_inc_gst');?>
+ sort('net_export_sales_aud');?>
+ sort('gross_profit_exports_aud');?>
+ sort('gp_percent');?>
+ sort('gross_australian_sales_foreign_currency');?>
+ sort('net_australian_sales_foreign_currency');?>
+ sort('gross_profit_value_australian_sales_foreign_currency');?>
+ sort('gross_export_sales_foreign_currency');?>
+ sort('net_export_sales_foreign_currency');?>
+ sort('gross_profit_value_after_discount_exports_foreign_currency');?>
+ sort('gross_commissions');?>
+ sort('net_commissions');?>
+
+
+
+
+
+
+
+
+
+
+ toUnix($job['Job']['created'])); ?>
+
+
+
+ link(__($job['Job']['title'], true), array('action' => 'view', $job['Job']['id'])); ?>
+
+
+ link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
+
+
+ link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers',
+ 'action'=>'view', $job['Enquiry']['customer_id'])); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
+ link(__('Edit', true), array('action' => 'edit', $job['Job']['id']), array('class'=>'editWindow', 'name'=>$job['Job']['id'])); ?>
+
+
+
+
+
+
+
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+
+
+
+
+
+
diff --git a/views/layouts/default.ctp b/views/layouts/default.ctp
index d4c5bae4..643518f6 100755
--- a/views/layouts/default.ctp
+++ b/views/layouts/default.ctp
@@ -21,16 +21,13 @@
echo $javascript->link('jquery-ui');
echo $javascript->link('jquery.form');
- echo $javascript->link('jquery.validate.min');
+ //echo $javascript->link('jquery.validate.min');
echo $javascript->link('menu');
echo $javascript->link('global');
echo $javascript->link('search');
-
+ echo $javascript->link('jquery.jeditable.mini');
echo $javascript->link('ckeditor/adapters/jquery');
-
-
-
echo $scripts_for_layout;
diff --git a/views/layouts/grid.ctp b/views/layouts/grid.ctp
deleted file mode 100644
index ce397d55..00000000
--- a/views/layouts/grid.ctp
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- echo $html->css('jquery-ui.custom.css');
- echo $html->css('slick.grid');
- echo $html->css('grid'); ?>
-
- echo $javascript->link('jquery');
- echo $javascript->link('jquery-ui');
- echo $javascript->link('jquery.json.min.js');
- echo $javascript->link('slickgrid/lib/jquery.event.drag-2.0.min');
- echo $javascript->link('slickgrid/lib/jquery.event.drop-2.0.min');
- echo $javascript->link('slickgrid/slick.core');
- echo $javascript->link('slickgrid/slick.grid');
- echo $javascript->link('slickgrid/slick.editors');
- echo $javascript->link('slickgrid/plugins/slick.cellrangeselector');
- echo $javascript->link('slickgrid/plugins/slick.cellrangedecorator');
- echo $javascript->link('slickgrid/plugins/slick.cellselectionmodel');
- echo $javascript->link('job_grid');
- echo $scripts_for_layout; ?>
-
-
-
- echo $content_for_layout; ?>
-
-
diff --git a/views/layouts/jqgrid.ctp b/views/layouts/jqgrid.ctp
new file mode 100644
index 00000000..a353cb5b
--- /dev/null
+++ b/views/layouts/jqgrid.ctp
@@ -0,0 +1,49 @@
+ /* Quotenik 1.2 - Default Layout. Some Markup from CakePHP Default */?>
+
+
+
+
+
+ charset(); ?>
+
+
+
+
+
+ css('quotenik');
+ echo $html->css('jquery-ui.custom.css');
+ echo $html->css('ui.jqgrid');
+
+ echo $javascript->link('ckeditor/ckeditor');
+
+ echo $javascript->link('jquery');
+
+ echo $javascript->link('jquery-ui');
+ echo $javascript->link('i18n/grid.locale-en.js');
+ echo $javascript->link('jquery.jqGrid.min.js');
+
+ //echo $javascript->link('jquery.form');
+ //echo $javascript->link('jquery.validate.min');
+ echo $javascript->link('menu');
+ echo $javascript->link('global');
+ echo $javascript->link('search');
+
+ //echo $javascript->link('jquery.jeditable.mini');
+ echo $javascript->link('ckeditor/adapters/jquery');
+
+
+ echo $scripts_for_layout;
+
+
+ ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css
index 3135733d..fed01706 100755
--- a/webroot/css/quotenik.css
+++ b/webroot/css/quotenik.css
@@ -1271,4 +1271,10 @@ span.addLineItem {
width: 100%;
height: 100%;
overflow: scroll;
+}
+
+
+#jobs_grid_iframe {
+ width: 100%;
+ height: 600px;
}
\ No newline at end of file
diff --git a/webroot/css/slick.grid.css b/webroot/css/slick.grid.css
deleted file mode 100644
index a97a07e5..00000000
--- a/webroot/css/slick.grid.css
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-IMPORTANT:
-In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes.
-No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS
-classes should alter those!
-*/
-
-
-.slick-header.ui-state-default, .slick-headerrow.ui-state-default {
- width: 100%;
- overflow: hidden;
- border-left: 0px;
-}
-
-.slick-header-columns, .slick-headerrow-columns {
- width: 999999px;
- position: relative;
- white-space: nowrap;
- cursor: default;
- overflow: hidden;
-}
-
-.slick-header-column.ui-state-default {
- position: relative;
- display: inline-block;
- overflow: hidden;
- text-overflow: ellipsis;
- height: 16px;
- line-height: 16px;
- margin: 0;
- padding: 4px;
- border-right: 1px solid silver;
- border-left: 0px;
- border-top: 0px;
- border-bottom: 0px;
- float: left;
-}
-
-.slick-headerrow-column.ui-state-default {
- padding: 4px;
-}
-
-.slick-header-column-sorted {
- font-style: italic;
-}
-
-.slick-sort-indicator {
- display: inline-block;
- width: 8px;
- height: 5px;
- margin-left: 4px;
-}
-
-.slick-sort-indicator-desc {
- background: url(images/sort-desc.gif);
-}
-
-.slick-sort-indicator-asc {
- background: url(images/sort-asc.gif);
-}
-
-.slick-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- display: block;
- cursor: col-resize;
- width: 4px;
- right: 0px;
- top: 0;
- height: 100%;
-}
-
-.slick-sortable-placeholder {
- background: silver;
-}
-
-.grid-canvas {
- position: relative;
- outline: 0;
-}
-
-.slick-row.ui-widget-content, .slick-row.ui-state-active {
- position: absolute;
- border: 0px;
-}
-
-.slick-cell, .slick-headerrow-column {
- float: left;
-
- border: 1px solid transparent;
- border-right: 1px dotted silver;
- border-bottom-color: silver;
-
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- vertical-align: middle;
- z-index: 1;
- padding: 1px 2px 2px 1px;
- margin: 0;
-
-
- white-space: nowrap;
-
- cursor: default;
-}
-
-.slick-group {
-}
-
-.slick-group-toggle {
- display: inline-block;
-}
-
-.slick-cell.highlighted {
- background: lightskyblue;
- background: rgba(0,0,255,0.2);
- -webkit-transition: all 0.5s;
- -moz-transition: all 0.5s;
- transition: all 0.5s;
-}
-
-.slick-cell.flashing {
- border: 1px solid red !important;
-}
-
-.slick-cell.editable {
- z-index: 11;
- overflow: visible;
- background: white;
- border-color: black;
- border-style: solid;
-}
-
-.slick-cell:focus {
- outline: none;
-}
-
-.slick-reorder-proxy {
- display: inline-block;
- background: blue;
- opacity: 0.15;
- filter: alpha(opacity=15);
- cursor: move;
-}
-
-.slick-reorder-guide {
- display: inline-block;
- height: 2px;
- background: blue;
- opacity: 0.7;
- filter: alpha(opacity=70);
-}
-
-.slick-selection {
- z-index: 10;
- position: absolute;
- border: 2px dashed black;
-}
\ No newline at end of file
diff --git a/webroot/css/ui.jqgrid.css b/webroot/css/ui.jqgrid.css
new file mode 100755
index 00000000..e6901890
--- /dev/null
+++ b/webroot/css/ui.jqgrid.css
@@ -0,0 +1,139 @@
+/*Grid*/
+.ui-jqgrid {position: relative; font-size:11px;}
+.ui-jqgrid .ui-jqgrid-view {position: relative;left:0px; top: 0px; padding: .0em;}
+/* caption*/
+.ui-jqgrid .ui-jqgrid-titlebar {padding: .3em .2em .2em .3em; position: relative; border-left: 0px none;border-right: 0px none; border-top: 0px none;}
+.ui-jqgrid .ui-jqgrid-title { float: left; margin: .1em 0 .2em; }
+.ui-jqgrid .ui-jqgrid-titlebar-close { position: absolute;top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height:18px;}.ui-jqgrid .ui-jqgrid-titlebar-close span { display: block; margin: 1px; }
+.ui-jqgrid .ui-jqgrid-titlebar-close:hover { padding: 0; }
+/* header*/
+.ui-jqgrid .ui-jqgrid-hdiv {position: relative; margin: 0em;padding: 0em; overflow-x: hidden; overflow-y: auto; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
+.ui-jqgrid .ui-jqgrid-hbox {float: left; padding-right: 20px;}
+.ui-jqgrid .ui-jqgrid-htable {table-layout:fixed;margin:0em;}
+.ui-jqgrid .ui-jqgrid-htable th {height:22px;padding: 0 2px 0 2px;}
+.ui-jqgrid .ui-jqgrid-htable th div {overflow: hidden; position:relative; height:17px;}
+.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0px none;border-bottom : 0px none;}
+.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {border-left : 0px none;}
+.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {border-right : 0px none;}
+.ui-jqgrid .ui-th-div-ie {white-space: nowrap; zoom :1; height:17px;}
+.ui-jqgrid .ui-jqgrid-resize {height:20px !important;position: relative; cursor :e-resize;display: inline;overflow: hidden;}
+.ui-jqgrid .ui-grid-ico-sort {overflow:hidden;position:absolute;display:inline; cursor: pointer !important;}
+.ui-jqgrid .ui-icon-asc {margin-top:-3px; height:12px;}
+.ui-jqgrid .ui-icon-desc {margin-top:3px;height:12px;}
+.ui-jqgrid .ui-i-asc {margin-top:0px;height:16px;}
+.ui-jqgrid .ui-i-desc {margin-top:0px;margin-left:13px;height:16px;}
+.ui-jqgrid .ui-jqgrid-sortable {cursor:pointer;}
+.ui-jqgrid tr.ui-search-toolbar th { border-top-width: 1px !important; border-top-color: inherit !important; border-top-style: ridge !important }
+tr.ui-search-toolbar input {margin: 1px 0px 0px 0px}
+tr.ui-search-toolbar select {margin: 1px 0px 0px 0px}
+/* body */
+.ui-jqgrid .ui-jqgrid-bdiv {position: relative; margin: 0em; padding:0; overflow: auto; text-align:left;}
+.ui-jqgrid .ui-jqgrid-btable {table-layout:fixed; margin:0em;}
+.ui-jqgrid tr.jqgrow td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.jqgfirstrow td {padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid;}
+.ui-jqgrid tr.jqgroup td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.jqfoot td {font-weight: bold; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.ui-row-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
+.ui-jqgrid tr.ui-row-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
+.ui-jqgrid td.jqgrid-rownum { padding: 0 2px 0 2px; margin: 0px; border: 0px none;}
+.ui-jqgrid .ui-jqgrid-resize-mark { width:2px; left:0; background-color:#777; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; display:none; border:0 none;}
+/* footer */
+.ui-jqgrid .ui-jqgrid-sdiv {position: relative; margin: 0em;padding: 0em; overflow: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
+.ui-jqgrid .ui-jqgrid-ftable {table-layout:fixed; margin-bottom:0em;}
+.ui-jqgrid tr.footrow td {font-weight: bold; overflow: hidden; white-space:nowrap; height: 21px;padding: 0 2px 0 2px;border-top-width: 1px; border-top-color: inherit; border-top-style: solid;}
+.ui-jqgrid tr.footrow-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
+.ui-jqgrid tr.footrow-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
+/* Pager*/
+.ui-jqgrid .ui-jqgrid-pager { border-left: 0px none !important;border-right: 0px none !important; border-bottom: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px;white-space: nowrap;overflow: hidden;}
+.ui-jqgrid .ui-pager-control {position: relative;}
+.ui-jqgrid .ui-pg-table {position: relative; padding-bottom:2px; width:auto; margin: 0em;}
+.ui-jqgrid .ui-pg-table td {font-weight:normal; vertical-align:middle; padding:1px;}
+.ui-jqgrid .ui-pg-button { height:19px !important;}
+.ui-jqgrid .ui-pg-button span { display: block; margin: 1px; float:left;}
+.ui-jqgrid .ui-pg-button:hover { padding: 0px; }
+.ui-jqgrid .ui-state-disabled:hover {padding:1px;}
+.ui-jqgrid .ui-pg-input { height:13px;font-size:.8em; margin: 0em;}
+.ui-jqgrid .ui-pg-selbox {font-size:.8em; line-height:18px; display:block; height:18px; margin: 0em;}
+.ui-jqgrid .ui-separator {height: 18px; border-left: 1px solid #ccc ; border-right: 1px solid #ccc ; margin: 1px; float: right;}
+.ui-jqgrid .ui-paging-info {font-weight: normal;height:19px; margin-top:3px;margin-right:4px;}
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-div {padding:1px 0;float:left;list-style-image:none;list-style-position:outside;list-style-type:none;position:relative;}
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-button { cursor:pointer; }
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
+.ui-jqgrid td input, .ui-jqgrid td select .ui-jqgrid td textarea { margin: 0em;}
+.ui-jqgrid td textarea {width:auto;height:auto;}
+.ui-jqgrid .ui-jqgrid-toppager {border-left: 0px none !important;border-right: 0px none !important; border-top: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px !important;white-space: nowrap;overflow: hidden;}
+/*subgrid*/
+.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {display: block;}
+.ui-jqgrid .ui-subgrid {margin:0em;padding:0em; width:100%;}
+.ui-jqgrid .ui-subgrid table {table-layout: fixed;}
+.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {height:18px;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid .ui-subgrid td.subgrid-data {border-top: 0px none !important;}
+.ui-jqgrid .ui-subgrid td.subgrid-cell {border-width: 0px 0px 1px 0px;}
+.ui-jqgrid .ui-th-subgrid {height:20px;}
+/* loading */
+.ui-jqgrid .loading {position: absolute; top: 45%;left: 45%;width: auto;z-index:101;padding: 6px; margin: 5px;text-align: center;font-weight: bold;display: none;border-width: 2px !important;}
+.ui-jqgrid .jqgrid-overlay {display:none;z-index:100;}
+* html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+* .jqgrid-overlay iframe {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+/* end loading div */
+/* toolbar */
+.ui-jqgrid .ui-userdata {border-left: 0px none; border-right: 0px none; height : 21px;overflow: hidden; }
+/*Modal Window */
+.ui-jqdialog { display: none; width: 300px; position: absolute; padding: .2em; font-size:11px; overflow:visible;}
+.ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative; }
+.ui-jqdialog .ui-jqdialog-title { margin: .1em 0 .2em; }
+.ui-jqdialog .ui-jqdialog-titlebar-close { position: absolute; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+
+.ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: 1px; }
+.ui-jqdialog .ui-jqdialog-titlebar-close:hover, .ui-jqdialog .ui-jqdialog-titlebar-close:focus { padding: 0; }
+.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { border: 0; padding: .3em .2em; background: none; height:auto;}
+.ui-jqdialog .ui-jqconfirm {padding: .4em 1em; border-width:3px;position:absolute;bottom:10px;right:10px;overflow:visible;display:none;height:80px;width:220px;text-align:center;}
+/* end Modal window*/
+/* Form edit */
+.ui-jqdialog-content .FormGrid {margin: 0px;}
+.ui-jqdialog-content .EditTable { width: 100%; margin-bottom:0em;}
+.ui-jqdialog-content .DelTable { width: 100%; margin-bottom:0em;}
+.EditTable td input, .EditTable td select, .EditTable td textarea {margin: 0em;}
+.EditTable td textarea { width:auto; height:auto;}
+.ui-jqdialog-content td.EditButton {text-align: right;border-top: 0px none;border-left: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
+.ui-jqdialog-content td.navButton {text-align: center; border-left: 0px none;border-top: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
+.ui-jqdialog-content input.FormElement {padding:.3em}
+.ui-jqdialog-content .data-line {padding-top:.1em;border: 0px none;}
+
+.ui-jqdialog-content .CaptionTD {text-align: left; vertical-align: middle;border: 0px none; padding: 2px;white-space: nowrap;}
+.ui-jqdialog-content .DataTD {padding: 2px; border: 0px none; vertical-align: top;}
+.ui-jqdialog-content .form-view-data {white-space:pre}
+.fm-button { display: inline-block; margin:0 4px 0 0; padding: .4em .5em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
+.fm-button-icon-left { padding-left: 1.9em; }
+.fm-button-icon-right { padding-right: 1.9em; }
+.fm-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px; }
+.fm-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px;}
+#nData, #pData { float: left; margin:3px;padding: 0; width: 15px; }
+/* End Eorm edit */
+/*.ui-jqgrid .edit-cell {}*/
+.ui-jqgrid .selected-row, div.ui-jqgrid .selected-row td {font-style : normal;border-left: 0px none;}
+/* Tree Grid */
+.ui-jqgrid .tree-wrap {float: left; position: relative;height: 18px;white-space: nowrap;overflow: hidden;}
+.ui-jqgrid .tree-minus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
+.ui-jqgrid .tree-plus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
+.ui-jqgrid .tree-leaf {position: absolute; height: 18px; width: 18px;overflow: hidden;}
+.ui-jqgrid .treeclick {cursor: pointer;}
+/* moda dialog */
+.jqmOverlay { background-color: #000; }
+* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+.ui-jqgrid-dnd tr td {border-right-width: 1px; border-right-color: inherit; border-right-style: solid; height:20px}
+/* RTL Support */
+.ui-jqgrid .ui-jqgrid-title-rtl {float:right;margin: .1em 0 .2em; }
+.ui-jqgrid .ui-jqgrid-hbox-rtl {float: right; padding-left: 20px;}
+.ui-jqgrid .ui-jqgrid-resize-ltr {float: right;margin: -2px -2px -2px 0px;}
+.ui-jqgrid .ui-jqgrid-resize-rtl {float: left;margin: -2px 0px -1px -3px;}
+.ui-jqgrid .ui-sort-rtl {left:0px;}
+.ui-jqgrid .tree-wrap-ltr {float: left;}
+.ui-jqgrid .tree-wrap-rtl {float: right;}
+.ui-jqgrid .ui-ellipsis {text-overflow:ellipsis; -moz-binding:url('ellipsis-xbl.xml#ellipsis');}
+.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
+.ui-searchFilter table {position:relative; margin:0em; width:auto}
+.ui-searchFilter table td {margin: 0em; padding: 1px;}
+.ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;}
+.ui-searchFilter .ui-state-default { cursor: pointer; }
+.ui-searchFilter .divider hr {margin: 1px; }
\ No newline at end of file
diff --git a/webroot/js/autocomplete-customer.js b/webroot/js/autocomplete-customer.js
index 6468c36f..bc24fdae 100755
--- a/webroot/js/autocomplete-customer.js
+++ b/webroot/js/autocomplete-customer.js
@@ -30,14 +30,14 @@ $(function() {
}
- }),
+ });
$("#CustomerCountryName").autocomplete({
source: "/countries/completeCountry",
minLength: 3,
select: function(event, ui) {
- //alert("You selected " + ui.item.value + " ID:"+ ui.item.id);
+ alert("You selected " + ui.item.value + " ID:"+ ui.item.id);
$("#CustomerCountryId").val(ui.item.id);
if(ui.item.value == 'Australia') {
@@ -48,7 +48,4 @@ $(function() {
}
}
});
-
-
-
});
\ No newline at end of file
diff --git a/webroot/js/i18n/grid.locale-en.js b/webroot/js/i18n/grid.locale-en.js
new file mode 100755
index 00000000..64dc885c
--- /dev/null
+++ b/webroot/js/i18n/grid.locale-en.js
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid English Translation
+ * Tony Tomov tony@trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = {
+ defaults : {
+ recordtext: "View {0} - {1} of {2}",
+ emptyrecords: "No records to view",
+ loadtext: "Loading...",
+ pgtext : "Page {0} of {1}"
+ },
+ search : {
+ caption: "Search...",
+ Find: "Find",
+ Reset: "Reset",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Add Record",
+ editCaption: "Edit Record",
+ bSubmit: "Submit",
+ bCancel: "Cancel",
+ bClose: "Close",
+ saveData: "Data has been changed! Save changes?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Field is required",
+ number:"Please, enter valid number",
+ minValue:"value must be greater than or equal to ",
+ maxValue:"value must be less than or equal to",
+ email: "is not a valid e-mail",
+ integer: "Please, enter valid integer value",
+ date: "Please, enter valid date value",
+ url: "is not a valid URL. Prefix required ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "View Record",
+ bClose: "Close"
+ },
+ del : {
+ caption: "Delete",
+ msg: "Delete selected record(s)?",
+ bSubmit: "Delete",
+ bCancel: "Cancel"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Edit selected row",
+ addtext:"",
+ addtitle: "Add new row",
+ deltext: "",
+ deltitle: "Delete selected row",
+ searchtext: "",
+ searchtitle: "Find records",
+ refreshtext: "",
+ refreshtitle: "Reload Grid",
+ alertcap: "Warning",
+ alerttext: "Please, select row",
+ viewtext: "",
+ viewtitle: "View selected row"
+ },
+ col : {
+ caption: "Select columns",
+ bSubmit: "Ok",
+ bCancel: "Cancel"
+ },
+ errors : {
+ errcap : "Error",
+ nourl : "No url is set",
+ norecords: "No records to process",
+ model : "Length of colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+};
+})(jQuery);
diff --git a/webroot/js/job_grid.js b/webroot/js/job_grid.js
new file mode 100644
index 00000000..e54f6bd3
--- /dev/null
+++ b/webroot/js/job_grid.js
@@ -0,0 +1,339 @@
+jQuery(document).ready(function(){
+
+
+
+ var lastsel; //used for Double Click Row Selection.
+ jQuery("#grid").jqGrid({
+ url:'/jobs/build_jobs_json/',
+ datatype: "json",
+ mtype: 'GET',
+ colNames:[
+ //'id',
+ 'created','Job Number','customer','Customer Ref','supplier_reference','date_order_received',
+ 'date_order_placed_on_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',
+ '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'
+ ],
+
+
+ jsonReader : {
+ root: "rows",
+ page: "page",
+ total: "total",
+ records: "records",
+ repeatitems: true,
+ cell: "cell",
+ id: "id"
+ },
+
+ colModel:[
+
+ /*{
+ name:'id',
+ index:'id',
+ width:200,
+ editable:false
+ },*/
+
+ {
+ name:'created',
+ index:'created',
+ width:100,
+ editable:false
+ },
+
+ {
+ name:'title',
+ index:'title',
+ width:100,
+ editable:false
+ },
+
+ {
+ name:'customer',
+ index:'customer',
+ width:400,
+ editable:false
+ },
+
+ {
+ name:'customer_order_number',
+ index:'customer_order_number',
+ width:100,
+ editable:true
+ },
+
+ {
+ name:'supplier_reference',
+ index:'supplier_reference',
+ width:100,
+ editable:true
+ },
+
+ {
+ name:'date_order_received',
+ index:'date_order_received',
+ width:200,
+ editable:true,
+ sorttype:"date"
+ },
+
+ {
+ name:'date_order_placed_on_principle',
+ index:'date_order_placed_on_principle',
+ width:200,
+ editable:true,
+ sorttype:"date"
+ },
+
+ {
+ name:'date_scheduled_ex_works',
+ index:'date_scheduled_ex_works',
+ width:200,
+ editable:true,
+ sorttype:"date"
+ },
+
+ {
+ name:'date_order_sent_to_customer',
+ index:'date_order_sent_to_customer',
+ width:200,
+ editable:true,
+ sorttype:"date"
+ },
+
+ {
+ name:'domestic_freight_paid_by',
+ index:'domestic_freight_paid_by',
+ width:200,
+ editable:true,
+ edittype:"select",
+ editoptions:{
+ value:"Customer:Customer;CMC:CMC"
+ }
+ },
+
+ {
+ name:'sale_category',
+ index:'sale_category',
+ width:50,
+ editable:true
+ },
+
+ {
+ name:'shipment_category',
+ index:'shipment_category',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'comments',
+ index:'comments',
+ width:200,
+ editable:true,
+ edittype:"textarea",
+ },
+
+ {
+ name:'company_gross_sales_aud',
+ index:'company_gross_sales_aud',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'net_sales_aud',
+ index:'net_sales_aud',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_profit_aud',
+ index:'gross_profit_aud',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'ato_exchange_rate',
+ index:'ato_exchange_rate',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gst',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'currency_id',
+ index:'currency_id',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gst_amount',
+ index:'gst_amount',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_commisions',
+ index:'gross_commisions',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'invoiced_amount_inc_gst',
+ index:'invoiced_amount_inc_gst',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'net_export_sales_aud',
+ index:'net_export_sales_aud',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_profit_exports_aud',
+ index:'gross_profit_exports_aud',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gp_percent',
+ index:'gp_percent',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_australian_sales_foreign_currency',
+ index:'gross_australian_sales_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'net_australian_sales_foreign_currency',
+ index:'net_australian_sales_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_profit_value_australian_sales_foreign_currency',
+ index:'gross_profit_value_australian_sales_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_export_sales_foreign_currency',
+ index:'gross_export_sales_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'net_export_sales_foreign_currency',
+ index:'net_export_sales_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_profit_value_after_discount_exports_foreign_currency',
+ index:'gross_profit_value_after_discount_exports_foreign_currency',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'gross_commissions',
+ index:'gross_commissions',
+ width:200,
+ editable:true
+ },
+
+ {
+ name:'net_commissions',
+ index:'net_commissions',
+ width:200,
+ editable:true
+ },
+
+
+ ],
+
+ // viewrecords: true,
+ sortname: 'id',
+ sortorder: "asc",
+ rowNum: 50,
+ height: '100%',
+ caption:"Jobs",
+ editurl:"/jobs/ajax_edit",
+
+
+ onSelectRow: function(rowid){
+
+
+ if(typeof(lastsel) != undefined) {
+ if(rowid && rowid!==lastsel){
+ $(this).jqGrid('saveRow',lastsel);
+ $(this).jqGrid('editRow', rowid, true, pickdates);
+ }
+
+ }
+ lastsel = rowid;
+
+ }
+ });
+
+
+ $("#editButton").click(function(){
+ var gr = jQuery("#grid").jqGrid('getGridParam','selrow');
+
+ if(gr != null) {
+ jQuery("#grid").jqGrid('editRow', gr, true, pickdates);
+ }
+ });
+
+
+
+
+
+ function pickdates(id){
+ jQuery("#"+id+"_date_order_received","#grid").datepicker({
+ dateFormat:"yy-mm-dd"
+ });
+
+ jQuery("#"+id+"_date_order_placed_on_principle","#grid").datepicker({
+ dateFormat:"yy-mm-dd"
+ });
+
+ jQuery("#"+id+"_date_scheduled_ex_works","#grid").datepicker({
+ dateFormat:"yy-mm-dd"
+ });
+
+ jQuery("#"+id+"_date_order_sent_to_customer","#grid").datepicker({
+ dateFormat:"yy-mm-dd"
+ });
+ }
+
+
+});
\ No newline at end of file
diff --git a/webroot/js/job_index.js b/webroot/js/job_index.js
new file mode 100644
index 00000000..8070cdab
--- /dev/null
+++ b/webroot/js/job_index.js
@@ -0,0 +1,5 @@
+$(function() {
+ $.get('/jobs/index_grid', function(data) {
+ $("#jobsIndex").html(data);
+ });
+});
\ No newline at end of file
diff --git a/webroot/js/jquery.jqGrid.min.js b/webroot/js/jquery.jqGrid.min.js
new file mode 100755
index 00000000..54e50d53
--- /dev/null
+++ b/webroot/js/jquery.jqGrid.min.js
@@ -0,0 +1,436 @@
+/*
+* jqGrid 3.8.2 - jQuery Grid
+* Copyright (c) 2008, Tony Tomov, tony@trirand.com
+* Dual licensed under the MIT and GPL licenses
+* http://www.opensource.org/licenses/mit-license.php
+* http://www.gnu.org/licenses/gpl-2.0.html
+* Date:2010-12-14
+* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; grid.subgrid.js; grid.grouping.js; grid.import.js; JsonXml.js; grid.setcolumns.js; grid.postext.js; grid.tbltogrid.js; grid.jqueryui.js;
+*/
+(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{htmlDecode:function(f){if(f==" "||f==" "||f.length==1&&f.charCodeAt(0)==160)return"";return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"')},htmlEncode:function(f){return!f?f:String(f).replace(/&/g,"&").replace(/>/g,">").replace(/])*>/gi;if(f)return(f=f.replace(j,""))&&f!==" "&&f!==" "?f.replace(/\"/g,"'"):"";else return f},stringToDoc:function(f){var j;if(typeof f!=="string")return f;try{j=(new DOMParser).parseFromString(f,"text/xml")}catch(i){j=new ActiveXObject("Microsoft.XMLDOM");
+j.async=false;j.loadXML(f)}return j&&j.documentElement&&j.documentElement.tagName!="parsererror"?j:null},parse:function(f){f=f;if(f.substr(0,9)=="while(1);")f=f.substr(9);if(f.substr(0,2)=="/*")f=f.substr(2,f.length-4);f||(f="{}");return b.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(f):eval("("+f+")")},parseDate:function(f,j){var i={m:1,d:1,y:1970,h:0,i:0,s:0},c,e,k;if(j&&j!==null&&j!==undefined){j=b.trim(j);j=j.split(/[\\\/:_;.\t\T\s-]/);f=f.split(/[\\\/:_;.\t\T\s-]/);
+var n=b.jgrid.formatter.date.monthNames,a=b.jgrid.formatter.date.AmPm,r=function(t,B){if(t===0){if(B==12)B=0}else if(B!=12)B+=12;return B};c=0;for(e=f.length;c
11)j[c]=k+1-12}if(f[c]=="a"){k=b.inArray(j[c],a);if(k!==-1&&k<2&&j[c]==a[k]){j[c]=k;i.h=r(j[c],i.h)}}if(f[c]=="A"){k=b.inArray(j[c],a);if(k!==-1&&k>1&&j[c]==a[k]){j[c]=k-2;i.h=r(j[c],i.h)}}if(j[c]!==undefined)i[f[c].toLowerCase()]=
+parseInt(j[c],10)}i.m=parseInt(i.m,10)-1;f=i.y;if(f>=70&&f<=99)i.y=1900+i.y;else if(f>=0&&f<=69)i.y=2E3+i.y}return new Date(i.y,i.m,i.d,i.h,i.i,i.s,0)},jqID:function(f){f+="";return f.replace(/([\.\:\[\]])/g,"\\$1")},getAccessor:function(f,j){var i,c,e,k;if(typeof j==="function")return j(f);i=f[j];if(i===undefined)try{if(typeof j==="string")e=j.split(".");if(k=e.length)for(i=f;i&&k--;){c=e.shift();i=i[c]}}catch(n){}return i},ajaxOptions:{},from:function(f){return new (function(j,i){if(typeof j=="string")j=
+b.data(j);var c=this,e=j,k=true,n=false,a=i,r=/[\$,%]/g,t=null,B=null,F=false,S="",J=[],N=true;if(typeof j=="object"&&j.push){if(j.length>0)N=typeof j[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return e===null?false:e.length===0?false:true};this._getStr=function(l){var m=[];n&&m.push("jQuery.trim(");m.push("String("+l+")");n&&m.push(")");k||m.push(".toLowerCase()");return m.join("")};this._strComp=function(l){return typeof l=="string"?".toString()":
+""};this._group=function(l,m){return{field:l.toString(),unique:m,items:[]}};this._toStr=function(l){if(n)l=b.trim(l);k||(l=l.toLowerCase());return l=l.toString().replace(new RegExp('\\"',"g"),'\\"')};this._funcLoop=function(l){var m=[];b.each(e,function(q,A){m.push(l(A))});return m};this._append=function(l){if(a===null)a="";else a+=S===""?" && ":S;if(F)a+="!";a+="("+l+")";F=false;S=""};this._setCommand=function(l,m){t=l;B=m};this._resetNegate=function(){F=false};this._repeatCommand=function(l,m){if(t===
+null)return c;if(l!=null&&m!=null)return t(l,m);if(B===null)return t(l);if(!N)return t(l);return t(B,l)};this._equals=function(l,m){return c._compare(l,m,1)===0};this._compare=function(l,m,q){if(q===undefined)q=1;if(l===undefined)l=null;if(m===undefined)m=null;if(l===null&&m===null)return 0;if(l===null&&m!==null)return 1;if(l!==null&&m===null)return-1;if(!k&&typeof l!=="number"&&typeof m!=="number"){l=String(l).toLowerCase();m=String(m).toLowerCase()}if(lm)return q;return 0};this._performSort=
+function(){if(J.length!==0)e=c._doSort(e,0)};this._doSort=function(l,m){var q=J[m].by,A=J[m].dir,u=J[m].type,I=J[m].datefmt;if(m==J.length-1)return c._getOrder(l,q,A,u,I);m++;l=c._getGroup(l,q,A,u,I);q=[];for(A=0;A0};this.showQuery=function(l){var m=a;if(m===null)m=
+"no query found";if(b.isFunction(l)){l(m);return c}return m};this.andNot=function(l,m,q){F=!F;return c.and(l,m,q)};this.orNot=function(l,m,q){F=!F;return c.or(l,m,q)};this.not=function(l,m,q){return c.andNot(l,m,q)};this.and=function(l,m,q){S=" && ";if(l===undefined)return c;return c._repeatCommand(l,m,q)};this.or=function(l,m,q){S=" || ";if(l===undefined)return c;return c._repeatCommand(l,m,q)};this.isNot=function(l){F=!F;return c.is(l)};this.is=function(l){c._append("this."+l);c._resetNegate();
+return c};this._compareValues=function(l,m,q,A,u){var I;I=N?"this."+m:"this";if(q===undefined)q=null;q=q===null?m:q;switch(u.stype===undefined?"text":u.stype){case "int":case "integer":q=isNaN(Number(q))?"0":q;I="parseInt("+I+",10)";q="parseInt("+q+",10)";break;case "float":case "number":case "numeric":q=String(q).replace(r,"");q=isNaN(Number(q))?"0":q;I="parseFloat("+I+")";q="parseFloat("+q+")";break;case "date":case "datetime":q=String(b.jgrid.parseDate(u.newfmt||"Y-m-d",q).getTime());I='jQuery.jgrid.parseDate("'+
+u.srcfmt+'",'+I+").getTime()";break;default:I=c._getStr(I);q=c._getStr('"'+c._toStr(q)+'"')}c._append(I+" "+A+" "+q);c._setCommand(l,m);c._resetNegate();return c};this.equals=function(l,m,q){return c._compareValues(c.equals,l,m,"==",q)};this.greater=function(l,m,q){return c._compareValues(c.greater,l,m,">",q)};this.less=function(l,m,q){return c._compareValues(c.less,l,m,"<",q)};this.greaterOrEquals=function(l,m,q){return c._compareValues(c.greaterOrEquals,l,m,">=",q)};this.lessOrEquals=function(l,
+m,q){return c._compareValues(c.lessOrEquals,l,m,"<=",q)};this.startsWith=function(l,m){var q=m===undefined||m===null?l:m;q=n?b.trim(q.toString()).length:q.toString().length;if(N)c._append(c._getStr("this."+l)+".substr(0,"+q+") == "+c._getStr('"'+c._toStr(m)+'"'));else{q=n?b.trim(m.toString()).length:m.toString().length;c._append(c._getStr("this")+".substr(0,"+q+") == "+c._getStr('"'+c._toStr(l)+'"'))}c._setCommand(c.startsWith,l);c._resetNegate();return c};this.endsWith=function(l,m){var q=m===undefined||
+m===null?l:m;q=n?b.trim(q.toString()).length:q.toString().length;N?c._append(c._getStr("this."+l)+".substr("+c._getStr("this."+l)+".length-"+q+","+q+') == "'+c._toStr(m)+'"'):c._append(c._getStr("this")+".substr("+c._getStr("this")+'.length-"'+c._toStr(l)+'".length,"'+c._toStr(l)+'".length) == "'+c._toStr(l)+'"');c._setCommand(c.endsWith,l);c._resetNegate();return c};this.contains=function(l,m){N?c._append(c._getStr("this."+l)+'.indexOf("'+c._toStr(m)+'",0) > -1'):c._append(c._getStr("this")+'.indexOf("'+
+c._toStr(l)+'",0) > -1');c._setCommand(c.contains,l);c._resetNegate();return c};this.groupBy=function(l,m,q,A){if(!c._hasData())return null;return c._getGroup(e,l,m,q,A)};this.orderBy=function(l,m,q,A){m=m===undefined||m===null?"a":b.trim(m.toString().toLowerCase());if(q===null||q===undefined)q="text";if(A===null||A===undefined)A="Y-m-d";if(m=="desc"||m=="descending")m="d";if(m=="asc"||m=="ascending")m="a";J.push({by:l,dir:m,type:q,datefmt:A});return c};return c})(f,null)},extend:function(f){b.extend(b.fn.jqGrid,
+f);this.no_legacy_api||b.fn.extend(f)}});b.fn.jqGrid=function(f){if(typeof f=="string"){var j=b.jgrid.getAccessor(b.fn.jqGrid,f);if(!j)throw"jqGrid - No such method: "+f;var i=b.makeArray(arguments).slice(1);return j.apply(this,i)}return this.each(function(){if(!this.grid){var c=b.extend(true,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:false,selarrrow:[],
+savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,caption:"",hidegrid:true,
+hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,
+scrollrows:false,autowidth:false,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[],
+groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[],sortnames:[],groupDataSorted:false,summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus"},ignoreCase:false,cmTemplate:{}},b.jgrid.defaults,f||{}),e={headers:[],cols:[],footers:[],dragStart:function(d,g,h){this.resizing={idx:d,startX:g.clientX,sOL:h[0]};this.hDiv.style.cursor="col-resize";this.curGbox=b("#rs_m"+c.id,"#gbox_"+c.id);this.curGbox.css({display:"block",left:h[0],
+top:h[1],height:h[2]});b.isFunction(c.resizeStart)&&c.resizeStart.call(this,g,d);document.onselectstart=function(){return false}},dragMove:function(d){if(this.resizing){var g=d.clientX-this.resizing.startX;d=this.headers[this.resizing.idx];var h=c.direction==="ltr"?d.width+g:d.width-g,o;if(h>33){this.curGbox.css({left:this.resizing.sOL+g});if(c.forceFit===true){o=this.headers[this.resizing.idx+c.nv];g=c.direction==="ltr"?o.width-g:o.width+g;if(g>33){d.newWidth=h;o.newWidth=g}}else{this.newWidth=c.direction===
+"ltr"?c.tblwidth+g:c.tblwidth-g;d.newWidth=h}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var d=this.resizing.idx,g=this.headers[d].newWidth||this.headers[d].width;g=parseInt(g,10);this.resizing=false;b("#rs_m"+c.id).css("display","none");c.colModel[d].width=g;this.headers[d].width=g;this.headers[d].el.style.width=g+"px";this.cols[d].style.width=g+"px";if(this.footers.length>0)this.footers[d].style.width=g+"px";if(c.forceFit===true){g=this.headers[d+c.nv].newWidth||this.headers[d+
+c.nv].width;this.headers[d+c.nv].width=g;this.headers[d+c.nv].el.style.width=g+"px";this.cols[d+c.nv].style.width=g+"px";if(this.footers.length>0)this.footers[d+c.nv].style.width=g+"px";c.colModel[d+c.nv].width=g}else{c.tblwidth=this.newWidth||c.tblwidth;b("table:first",this.bDiv).css("width",c.tblwidth+"px");b("table:first",this.hDiv).css("width",c.tblwidth+"px");this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(c.footerrow){b("table:first",this.sDiv).css("width",c.tblwidth+"px");this.sDiv.scrollLeft=
+this.bDiv.scrollLeft}}b.isFunction(c.resizeStop)&&c.resizeStop.call(this,g,d)}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){e.timer&&clearTimeout(e.timer);e.timer=null;var d=b(e.bDiv).height();if(d){var g=b("table:first",e.bDiv),h=b("> tbody > tr:gt(0):visible:first",g).outerHeight()||e.prevRowHeight;if(h){e.prevRowHeight=h;var o=c.rowNum,p=e.scrollTop=e.bDiv.scrollTop,x=Math.round(g.position().top)-p,w=x+g.height();h=h*o;var C,G,s;if(w=0||G<2||c.scroll===true){C=Math.round((w+p)/h)+1;x=-1}else x=1}if(x>0){C=parseInt(p/h,10)+1;G=parseInt((p+d)/h,10)+2-C;s=true}if(G)if(!(c.lastpage&&C>c.lastpage||c.lastpage==1))if(e.hDiv.loading)e.timer=setTimeout(e.populateVisible,c.scrollTimeout);else{c.page=C;if(s){e.selectionPreserver(g[0]);e.emptyRows(e.bDiv,false)}e.populate(G)}}}},scrollGrid:function(){if(c.scroll){var d=e.bDiv.scrollTop;if(e.scrollTop===undefined)e.scrollTop=
+0;if(d!=e.scrollTop){e.scrollTop=d;e.timer&&clearTimeout(e.timer);e.timer=setTimeout(e.populateVisible,c.scrollTimeout)}}e.hDiv.scrollLeft=e.bDiv.scrollLeft;if(c.footerrow)e.sDiv.scrollLeft=e.bDiv.scrollLeft},selectionPreserver:function(d){var g=d.p,h=g.selrow,o=g.selarrrow?b.makeArray(g.selarrrow):null,p=d.grid.bDiv.scrollLeft,x=g.gridComplete;g.gridComplete=function(){g.selrow=null;g.selarrrow=[];if(g.multiselect&&o&&o.length>0)for(var w=0;w "),B,F=b.browser.msie?true:false,
+S=b.browser.safari?true:false;a=this;a.p.direction=b.trim(a.p.direction.toLowerCase());if(b.inArray(a.p.direction,["ltr","rtl"])==-1)a.p.direction="ltr";n=a.p.direction;b(t).insertBefore(this);b(this).appendTo(t).removeClass("scroll");var J=b("