cmc-sales/php/app/views/line_items/get_table.ctp

153 lines
3.6 KiB
Plaintext
Raw Normal View History

2011-05-19 00:05:01 -07:00
<script type="text/javascript">
2012-03-02 13:01:31 -08:00
$(function() {
$('button').button();
});
2011-05-19 00:05:01 -07:00
</script>
<table class="lineItems">
<thead>
2012-03-02 13:01:31 -08:00
<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>
2011-05-19 00:05:01 -07:00
</thead>
<tbody>
2012-03-02 13:01:31 -08:00
<?
$hasOptions = false;
2011-06-23 00:03:24 -07:00
2012-03-02 13:01:31 -08:00
if(count($document['LineItem']) == 0):
?>
<tr class="no_items">
<td colspan="6"> No Line Items have been Added Yet!</td>
</tr>
<?
endif;
?>
<?
foreach($document['LineItem'] as $li):?>
<tr class="lineItem">
<td>
<? if($li['option'] == 1) {
echo 'Option<br>';
2011-06-23 00:03:24 -07:00
2012-03-02 13:01:31 -08:00
$hasOptions = true;
}
?>
<?=$li['item_number'];?></td>
<td><?=$li['quantity'];?></td>
<td class="description">
<?=$li['title'];?><br>
<?=$li['description'];?>
</td>
<td class="price">
<?
if($li['has_text_prices']):
echo $li['unit_price_string'];
?>
<?
else:
?>
<?=$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;?>
<? endif;?>
</td>
<td class="price">
<?
if($li['has_text_prices']):
echo $li['gross_price_string'];
?>
<?
else:
?>
<?=$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>
2012-03-02 13:01:31 -08:00
=<br>
<?=$number->currency($li['net_price'], $currencyCode);?>
<?endif;?>
<?endif;?>
</td>
<td id="<?=$li['id'];?>">
<button class="editLineItem">Edit</button><br>
<button class="removeLineItem">Remove</button>
</td>
</tr>
<?endforeach;?>
2011-05-19 00:05:01 -07:00
</tbody>
<tfoot>
2012-03-02 13:01:31 -08:00
<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>
2011-06-23 00:03:24 -07:00
2012-03-02 13:01:31 -08:00
<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';
}
2011-09-26 02:05:56 -07:00
2012-03-02 13:01:31 -08:00
?>
</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>