153 lines
3.6 KiB
PHP
153 lines
3.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;
|
|
|
|
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>';
|
|
|
|
$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>
|
|
=<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;?>
|
|
</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>
|