case 11: if ($myrow['order_'] == 0) { // free-hand credit note $edit_page = $path_to_root . '/sales/credit_note_entry.php?ModifyCredit=' . $myrow['trans_no']; } else { // credit invoice $edit_page = $path_to_root . '/sales/customer_credit_invoice.php?' . 'ModifyCredit=' . $myrow['trans_no']; } break; case 13: $edit_page = $path_to_root . '/sales/customer_delivery.php?ModifyDelivery=' . $myrow['trans_no']; break; } $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 = ""; } $gl_trans_str = get_gl_view_str_cell($myrow["type"], $myrow["trans_no"]); $branch_name = ""; if ($myrow["branch_code"] > 0) { $branch_name = get_branch_name($myrow["branch_code"]); } $preview_trans_str = get_trans_view_str($myrow["type"], $myrow["trans_no"]); label_cell(systypes::name($myrow["type"])); label_cell($preview_trans_str); label_cell($preview_order_str); label_cell($myrow["reference"]); label_cell($date, "nowrap"); label_cell($due_date_str, "nowrap");
function handle_search() { global $table_style; if (check_valid_entries() == true) { $db_info = get_systype_db_info($_POST['filterType']); if ($db_info == null) { return; } $table_name = $db_info[0]; $type_name = $db_info[1]; $trans_no_name = $db_info[2]; $trans_ref = $db_info[3]; $sql = "SELECT DISTINCT {$trans_no_name} "; if ($trans_ref) { $sql .= " ,{$trans_ref} "; } $sql .= " FROM {$table_name}\n\t\t\tWHERE {$trans_no_name} >= " . $_POST['FromTransNo'] . "\n\t\t\tAND {$trans_no_name} <= " . $_POST['ToTransNo']; if ($type_name != null) { $sql .= " AND {$type_name} = " . $_POST['filterType']; } $sql .= " ORDER BY {$trans_no_name}"; $result = db_query($sql, "could not query transactions on {$table_name}"); if (db_num_rows($result) == 0) { echo tr("There are no transactions for the given parameters."); return; } $print_type = $_POST['filterType']; $print_out = $print_type == 10 || $print_type == 11 || $print_type == systypes::cust_dispatch() || $print_type == systypes::po() || $print_type == systypes::sales_order(); if ($print_out) { print_hidden_script($print_type); if ($trans_ref) { $th = array(tr("#"), tr("Reference"), tr("View"), tr("Print"), tr("GL")); } else { $th = array(tr("#"), tr("View"), tr("Print"), tr("GL")); } } else { if ($trans_ref) { $th = array(tr("#"), tr("Reference"), tr("View"), tr("GL")); } else { $th = array(tr("#"), tr("View"), tr("GL")); } } start_table($table_style); table_header($th); $k = 0; while ($line = db_fetch($result)) { alt_table_row_color($k); label_cell($line[$trans_no_name]); if ($trans_ref) { label_cell($line[$trans_ref]); } label_cell(get_trans_view_str($_POST['filterType'], $line[$trans_no_name], tr("View"))); if ($print_out) { label_cell(print_document_link($line[$trans_no_name], tr("Print"), true, $print_type)); } label_cell(get_gl_view_str($_POST['filterType'], $line[$trans_no_name], tr("View GL"))); end_row(); } end_table(); } }
if ($_POST['order_view_mode'] == 'InvoiceTemplates' || $_POST['order_view_mode'] == 'DeliveryTemplates') { $th[3] = tr('Description'); } elseif ($_POST['order_view_mode'] != 'OutstandingOnly') { $th[9] = tr('Tmpl'); $th[] = ''; $th[] = ''; $th[] = ''; } table_header($th); start_form(); $j = 1; $k = 0; //row colour counter $overdue_items = false; while ($myrow = db_fetch($result)) { $view_page = get_customer_trans_view_str(systypes::sales_order(), $myrow["order_no"]); $formated_del_date = sql2date($myrow["delivery_date"]); $formated_order_date = sql2date($myrow["ord_date"]); // $not_closed = $myrow['type'] && ($myrow["TotDelivered"] < $myrow["TotQuantity"]); // if overdue orders, then highlight as so if ($myrow['type'] == 0 && date1_greater_date2(Today(), $formated_del_date)) { 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"]); if ($_POST['order_view_mode'] == 'InvoiceTemplates' || $_POST['order_view_mode'] == 'DeliveryTemplates') { label_cell($myrow["comments"]);
label_row(null, $branch["br_name"] . "<br>" . nl2br($branch["br_address"]), "nowrap"); end_table(); echo "</td><td>"; // outer table start_table("{$table_style} width=100%"); $th = array(tr("Delivered To")); table_header($th); label_row(null, $sales_order["deliver_to"] . "<br>" . nl2br($sales_order["delivery_address"]), "nowrap"); end_table(); echo "</td><td>"; // outer table start_table("{$table_style} width=100%"); start_row(); label_cells(tr("Reference"), $myrow["reference"], "class='tableheader2'"); label_cells(tr("Currency"), $sales_order["curr_code"], "class='tableheader2'"); label_cells(tr("Our Order No"), get_customer_trans_view_str(systypes::sales_order(), $sales_order["order_no"]), "class='tableheader2'"); end_row(); start_row(); label_cells(tr("Customer Order Ref."), $sales_order["customer_ref"], "class='tableheader2'"); label_cells(tr("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'"); label_cells(tr("Sales Type"), $myrow["sales_type"], "class='tableheader2'"); end_row(); start_row(); label_cells(tr("Dispatch Date"), sql2date($myrow["tran_date"]), "class='tableheader2'", "nowrap"); label_cells(tr("Due Date"), sql2date($myrow["due_date"]), "class='tableheader2'", "nowrap"); end_row(); comments_display_row(13, $trans_id); end_table(); echo "</td></tr>"; end_table(1); // outer table
// outer table start_table("{$table_style} width=100%"); start_row(); label_cells(tr("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'"); label_cells(tr("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'"); label_cells(tr("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'"); end_row(); start_row(); //if (!isset($_POST['ref'])) // $_POST['ref'] = references::get_next(13); if ($_SESSION['Items']->trans_no == 0) { ref_cells(tr("Reference"), 'ref', $_SESSION['Items']->reference, "class='tableheader2'"); } else { label_cells(tr("Reference"), $_SESSION['Items']->reference, "class='tableheader2'"); } label_cells(tr("For Sales Order"), get_customer_trans_view_str(systypes::sales_order(), $_SESSION['Items']->order_no), "class='tableheader2'"); label_cells(tr("Sales Type"), $_SESSION['Items']->sales_type_name, "class='tableheader2'"); end_row(); start_row(); if (!isset($_POST['Location'])) { $_POST['Location'] = $_SESSION['Items']->Location; } label_cell(tr("Delivery From"), "class='tableheader2'"); locations_list_cells(null, 'Location', $_POST['Location'], false, true); if (!isset($_POST['ship_via'])) { $_POST['ship_via'] = $_SESSION['Items']->ship_via; } label_cell(tr("Shipping Company"), "class='tableheader2'"); shippers_list_cells(null, 'ship_via', $_POST['ship_via']); // set this up here cuz it's used to calc qoh if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {