Added POs to job list
This commit is contained in:
parent
b6c251d479
commit
5253da4afd
|
|
@ -15,10 +15,10 @@ class JobsController extends AppController {
|
||||||
);
|
);
|
||||||
|
|
||||||
function index() {
|
function index() {
|
||||||
/* $this->Job->recursive = 1;
|
$this->Job->recursive = 1;
|
||||||
$this->set('jobs', $this->paginate());
|
$this->set('jobs', $this->paginate());
|
||||||
$this->set('customers', $this->Job->Enquiry->Customer->find('list'));
|
$this->set('customers', $this->Job->Enquiry->Customer->find('list'));
|
||||||
$this->set('currencies', $this->Job->Currency->find('list'));*/
|
$this->set('currencies', $this->Job->Currency->find('list'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,61 +25,70 @@ $i=0;
|
||||||
foreach($jobs as $job) {
|
foreach($jobs as $job) {
|
||||||
|
|
||||||
|
|
||||||
$cellArray = array(
|
$poString = '';
|
||||||
|
foreach($job['PurchaseOrder'] as $po) {
|
||||||
|
$poString .= ' '.$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));
|
||||||
|
}
|
||||||
|
|
||||||
// $job['Job']['id'],
|
|
||||||
|
|
||||||
$job['Job']['job_status'],
|
$cellArray = array(
|
||||||
$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']['date_order_received'],
|
|
||||||
|
|
||||||
$job['Job']['supplier_reference'],
|
// $job['Job']['id'],
|
||||||
$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']['job_status'],
|
||||||
$job['Job']['company_gross_sales_aud'],
|
$job['Job']['sale_category'],
|
||||||
$job['Job']['net_sales_aud'],
|
$job['Job']['shipment_category'],
|
||||||
$job['Job']['gross_profit_aud'],
|
$html->link($job['Job']['title'], array('controller'=>'jobs','action'=>'view', $job['Job']['id'])),
|
||||||
$job['Job']['ato_exchange_rate'],
|
$poString,
|
||||||
$job['Job']['gst'],
|
|
||||||
$job['Job']['currency_id'],
|
|
||||||
$job['Job']['gst_amount'],
|
$html->link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers','action'=>'view', $job['Enquiry']['customer_id'])),
|
||||||
$job['Job']['gross_commisions'],
|
$job['Job']['comments'],
|
||||||
$job['Job']['invoiced_amount_inc_gst'],
|
$job['Job']['customer_order_number'],
|
||||||
$job['Job']['net_export_sales_aud'],
|
$job['Job']['date_order_received'],
|
||||||
$job['Job']['gross_profit_exports_aud'],
|
|
||||||
$job['Job']['gp_percent'],
|
$job['Job']['supplier_reference'],
|
||||||
$job['Job']['gross_australian_sales_foreign_currency'],
|
$job['Job']['date_order_placed_on_principle'],
|
||||||
$job['Job']['net_australian_sales_foreign_currency'],
|
|
||||||
$job['Job']['gross_profit_value_australian_sales_foreign_currency'],
|
$job['Job']['date_scheduled_ex_works'],
|
||||||
$job['Job']['gross_export_sales_foreign_currency'],
|
$job['Job']['date_order_sent_to_customer'],
|
||||||
$job['Job']['net_export_sales_foreign_currency'],
|
$job['Job']['domestic_freight_paid_by'],
|
||||||
$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'],
|
|
||||||
$job['Job']['gross_commissions'],
|
|
||||||
$job['Job']['net_commissions']
|
$job['Job']['company_gross_sales_aud'],
|
||||||
);
|
$job['Job']['net_sales_aud'],
|
||||||
|
$job['Job']['gross_profit_aud'],
|
||||||
|
$job['Job']['ato_exchange_rate'],
|
||||||
|
$job['Job']['gst'],
|
||||||
|
$job['Job']['currency_id'],
|
||||||
|
$job['Job']['gst_amount'],
|
||||||
|
$job['Job']['gross_commisions'],
|
||||||
|
$job['Job']['invoiced_amount_inc_gst'],
|
||||||
|
$job['Job']['net_export_sales_aud'],
|
||||||
|
$job['Job']['gross_profit_exports_aud'],
|
||||||
|
$job['Job']['gp_percent'],
|
||||||
|
$job['Job']['gross_australian_sales_foreign_currency'],
|
||||||
|
$job['Job']['net_australian_sales_foreign_currency'],
|
||||||
|
$job['Job']['gross_profit_value_australian_sales_foreign_currency'],
|
||||||
|
$job['Job']['gross_export_sales_foreign_currency'],
|
||||||
|
$job['Job']['net_export_sales_foreign_currency'],
|
||||||
|
$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'],
|
||||||
|
$job['Job']['gross_commissions'],
|
||||||
|
$job['Job']['net_commissions']
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$recordObj->rows[$i]['id'] = $job['Job']['id'];
|
$recordObj->rows[$i]['id'] = $job['Job']['id'];
|
||||||
//$rows[$i] = $job;
|
//$rows[$i] = $job;
|
||||||
$recordObj->rows[$i]['cell'] = $cellArray;
|
$recordObj->rows[$i]['cell'] = $cellArray;
|
||||||
//$recordObj->rows[$i]['cell'] = $job['Job'];
|
//$recordObj->rows[$i]['cell'] = $job['Job'];
|
||||||
$i++;
|
$i++;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$jsonObj = json_encode($recordObj);
|
$jsonObj = json_encode($recordObj);
|
||||||
echo $jsonObj;
|
echo $jsonObj;
|
||||||
?>
|
?>
|
||||||
|
|
@ -22,5 +22,5 @@ echo $javascript->link('job_index');
|
||||||
<div id="editDiv">
|
<div id="editDiv">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<? //debug($jobs);
|
<? debug($jobs);
|
||||||
?>
|
?>
|
||||||
|
|
@ -36,7 +36,7 @@ jQuery(document).ready(function(){
|
||||||
mtype: 'GET',
|
mtype: 'GET',
|
||||||
colNames:[
|
colNames:[
|
||||||
//'id',
|
//'id',
|
||||||
'Status', 'Sale Cat.','Shipment Cat.','Job Number','Customer','Description','Customer O/N','Order Received','Supplier Ref',
|
'Status', 'Sale Cat.','Shipment Cat.','Job Number','CMC POs', 'Customer','Description','Customer O/N','Order Received','Supplier Ref',
|
||||||
'Order Placed Principle','date_scheduled_ex_works','date_order_sent_to_customer','Freight Paid By',
|
'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',
|
'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',
|
'gst','Sale Currency','gst_amount','gross_commisions','invoiced_amount_inc_gst','net_export_sales_aud',
|
||||||
|
|
@ -107,6 +107,13 @@ jQuery(document).ready(function(){
|
||||||
editable:false
|
editable:false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name:'purchase_orders',
|
||||||
|
index:'purchase_orders',
|
||||||
|
width:100,
|
||||||
|
editable:false
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name:'customer',
|
name:'customer',
|
||||||
index:'customer',
|
index:'customer',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue