- /*show a table of the deliveries returned by the sql */
-
- start_table("$table_style colspan=7 width=95%");
- $th = array(_("Delivery #"), _("Customer"), _("Branch"), _("Reference"), _("Delivery Date"),
- _("Due By"), _("Delivery Total"), _("Currency"),
- submit('BatchInvoice','Batch Inv', false),
- "", "");
- table_header($th);
-
- $j = 1;
- $k = 0; //row colour counter
- $overdue_items = false;
- while ($myrow = db_fetch($result))
- {
- $_SESSION['Batch'][] = array('trans'=>$myrow["trans_no"],
- 'cust'=>$myrow["name"],'branch'=>$myrow["br_name"] );
-
- $view_page = get_customer_trans_view_str(13, $myrow["trans_no"]);
- $formated_del_date = sql2date($myrow["tran_date"]);
- $formated_due_date = sql2date($myrow["due_date"]);
- $not_closed = $myrow["Outstanding"]!=0;
-
- // if overdue orders, then highlight as so
-
- if (date1_greater_date2(Today(), $formated_due_date) && $not_closed )
- {
- start_row("class='overduebg'");
- $overdue_items = true;
- }
- else
- {
- alt_table_row_color($k);
- }
-
- label_cell($view_page);
- label_cell($myrow["name"]);
- label_cell($myrow["br_name"]);
- label_cell($myrow["reference"]);
- label_cell($formated_del_date);
- label_cell($formated_due_date);
- amount_cell($myrow["DeliveryValue"]);
- label_cell($myrow["curr_code"]);
- if(!$myrow['Partial'])
- check_cells(null,'Sel_'. $myrow['trans_no'],0,false);
- else
- label_cell("");
- if ($_POST['OutstandingOnly'] == true || $not_closed)
- {
- $modify_page = $path_to_root . "/sales/customer_delivery.php?" . SID . "ModifyDelivery=" . $myrow["trans_no"];
- $invoice_page = $path_to_root . "/sales/customer_invoice.php?" . SID . "DeliveryNumber=" .$myrow["trans_no"];
- label_cell("<a href='$modify_page'>" . _("Edit") . "</a>");
-
- label_cell($not_closed ? "<a href='$invoice_page'>" . _("Invoice") . "</a>" : '');
-
- }
- else
- {
- label_cell("");
- label_cell("");
- }
- end_row();;
-
- $j++;
- If ($j == 12)
- {
- $j = 1;
- table_header($th);
- }
- //end of page full new headings if
- }
- //end of while loop
-
- end_table();
-
- if ($overdue_items)
- display_note(_("Marked items are overdue."), 0, 1, "class='overduefg'");