-div_start('trans_tbl');
-if (db_num_rows($result) == 0)
-{
- display_note(_("There are no transactions to display for the given dates."), 1, 1);
-} else
-{
- start_table("$table_style width=80%");
- if ($_POST['supplier_id'] == reserved_words::get_all())
- $th = array(_("Type"), _("#"), _("Reference"), _("Supplier"),
- _("Supplier's Reference"), _("Date"), _("Due Date"), _("Currency"),
- _("Debit"), _("Credit"), "");
- else
- $th = array(_("Type"), _("#"), _("Reference"),
- _("Supplier's Reference"), _("Date"), _("Due Date"),
- _("Debit"), _("Credit"), "");
- 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(get_trans_view_str($myrow["type"],$myrow["trans_no"], $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("");
-
- label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
-
- end_row();
-
- $j++;
- If ($j == 12)
- {
- $j=1;
- table_header($th);
- }
- //end of page full new headings if
- }
- //end of while loop
-
- end_table(1);
- if ($over_due)
- display_note(_("Marked items are overdue."), 0, 1, "class='overduefg'");