cmc-sales/php/app/views/jobs/index.ctp

217 lines
7.9 KiB
Plaintext
Raw Normal View History

2011-03-23 00:18:21 -07:00
<?php
echo $javascript->link('job_index');
2011-03-22 00:05:56 -07:00
?>
<h2><?php __('Jobs');?></h2>
2011-03-23 20:41:54 -07:00
2011-04-12 18:26:38 -07:00
<div class="showActions">
<ul>
<li><?=$html->link('Show all', array('action'=>'index'));?></li>
<li><?=$html->link('Show only Unpaid', array('action'=>'index/1'));?></li>
<li><?=$html->link('Show only Unsent', array('action'=>'index/0/1'));?></li>
<li><?=$html->link('Show only Unpaid & Unsent', array('action'=>'index/1/1'));?></li>
2011-06-16 17:54:09 -07:00
<li><button id="showDeleted">Show Deleted Jobs</button>
<button id="hideDeleted">Hide Deleted Jobs</button></li>
2011-04-12 18:26:38 -07:00
</ul>
</div>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% Jobs of %count%', true)
));
?>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>
<?php echo $form->create('Job', array('action'=>'/jobs/ajax_edit', 'default'=>false));?>
2011-04-12 18:26:38 -07:00
<div class="scrollHorizontal">
<table cellpadding="0" cellspacing="0" class="jobsTable">
<thead class="jobTableHead">
<tr class="jobTableHeadRow" id="originalHeader">
<th class="actions">Actions</th>
<th><?php echo $paginator->sort('Order Received', 'date_order_received');?></th>
<th><?php echo $paginator->sort('All Paid', 'all_paid');?></th>
<th><?php echo $paginator->sort('All Sent', 'all_sent');?></th>
<th><?php echo $paginator->sort('Status', 'job_status');?></th>
<th class="sale_category"><?php echo $paginator->sort('Sale Category');?></th>
<th><?php echo $paginator->sort('Job Type', 'job_type');?></th>
<th><?php echo $paginator->sort('Shipment Category','shipment_category');?></th>
<th><?php echo $paginator->sort('Job Number','title');?></th>
<th>Enquiry Number</th>
2011-04-19 01:07:27 -07:00
<th>Principle</th>
2011-04-12 18:26:38 -07:00
<th>CMC POs</th>
<th>Date Order Placed on Principle</th>
<th><?php echo $paginator->sort('Customer','Customer.name');?></th>
<th>Customer Order No</th>
<th><?php echo $paginator->sort('Principle Ref', 'principle_reference');?></th>
2011-04-12 18:26:38 -07:00
<th><?php echo $paginator->sort('Scheduled Ex-Works', 'date_scheduled_ex_works');?></th>
<th><?php echo $paginator->sort('Date Sent to Customer', 'date_sent_to_customer');?></th>
<th><?php echo $paginator->sort('Freight Paid By CMC');?></th>
<th><?php echo $paginator->sort('Sale Currency');?></th>
<th class="purple"><?php echo $paginator->sort('Gross Sales AUD');?></th>
<th class="purple"><?php echo $paginator->sort('Net Sales AUD');?></th>
<th class="purple"><?php echo $paginator->sort('Gross Profit AUD');?></th>
<th class="purple"><?php echo $paginator->sort('Net Export Sales Converted to Or Invoiced in AUD');?></th>
<th class="purple"><?php echo $paginator->sort('Gross Profit Value Export in AUD');?></th>
<th class="purple"><?php echo $paginator->sort('GP% Excl Commissions');?></th>
<th class="pink"><?php echo $paginator->sort('ATO Exchange Rate');?></th>
<th class="lightblue"><?php echo $paginator->sort('Gross Australian Sales Foreign Currency');?></th>
<th class="lightblue"><?php echo $paginator->sort('Net Australian Sales Foreign Currency');?></th>
<th class="lightblue"><?php echo $paginator->sort('Gross Profit value Australian Sales Foreign Currency');?></th>
<th class="lightgreen"><?php echo $paginator->sort('Gross Export Sales Foreign Currency');?></th>
<th class="lightgreen"><?php echo $paginator->sort('Net Export Sales Foreign Currency');?></th>
<th class="lightgreen"><?php echo $paginator->sort('Gross Profit Value After Discount Exports Foreign Currency');?></th>
<th class="darkgreen"><?php echo $paginator->sort('Gross Commissions');?></th>
<th class="darkgreen"><?php echo $paginator->sort('Net Commisions');?></th>
2011-04-12 18:26:38 -07:00
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<tbody>
<? //echo $form->create('Job', array('action'=>'ajax_edit', 'class'=>'job_table_form', 'default'=>false));
?>
2011-06-16 17:54:09 -07:00
<? foreach($jobs as $job):
if($job['Job']['deleted'] == 1) {
$rowClass = 'deleted';
$button = '<button class="undeleteButton">Undelete</button>';
}
else {
$rowClass = '';
$button = '<button class="deleteButton">X</button>';
}
2011-04-12 18:26:38 -07:00
2011-06-16 17:54:09 -07:00
?>
2011-04-12 18:26:38 -07:00
2011-06-16 17:54:09 -07:00
<tr id="<?=$job['Job']['id']?>" class="<?=$rowClass?>">
2011-04-12 18:26:38 -07:00
<td>
2011-06-16 17:54:09 -07:00
<button class="editButton">Edit</button>
<?=$button?>
</td>
<td>
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?>
</td>
2011-04-12 18:26:38 -07:00
<td>
<?=$this->element('booleanTick', array('bool'=>$job['Job']['all_paid'])); ?>
</td>
<td>
<?=$this->element('booleanTick', array('bool'=>$job['Job']['all_sent'])); ?>
</td>
<td class=""><?=$job['Job']['job_status'];?></td>
<td class="sale_category nowrap">
<?=$sale_category_array[$job['Job']['sale_category']];?>
</td>
<td>
<?=$job['Job']['job_type'];?></td>
<td class="nowrap"><?=$shipment_category_options[$job['Job']['shipment_category']];?></td>
2011-04-12 18:26:38 -07:00
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
<td class="nowrap"><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
2011-04-19 01:07:27 -07:00
<td><?=$html->link($principleList[$job['Enquiry']['principle_id']], '/principles/view/'.$job['Enquiry']['principle_id']);?></td>
2011-04-12 18:26:38 -07:00
<td><?
$poString = '';
foreach($job['PurchaseOrder'] as $po) {
echo $html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']))."<br>";
}
?>
</td>
<td class="nowrap"><?
foreach($job['PurchaseOrder'] as $po) {
echo $this->element('isEmptyDate', array('date'=>$po['issue_date']));
echo "<br>";
}
?>
</td>
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
<td class="nowrap">
<?=$job['Job']['customer_order_number'];?>
</td>
<td class="nowrap"> <?
2011-04-12 18:26:38 -07:00
foreach($job['PurchaseOrder'] as $po) {
echo $po['principle_reference'];
echo "<br>";
}
?>
</td>
<td>
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?>
</td>
<td>
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?>
</td>
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
</td>
<td>
<?=$job['Currency']['name'];?>
</td>
<td>
<?=$number->currency($job['Job']['company_gross_sales_aud']);?>
2011-04-12 18:26:38 -07:00
</td>
<td>
<?=$number->currency($job['Job']['net_sales_aud']);?>
2011-04-12 18:26:38 -07:00
</td>
2013-04-29 05:30:18 -07:00
<td> <?=$number->currency($job['Job']['gross_profit_aud']);?>
2011-04-12 18:26:38 -07:00
</td>
<td>
2013-04-29 05:30:18 -07:00
<?=$number->currency($job['Job']['net_export_sales_aud']);?>
2011-04-12 18:26:38 -07:00
</td>
<td>
2013-04-29 05:30:18 -07:00
<?=$number->currency($job['Job']['gross_profit_exports_aud']);?>
2011-04-12 18:26:38 -07:00
</td>
<td>
<?=$job['Job']['gp_percent'];?>
</td>
<td>
<?=$job['Job']['ato_exchange_rate'];?>
</td>
<td> <?=$job['Job']['gross_australian_sales_foreign_currency'];?>
</td>
<td>
<?=$job['Job']['net_australian_sales_foreign_currency'];?>
</td>
<td> <?=$job['Job']['gross_profit_value_australian_sales_foreign_currency'];?>
</td>
<td>
<?=$job['Job']['gross_export_sales_foreign_currency'];?>
</td>
<td> <?=$job['Job']['net_export_sales_foreign_currency'];?>
</td>
<td> <?=$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'];?>
</td>
<td>
<?=$job['Job']['gross_commissions'];?>
</td>
<td> <?=$job['Job']['net_commissions'];?>
</td>
2011-06-16 17:54:09 -07:00
<td>
<button class="editButton">Edit</button>
<?=$button?>
</td>
2011-04-12 18:26:38 -07:00
</tr>
<? endforeach;?>
</tbody>
</table>
2011-04-06 23:04:40 -07:00
2011-04-12 18:26:38 -07:00
</div>
2011-04-06 23:04:40 -07:00
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
2011-04-06 23:04:40 -07:00
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>
2011-04-06 23:04:40 -07:00
<? echo $form->end(); ?>
2011-04-11 18:47:44 -07:00
<? debug($jobs);
2013-04-29 05:30:18 -07:00
?>