Adding invoices and jobs to Customer view
This commit is contained in:
parent
740de15efc
commit
e378a596ec
86
views/elements/invoice_table.ctp
Normal file
86
views/elements/invoice_table.ctp
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
<h2><?php __('Invoices');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
||||
<th><?php echo $paginator->sort('issue_date');?></th>
|
||||
<th><?php echo $paginator->sort('due_date');?></th>
|
||||
<th><?php echo $paginator->sort('Invoice Number');?></th>
|
||||
<th><?php echo $paginator->sort('Job Number');?></th>
|
||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
||||
<th><?php echo $paginator->sort('paid');?></th>
|
||||
<th><?php echo $paginator->sort('payment_received_date');?></th>
|
||||
|
||||
<th><?php echo $paginator->sort('user_id');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($invoices as $invoice):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['issue_date'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['due_date'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $invoice['Invoice']['title']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($invoice['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $invoice['Invoice']['job_id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($invoice['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $invoice['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
if($invoice['Invoice']['paid'] == 0) {
|
||||
echo "UNPAID";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo "N/A";
|
||||
echo "</td>";
|
||||
}
|
||||
else {
|
||||
echo "PAID";
|
||||
echo "</td>";
|
||||
echo "<td>";
|
||||
echo date('j M Y',$time->toUnix($invoice['Invoice']['payment_received_date']));
|
||||
echo "</td>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $html->link($invoice['User']['username'], array('controller' => 'users', 'action' => 'view', $invoice['User']['id'])); ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=>'invoices','action' => 'view', $invoice['Invoice']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=>'invoices', 'action' => 'edit', $invoice['Invoice']['id'])); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<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>
|
||||
116
views/elements/job_table.ctp
Normal file
116
views/elements/job_table.ctp
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<h2><?php __('Jobs');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0" class="mer">
|
||||
<tr>
|
||||
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('Job Number');?></th>
|
||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
||||
<th>POs</th>
|
||||
<th><?php echo $paginator->sort('Customer');?></th>
|
||||
<th><?php echo $paginator->sort('customer_order_number');?></th>
|
||||
|
||||
<th><?php echo $paginator->sort('date_order_received');?></th>
|
||||
|
||||
<th><?php echo $paginator->sort('date_order_sent_to_customer');?></th>
|
||||
|
||||
|
||||
<th><?php echo $paginator->sort('domestic_freight_paid_by');?></th>
|
||||
<th><?php echo $paginator->sort('sale_category');?></th>
|
||||
<th><?php echo $paginator->sort('shipment_category');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($jobs as $job):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
|
||||
$poLink = "";
|
||||
foreach($job['PurchaseOrder'] as $po) {
|
||||
$poLink .= $html->link($po['title']." ", array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));
|
||||
}
|
||||
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
|
||||
|
||||
<td class="enqdate">
|
||||
<?php
|
||||
/* Change the date from MySQL DATETIME to a D M Y format */
|
||||
echo date('j M Y',$time->toUnix($job['Job']['created'])); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $html->link(__($job['Job']['title'], true), array('action' => 'view', $job['Job']['id'])); ?>
|
||||
</td>
|
||||
<td class="tinytext">
|
||||
<?php echo $html->link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
<td><?=$poLink?></td>
|
||||
<td>
|
||||
<?php echo $html->link($customers[$job['Enquiry']['customer_id']], array('controller'=>'customers',
|
||||
'action'=>'view', $job['Enquiry']['customer_id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['customer_order_number']; ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
<?php echo $job['Job']['date_order_received']; ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo isEmptyDate($job['Job']['date_order_sent_to_customer']); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $job['Job']['domestic_freight_paid_by']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['sale_category']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['shipment_category']; ?>
|
||||
</td>
|
||||
<td class="tinytext">
|
||||
<?php echo $job['Job']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php //echo $html->link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $job['Job']['id']), array('class'=>'editWindow')); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<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
|
||||
|
||||
function isEmptyDate($date) {
|
||||
if($date == "0000-00-00") {
|
||||
return "-";
|
||||
}
|
||||
else {
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in a new issue