Progress on #54 invoice sheet work

This commit is contained in:
Karl Cordes 2023-03-21 22:13:03 +11:00
parent 004b44cd6f
commit daec410797
4 changed files with 15 additions and 12 deletions

View file

@ -54,7 +54,7 @@ RUN chmod -R 755 /var/www/cmc-sales/app/tmp
# Copy site into place.
ADD . /var/www/cmc-sales
RUN chmod +x /var/www/cmc-sales/run_vault.sh
RUN chmod +x /var/www/cmc-sales/run_update_invoices.sh
# By default, simply start apache.

View file

@ -14,17 +14,15 @@ class InvoicesController extends AppController {
function index() {
$this->Invoice->recursive = 0;
$this->set('invoices', $this->paginate());
/*$q = <<<EOT
select i.id, i.document_id, i.job_id, i.issue_date, i.due_date, i.paid, i.payment_received_date, i.amount_invoiced, i.amount_received, i.title, j.id, j.title, e.id, e.title, e.gst, c.id, c.name from invoices i JOIN jobs j, customers c, enquiries e WHERE i.job_id = j.id AND i.customer_id = c.id AND i.enquiry_id = e.id ORDER BY i.id DESC;
EOT;
$results = $this->Invoice->query($q);
$this->set('invoices', $results);*/
}
function calculate() {
}
function printView() {
$this->layout = 'minimal';

View file

@ -109,9 +109,11 @@ class LineItemsController extends AppController {
$this->set('principles', $this->LineItem->Product->Principle->find('list'));
}
// Adding or editing an Invoice means we need to update the invoiced_amount column
// Adding or editing an Invoice means we need to update the invoiced_amount column
// issue #54
function updateInvoice($documentID) {
// If we've changed a line_item for an invoice, update the invoiced amount
// on the invoices table.
$document = $this->LineItem->Document->find('first', array('conditions' => array('Document.id' => $documentID), 'recursive'=>1));
@ -125,5 +127,6 @@ class LineItemsController extends AppController {
}
}
}
?>

View file

@ -13,7 +13,8 @@
<th>Date Due</th>
<th><?php echo $paginator->sort('paid');?></th>
<th>Date Received</th>
<th>TODO</th>
<th>Amount Invoiced</th>
<th>Amount Received</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>
@ -65,7 +66,8 @@
?>
</td>
<td>TODO</td>
<td><?php echo $invoice['Invoice']['amount_invoiced']; ?></td>
<td>TODO</td>
<td>
<?php echo $invoice['Invoice']['title']; ?>
</td>