cmc-sales/views/elements/line_items_table.ctp

107 lines
3.4 KiB
Plaintext
Raw Normal View History

<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<tr bgcolor="#f2f2f2">
<th width="<?=$colWidths['item'];?>" align="center">ITEM<br />NO.</th>
<th width="<?=$colWidths['qty'];?>" align="center">QTY</th>
<th width="<?=$colWidths['desc'];?>" align="center">DESCRIPTION</th>
<th width="<?=$colWidths['unit'];?>" align="center">UNIT<br>PRICE</th>
<th width="<?=$colWidths['total'];?>" align="center">TOTAL<br>PRICE</th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th align="center"><?=$currencyCode?></th>
<th align="center"><?=$currencyCode?></th>
</tr>
</thead>
<tbody>
2011-06-23 00:03:24 -07:00
<?
$hasOptions = false;
foreach($document['LineItem'] as $li):?>
<tr nobr="true">
2011-06-16 00:04:46 -07:00
<td width="<?=$colWidths['item'];?>" align="center" valign="top">
<? if($li['option'] == 1) {
echo 'Option<br>';
2011-06-23 00:03:24 -07:00
$hasOptions = true;
}
?>
2011-06-16 00:04:46 -07:00
<?=$li['item_number'];?>
</td>
2011-06-19 18:20:44 -07:00
<td width="<?=$colWidths['qty'];?>" align="center" valign="top"><?=$decimal->formatDecimal($li['quantity']);?></td>
<td width="<?=$colWidths['desc'];?>"><?=$li['title'];?>
<?=$li['description'];?>
</td>
2011-06-16 00:04:46 -07:00
<td width="<?=$colWidths['unit'];?>" align="center" valign="top">
<?=$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>
2011-06-16 00:04:46 -07:00
<td width="<?=$colWidths['total'];?>" align="center" valign="top">
<?=$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>
</tr>
<?endforeach;?>
2011-06-15 22:05:34 -07:00
<tr nobr="true">
<td width="<?=$colWidths['item'];?>"></td>
<td width="<?=$colWidths['qty'];?>"></td>
<td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['subtotal']?></td>
<td width="<?=$colWidths['unit'];?>"></td>
2011-06-23 00:03:24 -07:00
<td width="<?=$colWidths['total'];?>" align="center">
<?
if(!$hasOptions) {
echo $number->currency($totals['subtotal'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
2011-06-23 00:03:24 -07:00
}
?></td>
</tr>
2011-06-15 22:05:34 -07:00
<tr nobr="true">
<td width="<?=$colWidths['item'];?>"></td>
<td width="<?=$colWidths['qty'];?>"></td>
<td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['gst'];?></td>
<td width="<?=$colWidths['unit'];?>"></td>
<td width="<?=$colWidths['total'];?>" align="center">
<?
2011-06-23 00:03:24 -07:00
if(!$hasOptions) {
echo $number->currency($totals['gst'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
2011-06-23 00:03:24 -07:00
}
2011-06-23 00:03:24 -07:00
?>
</td>
</tr>
2011-06-15 22:05:34 -07:00
<tr nobr="true">
<td width="<?=$colWidths['item'];?>"></td>
<td width="<?=$colWidths['qty'];?>"></td>
<td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['total'];?></td>
<td width="<?=$colWidths['unit'];?>" align="center"><?=$currencyCode?></td>
2011-06-23 00:03:24 -07:00
<td width="<?=$colWidths['total'];?>" align="center">
<?
if(!$hasOptions) {
echo $number->currency($totals['total'], $currencyCode);
}
else {
echo $currencySymbol.'TBA';
2011-06-23 00:03:24 -07:00
}
?></td>
</tr>
2011-06-23 00:03:24 -07:00
</tbody>
</table>