Improvements to invoice display and other misc items

This commit is contained in:
Deon George
2013-12-20 10:00:32 +11:00
parent 778eada7f0
commit e19518c505
43 changed files with 1122 additions and 887 deletions

View File

@@ -8,13 +8,23 @@
<th>Supplier Cost</th>
<th>Invoiced</th>
<th>Extras</th>
<th>Total</th>
<th>Charging</th>
<th>Profit</th>
</tr></thead>
<tbody>
<?php foreach ($aso->services(TRUE) as $so) : ?>
<?php $p = $so->plugin(); $po = $p->admin_plan(); $service_number = $p->service_number; ?>
<?php $cost = $o->charge($service_number); $excess = $o->excess($service_number); $charge = Period::multiple($so->recur_schedule)*$so->price(TRUE)/12; ?>
<tr class="<?php echo $o->charge($service_number) == $po->supplier_plan->display('base_cost') ? '' : 'error'; ?>">
<?php if ($cost != $po->supplier_plan->display('base_cost')) : ?>
<tr class="error">
<?php elseif ($charge-$cost-$excess < 0) : ?>
<tr class="warning">
<?php else : ?>
<tr>
<?php endif ?>
<td><?php echo $service_number; ?></td>
<td><?php echo HTML::anchor(URL::link('user','service/view/'.$so->id),$so->id); ?></td>
@@ -22,12 +32,21 @@
<td><?php echo $p->contract_date_start(TRUE); ?></td>
<td><?php echo $p->contract_date_end(TRUE); ?></td>
<td><?php echo $po->supplier_plan->display('base_cost'); ?></td>
<td><?php echo Currency::display($o->charge($service_number)); ?></td>
<td><?php echo Currency::display($o->excess($service_number)); ?></td>
<td><?php echo Currency::display($cost); ?></td>
<td><?php echo Currency::display($excess); ?></td>
<td><?php echo Currency::display($cost+$excess); ?>
<td><?php echo Currency::display($charge); ?>
<td><?php echo Currency::display($charge-$cost-$excess); ?>
</tr>
<?php endforeach ?>
<tr class="info"><td colspan="5">&nbsp;</td><td><?php echo $o->totalcharge(TRUE); ?></td><td>&nbsp;</td><td><?php echo $o->totalexcess(TRUE); ?></tr>
<tr class="info">
<td colspan="6">&nbsp;</td>
<td><?php echo $o->totalcharge(TRUE); ?></td>
<td><?php echo $o->totalexcess(TRUE); ?></td>
<td><?php echo Currency::display($o->totalcharge()+$o->totalexcess()); ?></td>
<td colspan="2">&nbsp;</td>
</tr>
</tbody>
</table>