- $trans_items = get_allocatable_from_supp_transactions($supplier_id, $settled);
- div_start('alloc_tbl');
- start_table($table_style);
- if (!isset($_POST['supplier_id']))
- $th = array(_("Transaction Type"), _("#"), _("Reference"), _("Date"), _("Supplier"),
- _("Currency"), _("Total"), _("Left To Allocate"));
- else
- $th = array(_("Transaction Type"), _("#"), _("Reference"), _("Date"),
- _("Total"), _("Left To Allocate"));
- table_header($th);
-
- $k = 0; //row colour counter
- $has_settled_items = false;
-
- 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['supplier_id']))
- {
- label_cell($myrow["supp_name"]);
- label_cell($myrow["curr_code"]);
- }
- amount_cell(-$myrow["Total"]);
- amount_cell(-$myrow["Total"]-$myrow["alloc"]);
- label_cell("<a href='$path_to_root/purchasing/allocations/supplier_allocate.php?trans_no=" . $myrow["trans_no"] . "&trans_type=" . $myrow["type"] . "'>" . _("Allocate") . "</a>");
- end_row();
- }