cmc-sales/views/line_items/get_table.ctp

128 lines
2.6 KiB
PHP

<script type="text/javascript">
$(function() {
$('button').button();
});
</script>
<table class="lineItems">
<thead>
<tr>
<th>ITEM<br>NO.</th>
<th>QTY</th>
<th>DESCRIPTION</th>
<th>UNIT<br>PRICE</th>
<th>TOTAL<br>PRICE</th>
<th>ACTIONS</th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th><?=$currencyCode?></th>
<th><?=$currencyCode?></th>
<th></th>
</tr>
</thead>
<tbody>
<?
$hasOptions = false;
foreach($document['LineItem'] as $li):?>
<tr class="lineItem">
<td>
<? if($li['option'] == 1) {
echo 'Option<br>';
$hasOptions = true;
}
?>
<?=$li['item_number'];?></td>
<td><?=$li['quantity'];?></td>
<td class="description"><?=$li['title'];?>
<?=$li['description'];?>
</td>
<td class="price">
<?=$number->currency($li['gross_unit_price'], $currencyCode);?>
<? if($li['discount_percent']):?>
<br>less<br><?=$li['discount_percent']?>%<br>
discount<br>
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
=<br>
<?=$number->currency($li['net_unit_price'], $currencyCode);?>
<?endif;?>
</td>
<td class="price">
<?=$number->currency($li['gross_price'], $currencyCode);?>
<? if($li['discount_percent']):?>
<br>less<br><?=$li['discount_percent']?>%<br>
discount<br>
<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
=<br>
<?=$number->currency($li['net_price'], $currencyCode);?>
<?endif;?>
</td>
<td id="<?=$li['id'];?>">
<button class="editLineItem">Edit</button><br>
<button class="removeLineItem">Remove</button>
</td>
</tr>
<?endforeach;?>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td class="leftAlign">SUB-TOTAL (Excluding GST)</td>
<td></td>
<td><?
if(!$hasOptions) {
echo $number->currency($totals['subtotal'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
}
?>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="leftAlign">GST (10%)</td>
<td></td>
<td>
<?
if(!$hasOptions) {
echo $number->currency($totals['gst'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
}
?>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="leftAlign">TOTAL PAYABLE (INCLUDING GST)</td>
<td></td>
<td><?
if(!$hasOptions) {
echo $number->currency($totals['total'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
}
?></td>
<td></td>
</tr>
</tfoot>
</table>