- while ($myrow = db_fetch($trans_items))
- {
- if ($myrow["settled"] == 1)
- {
- start_row("class='settledbg'");
- $has_settled_items = true;
- }
- else
- {
- alt_table_row_color($k);
- }
-
- label_cell(systypes::name($myrow["type"]));
- label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"]));
- label_cell($myrow["reference"]);
- label_cell(sql2date($myrow["tran_date"]));
-
- if (!isset($_POST['customer_id']))
- {
- label_cell($myrow["DebtorName"]);
- label_cell($myrow["curr_code"]);
- }
- amount_cell($myrow["Total"]);
- amount_cell($myrow["Total"] - $myrow["alloc"]);
- if ($myrow["Total"] - $myrow["alloc"] != 0.0)
- label_cell("<a href='$path_to_root/sales/allocations/customer_allocate.php?trans_no="
- .$myrow["trans_no"] . "&trans_type=" . $myrow["type"] . "'>" . _("Allocate") . "</a>");
- else
- label_cell("");
- end_row();
- }
+function alloc_link($row)
+{
+ return pager_link(_("Allocate"),
+ "/sales/allocations/customer_allocate.php?trans_no="
+ .$row["trans_no"] . "&trans_type=" . $row["type"], ICON_MONEY);
+}
+
+function amount_left($row)
+{
+ return price_format($row["Total"]-$row["alloc"]);
+}