Fucking Book fucking 1 mostly fucking finished. Still got to the colors and the formula. FUCK
This commit is contained in:
parent
be49771830
commit
07dcd14dac
|
|
@ -34,13 +34,14 @@ class JobsController extends AppController {
|
||||||
$this->layout = 'ajax';
|
$this->layout = 'ajax';
|
||||||
$this->set('job', $this->Job->find('first', array('conditions'=>array('Job.id'=>$id))));
|
$this->set('job', $this->Job->find('first', array('conditions'=>array('Job.id'=>$id))));
|
||||||
|
|
||||||
|
$this->set('currencies', $this->Job->Currency->find('list'));
|
||||||
$this->set('sale_category_options', $this->sale_category_options());
|
$this->set('sale_category_options', $this->sale_category_options());
|
||||||
$this->set('sale_category_array', $this->sale_category_array());
|
$this->set('sale_category_array', $this->sale_category_array());
|
||||||
$this->set('job_type_options', $this->job_type_options());
|
$this->set('job_type_options', $this->job_type_options());
|
||||||
$this->set('shipment_options', $this->shipment_options());
|
$this->set('shipment_options', $this->shipment_options());
|
||||||
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
||||||
$this->set('gst_options', $this->gst_options());
|
$this->set('gst_options', $this->gst_options());
|
||||||
|
$this->set('job_status_options', $this->job_status_options());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,11 +57,26 @@ class JobsController extends AppController {
|
||||||
$this->set('shipment_options', $this->shipment_options());
|
$this->set('shipment_options', $this->shipment_options());
|
||||||
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
||||||
$this->set('gst_options', $this->gst_options());
|
$this->set('gst_options', $this->gst_options());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function job_status_options() {
|
||||||
|
$options = array('ORDER RECEIVED FROM CUSTOMER',
|
||||||
|
'ORDER PLACED ON PRINCIPLE - WAITING ON DELIVERY',
|
||||||
|
'GOODS SHIPPED TO CUSTOMER - CMC WAITING ON PAYMENT',
|
||||||
|
'WAITING ON PAYMENT AND ANOTHER DELIVERY',
|
||||||
|
'GOODS DELIVERED TO CUSTOMER - CMC PAID IN FULL',
|
||||||
|
'PAID IN FULL WAITING ON DELIVERY',
|
||||||
|
'JOB CANCELLED',
|
||||||
|
'JOB ON HOLD',
|
||||||
|
'CUSTOMER TO PAY 100% WITH ORDER');
|
||||||
|
$options = $this->buildEnumOpts($options);
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For the 'sale_category' column.
|
* For the 'sale_category' column.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($date == "0000-00-00") {
|
if($date == "0000-00-00") {
|
||||||
echo "-";
|
echo "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo date("j M Y", strtotime($date));
|
echo date("j M Y", strtotime($date));
|
||||||
|
|
|
||||||
|
|
@ -1,89 +1,161 @@
|
||||||
|
|
||||||
<tr id="<?=$job['Job']['id']?>">
|
<tr id="<?=$job['Job']['id']?>">
|
||||||
<? echo $form->create('Job', array('action'=>'ajax_edit', 'id'=>'form_'.$job['Job']['id'], 'class'=>'job_table_form')); ?>
|
|
||||||
<?=$form->input('id', array('type'=>'hidden', 'value'=>$job['Job']['id'])); ?>
|
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
|
||||||
<td><?=$job['Job']['date_order_received'];?></td>
|
|
||||||
<td><?=$job['Job']['job_status'];?></td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'label'=>false, 'selected'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?></td>
|
|
||||||
<td><?=$form->input('shipment_category', array('options'=>$shipment_options, 'label'=>false,'selected'=>$job['Job']['shipment_category']));?></td>
|
|
||||||
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
|
|
||||||
<td><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
|
|
||||||
<td><?
|
|
||||||
$poString = '';
|
|
||||||
foreach($job['PurchaseOrder'] as $po) {
|
|
||||||
$poString .= ' '.$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));
|
|
||||||
}
|
|
||||||
echo $poString;
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('customer_order_number', array('value'=>$job['Job']['customer_order_number'], 'label'=>false ,'div'=>false));?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
<script type="text/javascript">
|
||||||
<?=$form->input('supplier_reference', array('value'=>$job['Job']['supplier_reference'], 'label'=>false ,'div'=>false));?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
$(function() {
|
||||||
<?=$form->input('date_scheduled_ex_works', array('value'=>$job['Job']['date_scheduled_ex_works'], 'label'=>false ,'div'=>false));?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('date_order_sent_to_customer', array('value'=>$job['Job']['date_order_sent_to_customer'], 'label'=>false ,'div'=>false));?>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td> <?=$form->input('domestic_freight_paid_by', array('value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('currency_id', array('value'=>$job['Currency']['name'], 'label'=>false ,'div'=>false));?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?=$form->input('company_gross_sales_aud', array('value'=>$job['Job']['company_gross_sales_aud'], 'label'=>false ,'div'=>false));?>
|
|
||||||
|
|
||||||
</td>
|
$('#<?=$job['Job']['id']?>_date_order_received_display').datepicker({
|
||||||
<td>
|
showButtonPanel: true,
|
||||||
<?=$form->input('net_sales_aud', array('value'=>$job['Job']['net_sales_aud'], 'label'=>false ,'div'=>false));?>
|
dateFormat: 'd M yy',
|
||||||
</td>
|
altFormat: 'yy-mm-dd',
|
||||||
<td> <?=$form->input('gross_profit_aud', array('value'=>$job['Job']['gross_profit_aud'], 'label'=>false ,'div'=>false));?>
|
altField: '#<?=$job['Job']['id']?>_date_order_received'
|
||||||
</td>
|
|
||||||
<td>
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#<?=$job['Job']['id']?>_date_order_placed_on_principle_display').datepicker({
|
||||||
|
showButtonPanel: true,
|
||||||
|
dateFormat: 'd M yy',
|
||||||
|
altFormat: 'yy-mm-dd',
|
||||||
|
altField: '#<?=$job['Job']['id']?>_date_order_placed_on_principle'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#<?=$job['Job']['id']?>_date_scheduled_ex_works_display').datepicker({
|
||||||
|
showButtonPanel: true,
|
||||||
|
dateFormat: 'd M yy',
|
||||||
|
altFormat: 'yy-mm-dd',
|
||||||
|
altField: '#<?=$job['Job']['id']?>_date_scheduled_ex_works'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#<?=$job['Job']['id']?>_date_order_sent_to_customer_display').datepicker({
|
||||||
|
showButtonPanel: true,
|
||||||
|
dateFormat: 'd M yy',
|
||||||
|
altFormat: 'yy-mm-dd',
|
||||||
|
altField: '#<?=$job['Job']['id']?>_date_order_sent_to_customer'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
//format the mySQL date in the nice readable format.
|
||||||
|
/*if($job['date_order_received'] != '0000-00-00') {
|
||||||
|
$order_received_time = strtotime($job['Job']['date_order_received']);
|
||||||
|
$order_received_readable = date('j M Y', $order_received_time );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$order_received_readable = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if($job['date_order_sent_to_customer'] != '0000-00-00') {
|
||||||
|
$order_sent_to_customer_time = strtotime($job['Job']['date_order_sent_to_customer']);
|
||||||
|
$order_sent_readable = date('j M Y', $order_sent_to_customer_time);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$order_sent_readable = "";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?=$form->input('id', array('type'=>'hidden', 'value'=>$job['Job']['id'])); ?>
|
||||||
|
<td><button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||||
|
<td><?=$form->input('date_order_received_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_received_display'));?>
|
||||||
|
<?=$form->input('date_order_received', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_received', 'value'=>$job['Job']['date_order_received']));?>
|
||||||
|
</td>
|
||||||
|
<td><?=$form->input('job_status', array('type'=>'select', 'options'=>$job_status_options, 'value'=>$job['Job']['job_status'], 'label'=>false, 'div'=>false));?></td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'type'=>'select', 'label'=>false, 'value'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?></td>
|
||||||
|
<td><?=$form->input('shipment_category', array('options'=>$shipment_options, 'label'=>false,'selected'=>$job['Job']['shipment_category']));?></td>
|
||||||
|
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
|
||||||
|
<td><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
|
||||||
|
<td><?
|
||||||
|
$poString = '';
|
||||||
|
foreach($job['PurchaseOrder'] as $po) {
|
||||||
|
$poString .= ' '.$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));
|
||||||
|
}
|
||||||
|
echo $poString;
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td><?=$form->input('date_order_placed_on_principle_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_placed_on_principle_display'));?>
|
||||||
|
<?=$form->input('date_order_placed_on_principle', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_placed_on_principle', 'value'=>$job['Job']['date_order_placed_on_principle']));?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('customer_order_number', array('value'=>$job['Job']['customer_order_number'], 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?=$form->input('supplier_reference', array('value'=>$job['Job']['supplier_reference'], 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?=$form->input('date_scheduled_ex_works_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_scheduled_ex_works_display'));?>
|
||||||
|
<?=$form->input('date_scheduled_ex_works', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_scheduled_ex_works', 'value'=>$job['Job']['date_scheduled_ex_works'])); ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('date_order_sent_to_customer_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_sent_to_customer_display'));?>
|
||||||
|
<?=$form->input('date_order_sent_to_customer', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_sent_to_customer', 'value'=>$job['Job']['date_order_sent_to_customer'])); ?>
|
||||||
|
</td>
|
||||||
|
<td> <?=$form->input('domestic_freight_paid_by', array('type'=>'select','options'=>$freight_paid_by_options, 'value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('currency_id', array('value'=>$job['Job']['currency_id'], 'type'=>'select', 'options'=>$currencies, 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('company_gross_sales_aud', array('value'=>$job['Job']['company_gross_sales_aud'], 'label'=>false ,'div'=>false));?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?=$form->input('net_sales_aud', array('value'=>$job['Job']['net_sales_aud'], 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
<td> <?=$form->input('gross_profit_aud', array('value'=>$job['Job']['gross_profit_aud'], 'label'=>false ,'div'=>false));?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
Net Export Sales Conv to AUD?
|
Net Export Sales Conv to AUD?
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_profit_exports_aud', array('value'=>$job['Job']['gross_profit_exports_aud'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('gross_profit_exports_aud', array('value'=>$job['Job']['gross_profit_exports_aud'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gp_percent', array('value'=>$job['Job']['gp_percent'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('gp_percent', array('value'=>$job['Job']['gp_percent'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td>? Double column?</td>
|
<td>? Double column?</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('ato_exchange_rate', array('value'=>$job['Job']['ato_exchange_rate'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('ato_exchange_rate', array('value'=>$job['Job']['ato_exchange_rate'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$form->input('gross_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('net_australian_sales_foreign_currency', array('value'=>$job['Job']['net_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('net_australian_sales_foreign_currency', array('value'=>$job['Job']['net_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_profit_value_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_profit_value_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$form->input('gross_profit_value_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_profit_value_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_export_sales_foreign_currency', array('value'=>$job['Job']['gross_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('gross_export_sales_foreign_currency', array('value'=>$job['Job']['gross_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('net_export_sales_foreign_currency', array('value'=>$job['Job']['net_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$form->input('net_export_sales_foreign_currency', array('value'=>$job['Job']['net_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_profit_value_after_discount_exports_foreign_currency', array('value'=>$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$form->input('gross_profit_value_after_discount_exports_foreign_currency', array('value'=>$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_commissions', array('value'=>$job['Job']['gross_commissions'], 'label'=>false ,'div'=>false));?>
|
<?=$form->input('gross_commissions', array('value'=>$job['Job']['gross_commissions'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('net_commissions', array('value'=>$job['Job']['net_commissions'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$form->input('net_commissions', array('value'=>$job['Job']['net_commissions'], 'label'=>false ,'div'=>false));?>
|
||||||
</td>
|
</td>
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
<td><button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?=$form->end();?>
|
<?php //debug($job); ?>
|
||||||
|
|
||||||
<?php debug($job); ?>
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<tr id="<?=$job['Job']['id']?>">
|
<tr id="<?=$job['Job']['id']?>">
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
<td><button class="editButton">Edit</button></td>
|
||||||
<td><?=$job['Job']['date_order_received'];?></td>
|
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?></td>
|
||||||
<td><?=$job['Job']['job_status'];?></td>
|
<td><?=$job['Job']['job_status'];?></td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'label'=>false, 'selected'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
<?=$sale_category_array[$job['Job']['sale_category']];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?></td>
|
<?=$job['Job']['job_type'];?></td>
|
||||||
<td><?=$form->input('shipment_category', array('options'=>$shipment_options, 'label'=>false,'selected'=>$job['Job']['shipment_category']));?></td>
|
<td><?=$job['Job']['shipment_category'];?></td>
|
||||||
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
|
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
|
||||||
<td><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
|
<td><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
|
||||||
<td><?
|
<td><?
|
||||||
|
|
@ -18,68 +18,67 @@
|
||||||
echo $poString;
|
echo $poString;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle']));?></td>
|
||||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('customer_order_number', array('value'=>$job['Job']['customer_order_number'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['customer_order_number'];?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('supplier_reference', array('value'=>$job['Job']['supplier_reference'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['supplier_reference'];?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('date_scheduled_ex_works', array('value'=>$job['Job']['date_scheduled_ex_works'], 'label'=>false ,'div'=>false));?>
|
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('date_order_sent_to_customer', array('value'=>$job['Job']['date_order_sent_to_customer'], 'label'=>false ,'div'=>false));?>
|
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('domestic_freight_paid_by', array('value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('currency_id', array('value'=>$job['Currency']['name'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Currency']['name'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('company_gross_sales_aud', array('value'=>$job['Job']['company_gross_sales_aud'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['company_gross_sales_aud'];?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('net_sales_aud', array('value'=>$job['Job']['net_sales_aud'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['net_sales_aud'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_profit_aud', array('value'=>$job['Job']['gross_profit_aud'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['gross_profit_aud'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
Net Export Sales Conv to AUD?
|
Net Export Sales Conv to AUD?
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_profit_exports_aud', array('value'=>$job['Job']['gross_profit_exports_aud'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['gross_profit_exports_aud'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gp_percent', array('value'=>$job['Job']['gp_percent'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['gp_percent'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>? Double column?</td>
|
<td>? Double column?</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('ato_exchange_rate', array('value'=>$job['Job']['ato_exchange_rate'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['ato_exchange_rate'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['gross_australian_sales_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('net_australian_sales_foreign_currency', array('value'=>$job['Job']['net_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['net_australian_sales_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_profit_value_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_profit_value_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['gross_profit_value_australian_sales_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_export_sales_foreign_currency', array('value'=>$job['Job']['gross_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['gross_export_sales_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('net_export_sales_foreign_currency', array('value'=>$job['Job']['net_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['net_export_sales_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('gross_profit_value_after_discount_exports_foreign_currency', array('value'=>$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$form->input('gross_commissions', array('value'=>$job['Job']['gross_commissions'], 'label'=>false ,'div'=>false));?>
|
<?=$job['Job']['gross_commissions'];?>
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$form->input('net_commissions', array('value'=>$job['Job']['net_commissions'], 'label'=>false ,'div'=>false));?>
|
<td> <?=$job['Job']['net_commissions'];?>
|
||||||
</td>
|
</td>
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
<td><button class="editButton">Edit</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?=$form->end();?>
|
|
||||||
|
|
@ -27,6 +27,7 @@ echo $paginator->counter(array(
|
||||||
|
|
||||||
|
|
||||||
<div class="outer">
|
<div class="outer">
|
||||||
|
<?php echo $form->create('Job', array('action'=>'/jobs/ajax_edit'));?>
|
||||||
<table cellpadding="0" cellspacing="0" class="jobsTable">
|
<table cellpadding="0" cellspacing="0" class="jobsTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -34,12 +35,13 @@ echo $paginator->counter(array(
|
||||||
<th class="actions">Actions</th>
|
<th class="actions">Actions</th>
|
||||||
<th><?php echo $paginator->sort('Order Received');?></th>
|
<th><?php echo $paginator->sort('Order Received');?></th>
|
||||||
<th><?php echo $paginator->sort('Status');?></th>
|
<th><?php echo $paginator->sort('Status');?></th>
|
||||||
<th><?php echo $paginator->sort('Sale Category');?></th>
|
<th class="sale_category"><?php echo $paginator->sort('Sale Category');?></th>
|
||||||
<th><?php echo $paginator->sort('Job Type');?></th>
|
<th><?php echo $paginator->sort('Job Type');?></th>
|
||||||
<th><?php echo $paginator->sort('Shipment Category');?></th>
|
<th><?php echo $paginator->sort('Shipment Category');?></th>
|
||||||
<th><?php echo $paginator->sort('Job Number');?></th>
|
<th><?php echo $paginator->sort('Job Number');?></th>
|
||||||
<th>Enquiry Number</th>
|
<th>Enquiry Number</th>
|
||||||
<th>CMC POs</th>
|
<th>CMC POs</th>
|
||||||
|
<th>Date Order Placed on Principle</th>
|
||||||
<th><?php echo $paginator->sort('Customer');?></th>
|
<th><?php echo $paginator->sort('Customer');?></th>
|
||||||
<th>Customer Order No</th>
|
<th>Customer Order No</th>
|
||||||
<th><?php echo $paginator->sort('Supplier Ref');?></th>
|
<th><?php echo $paginator->sort('Supplier Ref');?></th>
|
||||||
|
|
@ -67,17 +69,19 @@ echo $paginator->counter(array(
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<? //echo $form->create('Job', array('action'=>'ajax_edit', 'class'=>'job_table_form', 'default'=>false));
|
||||||
|
?>
|
||||||
|
|
||||||
<? foreach($jobs as $job):?>
|
<? foreach($jobs as $job):?>
|
||||||
|
|
||||||
|
|
||||||
<tr id="<?=$job['Job']['id']?>">
|
<tr id="<?=$job['Job']['id']?>">
|
||||||
<? echo $form->create('Job', array('action'=>'ajax_edit', 'id'=>'form_'.$job['Job']['id'], 'class'=>'job_table_form')); ?>
|
<td><button class="editButton">Edit</button></td>
|
||||||
<?=$form->input('id', array('type'=>'hidden', 'value'=>$job['Job']['id'])); ?>
|
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
|
||||||
<td><?=$job['Job']['date_order_received'];?></td>
|
|
||||||
<td><?=$job['Job']['job_status'];?></td>
|
|
||||||
<td>
|
<td>
|
||||||
<?=$job['Job']['sale_category'];?>
|
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?></td>
|
||||||
|
<td><?=$job['Job']['job_status'];?></td>
|
||||||
|
<td class="sale_category">
|
||||||
|
<?=$sale_category_array[$job['Job']['sale_category']];?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$job['Job']['job_type'];?></td>
|
<?=$job['Job']['job_type'];?></td>
|
||||||
|
|
@ -92,6 +96,7 @@ echo $paginator->counter(array(
|
||||||
echo $poString;
|
echo $poString;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle']));?></td>
|
||||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||||
<td>
|
<td>
|
||||||
<?=$job['Job']['customer_order_number'];?>
|
<?=$job['Job']['customer_order_number'];?>
|
||||||
|
|
@ -102,11 +107,10 @@ echo $paginator->counter(array(
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?=$job['Job']['date_scheduled_ex_works'];?>
|
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$job['Job']['date_order_sent_to_customer'];?>
|
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
|
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -154,14 +158,14 @@ echo $paginator->counter(array(
|
||||||
</td>
|
</td>
|
||||||
<td> <?=$job['Job']['net_commissions'];?>
|
<td> <?=$job['Job']['net_commissions'];?>
|
||||||
</td>
|
</td>
|
||||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
<td><button class="editButton">Edit</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?=$form->end();?>
|
|
||||||
|
|
||||||
|
|
||||||
<? endforeach;?>
|
<? endforeach;?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<? echo $form->end(); ?>
|
||||||
<div class="paging">
|
<div class="paging">
|
||||||
|
|
||||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||||
|
|
|
||||||
|
|
@ -1292,6 +1292,7 @@ table.jobsTable tr th {
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
table.jobsTable tr td {
|
table.jobsTable tr td {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
font-size: 60%;
|
font-size: 60%;
|
||||||
|
|
@ -1316,7 +1317,7 @@ table.jobsTable tr td form {
|
||||||
|
|
||||||
|
|
||||||
.jobsTable [disabled] {
|
.jobsTable [disabled] {
|
||||||
|
|
||||||
color:#000;
|
color:#000;
|
||||||
background-color:#fff
|
background-color:#fff
|
||||||
|
|
||||||
|
|
@ -1328,6 +1329,7 @@ select.sale_category {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.outer {
|
.outer {
|
||||||
height: 650px;
|
height: 650px;
|
||||||
}
|
}
|
||||||
|
|
@ -1,71 +1,62 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
// console.profile();
|
|
||||||
//$(":input").hide();
|
|
||||||
$(".editButton").show();
|
$(".editButton").show();
|
||||||
$(".cancelButton").hide();
|
|
||||||
$(".saveButton").hide();
|
|
||||||
|
|
||||||
$("input").attr("readonly","readonly");
|
|
||||||
$("select").attr("disabled", "disabled");
|
|
||||||
|
|
||||||
$(".editButton").click(function() {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(".editButton").live('click',function() {
|
||||||
|
|
||||||
var id = $(this).parents('tr').attr('id');
|
var id = $(this).parents('tr').attr('id');
|
||||||
//alert(id);
|
getEditable(id);
|
||||||
makeEditable(id);
|
|
||||||
|
|
||||||
$('.editButton').hide();
|
|
||||||
|
|
||||||
$("#"+id).find('.saveButton').show();
|
|
||||||
$("#"+id).find('.cancelButton').show();
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(".cancelButton").click(function() {
|
$(".cancelButton").live('click',function() {
|
||||||
|
|
||||||
var id = $(this).parents('tr').attr('id');
|
var id = $(this).parents('tr').attr('id');
|
||||||
$(this).hide();
|
getViewable(id);
|
||||||
$("#"+id).find('.saveButton').hide();
|
|
||||||
$("#"+id).find('.editButton').show();
|
|
||||||
cancelEditable(id);
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(".saveButton").click(function() {
|
$(".saveButton").live('click',function() {
|
||||||
var id = $(this).parents('tr').attr('id');
|
var id = $(this).parents('tr').attr('id');
|
||||||
var serializedForm = $("#"+'form_'+id).serialize();
|
var thisJobInputs = $('#'+id).find('input,select');
|
||||||
|
|
||||||
$.post('/jobs/ajax_edit', serializedForm, function(data) {
|
$.post('/jobs/ajax_edit', thisJobInputs, function(data) {
|
||||||
alert("Success! Job Edited"+data); //Need to do something here to update the Row.
|
getViewable(id);
|
||||||
window.location.reload();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log($("#"+id).find('form').serialize());
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('form').submit(function() {
|
|
||||||
//console.log($(this).serialize());
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
//console.profileEnd();
|
//console.profileEnd();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function makeEditable(id) {
|
function getEditable(id) {
|
||||||
$("#"+id).find('input').attr("readonly","");
|
$.get('/jobs/getEditableRow/'+id+'/editedRowCount', false, function(data) {
|
||||||
$("#"+id).find('select').attr("disabled","");
|
$("#"+id).replaceWith(data);
|
||||||
|
$("#"+id).find("button").button();
|
||||||
|
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getViewable(id) {
|
||||||
|
$.get('/jobs/getViewableRow/'+id, false, function(data) {
|
||||||
|
|
||||||
|
$("#"+id).replaceWith(data);
|
||||||
|
$("#"+id).find("button").button();
|
||||||
|
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
function cancelEditable(id) {
|
function cancelEditable(id) {
|
||||||
$("#"+id).find('input').attr("readonly","readonly");
|
$("#"+id).find('input').attr("readonly","readonly");
|
||||||
$("#"+id).find('select').attr("disabled","disabled");
|
$("#"+id).find('select').attr("disabled","disabled");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue