-
- if ($myrow['OverDue'] == 1 && (abs($myrow["TotalAmount"]) - $myrow["Allocated"] != 0))
- {
- start_row("class='overduebg'");
- $over_due = true;
- }
- else
- alt_table_row_color($k);
-
- $date = sql2date($myrow["tran_date"]);
-
- if ($myrow["order_"] > 0)
- $preview_order_str = get_customer_trans_view_str(systypes::sales_order(), $myrow["order_"]);
- else
- $preview_order_str = "";
-
- $allocations_str = "";
-
- $allocations = "<a href='$path_to_root/sales/allocations/customer_allocate.php?trans_no=" . $myrow["trans_no"] ."&trans_type=" . $myrow["type"] ."'>" . _("Allocation") . "</a>";
-
- $due_date_str = "";
-
- if ($myrow["type"] == 10)
- $due_date_str = sql2date($myrow["due_date"]);
- elseif ($myrow["type"] == 11 && $myrow['TotalAmount'] < 0)
- {
- /*its a credit note which could have an allocation */
- $allocations_str = $allocations;
-
- }
- elseif ($myrow["type"] == systypes::cust_payment() &&
- ($myrow['TotalAmount'] + $myrow['Allocated']) < 0)
- {
- /*its a receipt which could have an allocation*/
- $allocations_str = $allocations;
-
- }
- elseif ($myrow["type"] == systypes::cust_payment() && $myrow['TotalAmount'] > 0)
- {
- /*its a negative receipt */
- }
-
- label_cell(systypes::name($myrow["type"]));
-
- label_cell(get_customer_trans_view_str($myrow["type"], $myrow["trans_no"]));
- label_cell($myrow["reference"]);
- label_cell($preview_order_str);
- label_cell(sql2date($myrow["tran_date"]), "nowrap");
- label_cell($due_date_str, "nowrap");
- if ($_POST['customer_id'] == reserved_words::get_all())
- {
- label_cell($myrow["CustName"]);
- label_cell($myrow["CustCurrCode"]);
- }
- display_debit_or_credit_cells($myrow["TotalAmount"]);
- amount_cell(abs($myrow["Allocated"]));
- amount_cell(abs($myrow["TotalAmount"]) - $myrow["Allocated"]);
- label_cell($allocations_str);
-
-
- end_row();
-
- $j++;
- If ($j == 12)
- {
- $j = 1;
- table_header($th);
- }
-//end of page full new headings if