-if (db_num_rows($result) == 0)
-{
- display_note(_("There are no transactions to display for the given dates."), 1, 1);
- end_page();
- exit;
-}
-
-//------------------------------------------------------------------------------------------------
-
-/*show a table of the transactions returned by the sql */
-
-start_table("$table_style width=90%");
-if ($_POST['supplier_id'] == reserved_words::get_all())
- $th = array(_("Type"), _("Number"), _("Reference"), _("Supplier"),
- _("Supp Reference"), _("Date"), _("Due Date"), _("Currency"),
- _("Debit"), _("Credit"), _("Allocated"), _("Balance"), "");
-else
- $th = array(_("Type"), _("Number"), _("Reference"), _("Supp Reference"), _("Date"), _("Due Date"),
- _("Debit"), _("Credit"), _("Allocated"), _("Balance"), "");
-table_header($th);
-
-$j = 1;
-$k = 0; //row colour counter
-$over_due = false;
-while ($myrow = db_fetch($result))
-{
-
- if ($myrow['OverDue'] == 1)
- {
- start_row("class='overduebg'");
- $over_due = true;
- }
- else
- {
- alt_table_row_color($k);
- }
-
- $date = sql2date($myrow["tran_date"]);
-
- $duedate = ((($myrow["type"] == 20) || ($myrow["type"]== 21))?sql2date($myrow["due_date"]):"");
-
-
- label_cell(systypes::name($myrow["type"]));
- label_cell(get_trans_view_str($myrow["type"],$myrow["trans_no"]));
- label_cell($myrow["reference"]);
- if ($_POST['supplier_id'] == reserved_words::get_all())
- label_cell($myrow["supp_name"]);
- label_cell($myrow["supp_reference"]);
- label_cell($date);
- label_cell($duedate);
- if ($_POST['supplier_id'] == reserved_words::get_all())
- label_cell($myrow["curr_code"]);
- if ($myrow["TotalAmount"] >= 0)
- label_cell("");
- amount_cell(abs($myrow["TotalAmount"]));
- if ($myrow["TotalAmount"] < 0)
- label_cell("");
- amount_cell($myrow["Allocated"]);
- if ($myrow["type"] == 1 || $myrow["type"] == 21 || $myrow["type"] == 22)
- $balance = -$myrow["TotalAmount"] - $myrow["Allocated"];
- else
- $balance = $myrow["TotalAmount"] - $myrow["Allocated"];
- amount_cell($balance);
-
- //if (($myrow["type"] == 1 || $myrow["type"] == 21 || $myrow["type"] == 22) &&
- // $myrow["Void"] == 0)
- if (($myrow["type"] == 1 || $myrow["type"] == 21 || $myrow["type"] == 22) &&
- $balance > 0)
- {
- label_cell("<a href='$path_to_root/purchasing/allocations/supplier_allocate.php?trans_no=" .
- $myrow["trans_no"]. "&trans_type=" . $myrow["type"] . "'>" . _("Allocations") . "</a>");
- }
- else
- label_cell("");
-
- end_row();
-
- $j++;
- If ($j == 12)
- {
- $j = 1;
- table_header($th);
- }
-//end of page full new headings if
-}
-//end of while loop