Invoices are now linked to Jobs
This commit is contained in:
parent
a6e46794c4
commit
86b42bf9ce
|
|
@ -53,10 +53,10 @@ class InvoicesController extends AppController {
|
||||||
$enquiryid = $this->params['named']['enquiryid'];
|
$enquiryid = $this->params['named']['enquiryid'];
|
||||||
$enquiry = $this->Invoice->Enquiry->findById($enquiryid);
|
$enquiry = $this->Invoice->Enquiry->findById($enquiryid);
|
||||||
|
|
||||||
|
$jobs = $this->Invoice->Job->find('list', array('conditions'=>array('Job.enquiry_id'=>$enquiryid)));
|
||||||
|
|
||||||
$user = $this->Auth->user();
|
$user = $this->Auth->user();
|
||||||
$this->set(compact('enquiry', 'user'));
|
$this->set(compact('enquiry', 'user','jobs'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->Session->setFlash(__('Invalid Enquiry ID', true));
|
$this->Session->setFlash(__('Invalid Enquiry ID', true));
|
||||||
|
|
|
||||||
|
|
@ -224,6 +224,7 @@ $class = ' class="altrow"';?>
|
||||||
<th>Issue Date</th>
|
<th>Issue Date</th>
|
||||||
<th>Due Date</th>
|
<th>Due Date</th>
|
||||||
<th>Invoice Number</th>
|
<th>Invoice Number</th>
|
||||||
|
<th>Job</th>
|
||||||
<th>Customer</th>
|
<th>Customer</th>
|
||||||
<th>Paid / Unpaid</th>
|
<th>Paid / Unpaid</th>
|
||||||
<th>Payment Received Date</th>
|
<th>Payment Received Date</th>
|
||||||
|
|
@ -248,6 +249,9 @@ $class = ' class="altrow"';?>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $invoice['Invoice']['title']; ?>
|
<?php echo $invoice['Invoice']['title']; ?>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php echo $html->link($invoice['Job']['title'], array('controller'=>'jobs', 'action'=>'view',$invoice['Invoice']['job_id'])); ?>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<? echo $html->link($invoice['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $invoice['Customer']['id'])); ?>
|
<? echo $html->link($invoice['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $invoice['Customer']['id'])); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -306,4 +310,4 @@ $class = ' class="altrow"';?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php debug($quotes); ?>
|
<?php debug($invoices); ?>
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
<?php
|
<?php
|
||||||
echo $form->input('issue_date');
|
echo $form->input('issue_date');
|
||||||
echo $form->input('due_date');
|
echo $form->input('due_date');
|
||||||
|
echo $form->input('job_id');
|
||||||
|
|
||||||
echo $form->input('enquiry_id', array('type'=>'hidden','value'=>$enquiry['Enquiry']['id']));
|
echo $form->input('enquiry_id', array('type'=>'hidden','value'=>$enquiry['Enquiry']['id']));
|
||||||
echo $form->input('user_id', array('type'=>'hidden','value'=>$user['User']['id']));
|
echo $form->input('user_id', array('type'=>'hidden','value'=>$user['User']['id']));
|
||||||
echo $form->input('customer_id', array('type'=>'hidden', 'value'=>$enquiry['Enquiry']['customer_id']));
|
echo $form->input('customer_id', array('type'=>'hidden', 'value'=>$enquiry['Enquiry']['customer_id']));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php echo $form->end('Submit');?>
|
<?php echo $form->end('Submit');?>
|
||||||
|
|
@ -23,3 +24,4 @@
|
||||||
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<?php debug($jobs); ?>
|
||||||
|
|
@ -9,14 +9,15 @@
|
||||||
<table cellpadding="0" cellspacing="0">
|
<table cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th><?php echo $paginator->sort('created');?></th>
|
|
||||||
<th><?php echo $paginator->sort('issue_date');?></th>
|
<th><?php echo $paginator->sort('issue_date');?></th>
|
||||||
<th><?php echo $paginator->sort('due_date');?></th>
|
<th><?php echo $paginator->sort('due_date');?></th>
|
||||||
<th><?php echo $paginator->sort('Invoice Number');?></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('Customer'); ?></th>
|
<th><?php echo $paginator->sort('Customer'); ?></th>
|
||||||
<th><?php echo $paginator->sort('paid');?></th>
|
<th><?php echo $paginator->sort('paid');?></th>
|
||||||
<th><?php echo $paginator->sort('payment_received_date');?></th>
|
<th><?php echo $paginator->sort('payment_received_date');?></th>
|
||||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
|
||||||
<th><?php echo $paginator->sort('user_id');?></th>
|
<th><?php echo $paginator->sort('user_id');?></th>
|
||||||
<th class="actions"><?php __('Actions');?></th>
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -30,9 +31,7 @@
|
||||||
?>
|
?>
|
||||||
<tr<?php echo $class;?>>
|
<tr<?php echo $class;?>>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['created'])); ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['issue_date'])); ?>
|
<?php echo date('j M Y',$time->toUnix($invoice['Invoice']['issue_date'])); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -41,6 +40,12 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $invoice['Invoice']['title']; ?>
|
<?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>
|
||||||
<td>
|
<td>
|
||||||
<?php echo $invoice['Customer']['name']; ?>
|
<?php echo $invoice['Customer']['name']; ?>
|
||||||
|
|
@ -67,9 +72,7 @@
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<?php echo $html->link($invoice['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $invoice['Enquiry']['id'])); ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $html->link($invoice['User']['username'], array('controller' => 'users', 'action' => 'view', $invoice['User']['id'])); ?>
|
<?php echo $html->link($invoice['User']['username'], array('controller' => 'users', 'action' => 'view', $invoice['User']['id'])); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue