From: Joe Hunt Date: Sat, 31 May 2008 10:45:25 +0000 (+0000) Subject: A lot of annoying layout bugs taken. Mostly from views and inquiries. X-Git-Tag: v2.4.2~19^2~2051 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=72af4496f87c438dc85a0a7573d36b7bd9e49624;p=fa-stable.git A lot of annoying layout bugs taken. Mostly from views and inquiries. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6be84cd0..65d575cf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,20 @@ Legend: ! -> Note $ -> Affected files +31-May-2008 Joe Hunt +# A lot of annoying layout bugs taken. Mostly from views and inquiries. A couple of files are critical, ui_view and ui_lists! +$ /gl/view/gl_deposit_view.php + /gl/view/gl_payment_view.php + /includes/ui/ui_controls.inc + /includes/ui/ui_lists.inc + /includes/ui/ui_view.inc + /manufacturing/work_order_add_finished.php + /manufacturing/includes/manufacturing_ui.inc + /manufacturing/view/work_order_view.php + /manufacturing/view/wo_issue_view.php + /sales/inquiry/customer_allocation_inquiry.php + /sales/inquiry/customer_inquiry.php + 30-May-2008 Joe Hunt # Fixed bug in 2 files regarding stock movements. Moved from Invoice to Delivery. $ /inventory/inquiry/stock_movements.php diff --git a/gl/view/gl_deposit_view.php b/gl/view/gl_deposit_view.php index fd9b7462..c7837a36 100644 --- a/gl/view/gl_deposit_view.php +++ b/gl/view/gl_deposit_view.php @@ -29,7 +29,7 @@ $company_currency = get_company_currency(); $show_currencies = false; -if ($to_trans['bank_curr_code'] != $company_currency) +if ($to_trans['bank_curr_code'] != $company_currency) { $show_currencies = true; } @@ -75,9 +75,9 @@ $items = get_gl_trans(systypes::bank_deposit(), $trans_no); if (db_num_rows($items) == 0) { - echo "
" . _("There are no items for this deposit."); -} -else + display_note(_("There are no items for this deposit."))"; +} +else { display_heading2(_("Items for this Deposit")); @@ -87,15 +87,15 @@ else start_table("$table_style width=80%"); $th = array(_("Account Code"), _("Account Description"), _("Amount"), _("Memo")); - table_header($th); + table_header($th); $k = 0; //row colour counter $total_amount = 0; - while ($item = db_fetch($items)) + while ($item = db_fetch($items)) { - if ($item["account"] != $to_trans["account_code"]) + if ($item["account"] != $to_trans["account_code"]) { alt_table_row_color($k); diff --git a/gl/view/gl_payment_view.php b/gl/view/gl_payment_view.php index 0d7c51e7..f52dc672 100644 --- a/gl/view/gl_payment_view.php +++ b/gl/view/gl_payment_view.php @@ -29,7 +29,7 @@ $company_currency = get_company_currency(); $show_currencies = false; -if ($from_trans['bank_curr_code'] != $company_currency) +if ($from_trans['bank_curr_code'] != $company_currency) { $show_currencies = true; } @@ -73,9 +73,9 @@ $items = get_gl_trans(systypes::bank_payment(), $trans_no); if (db_num_rows($items)==0) { - echo "
" . _("There are no items for this payment."); -} -else + display_note(_("There are no items for this payment.")); +} +else { display_heading2(_("Items for this Payment")); @@ -91,10 +91,10 @@ else $k = 0; //row colour counter $totalAmount = 0; - while ($item = db_fetch($items)) + while ($item = db_fetch($items)) { - if ($item["account"] != $from_trans["account_code"]) + if ($item["account"] != $from_trans["account_code"]) { alt_table_row_color($k); diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 9d52934f..20d191f4 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -63,7 +63,8 @@ function hyperlink_back($center=true) { if ($center) echo "
"; - echo ""._("Back")."\n"; + //echo ""._("Back")."\n"; + echo "

"._("Back")."

\n"; if ($center) echo "
"; echo "
"; diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 8e424542..1c08e25c 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -77,6 +77,7 @@ function supplier_list($name, $selected_id, $all_option=false, $submit_on_change if ($selected_id == "") { $selected_id = $all_items; + $_POST[$name] = $selected_id; } } @@ -187,6 +188,7 @@ function customer_list($name, $selected_id, $all_option=false, $submit_on_change if ($selected_id == "") { $selected_id = $all_items; + $_POST[$name] = $selected_id; } } while ($customer_row = db_fetch_row($customer_result)) @@ -669,6 +671,7 @@ function stock_items_list($name, $selected_id, $all_option=false, $submit_on_cha if ($selected_id == "") { $selected_id = $all_items; + $_POST[$name] = $selected_id; } } @@ -953,6 +956,7 @@ function stock_purchasable_items_list($name, &$selected_id, $all_option=false, $ if ($selected_id == "") { $selected_id = $all_items; + $_POST[$name] = $selected_id; } } diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index ee24d8ed..3e6d3c4e 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -595,7 +595,7 @@ function get_js_date_picker() #CCIframe { display: none; left: 0px; position: absolute; top: 0px; height: 250px; width: 250px; z-index: 99;} #CC { position:absolute; background-color:#FFF; margin:0; padding:0; display:none; z-index: 100;} #CC table { font-family: arial, verdana, helvetica, sans-serif;font-size: 8pt; border-left: 1px solid #336; border-right: 1px solid #336;} -#CC th { font-weight: normal;} +#CC th { font-weight: normal; text-align: center;} #CC th a { font-weight: normal; text-decoration: none; color: #FFF; padding: 1px;} #CC td { text-align: center;} #CC .header { background-color: #336;} diff --git a/manufacturing/includes/manufacturing_ui.inc b/manufacturing/includes/manufacturing_ui.inc index b903d2c8..eb14c8a1 100644 --- a/manufacturing/includes/manufacturing_ui.inc +++ b/manufacturing/includes/manufacturing_ui.inc @@ -13,8 +13,8 @@ function display_bom($item_check) if (db_num_rows($result) == 0) { display_note(_("The bill of material for this item is empty."), 0, 1); - } - else + } + else { start_table($table_style); @@ -28,7 +28,7 @@ function display_bom($item_check) $total_cost = 0; - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -68,8 +68,8 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null) if (db_num_rows($result) == 0) { display_note(_("There are no Requirements for this Order."), 1, 0); - } - else + } + else { start_table("$table_style width=80%"); @@ -84,7 +84,7 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null) if ($date == null) $date = Today(); - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { $qoh = 0; @@ -96,13 +96,13 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null) if ($show_qoh) $qoh = get_qoh_on_date($myrow["stock_id"], $myrow["loc_code"], $date); - if ($show_qoh && ($myrow["units_req"] * $quantity > $qoh) && - !sys_prefs::allow_negative_stock()) + if ($show_qoh && ($myrow["units_req"] * $quantity > $qoh) && + !sys_prefs::allow_negative_stock()) { // oops, we don't have enough of one of the component items start_row("class='stockmankobg'"); $has_marked = true; - } + } else alt_table_row_color($k); @@ -142,8 +142,8 @@ function display_wo_productions($woid) if (db_num_rows($result) == 0) { display_note(_("There are no Productions for this Order."), 1, 1); - } - else + } + else { start_table($table_style); $th = array(_("#"), _("Reference"), _("Date"), _("Quantity")); @@ -153,7 +153,7 @@ function display_wo_productions($woid) $k = 0; //row colour counter $total_qty = 0; - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -167,7 +167,7 @@ function display_wo_productions($woid) end_row(); }//end of while - label_row(_("Total"), number_format2($total_qty,user_qty_dec()), + label_row(_("Total"), number_format2($total_qty,user_qty_dec()), "colspan=3", "nowrap align=right"); end_table(); @@ -185,8 +185,8 @@ function display_wo_issues($woid) if (db_num_rows($result) == 0) { display_note(_("There are no Issues for this Order."), 0, 1); - } - else + } + else { start_table($table_style); $th = array(_("#"), _("Reference"), _("Date")); @@ -195,7 +195,7 @@ function display_wo_issues($woid) $k = 0; //row colour counter - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -220,9 +220,9 @@ function display_wo_payments($woid) if (db_num_rows($result) == 0) { - echo _("There are no Payments for this Order.") . "
"; - } - else + display_note(_("There are no Payments for this Order."), 0, 1); + } + else { start_table($table_style); $th = array(_("#"), _("Reference"), _("Date"), _("Amount")); @@ -231,7 +231,7 @@ function display_wo_payments($woid) $k = 0; //row colour counter - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -256,7 +256,7 @@ function display_wo_details($woid, $suppress_view_link=false) $myrow = get_work_order($woid); - if (strlen($myrow[0]) == 0) + if (strlen($myrow[0]) == 0) { display_note(_("The work order number sent is not valid.")); exit; @@ -264,11 +264,11 @@ function display_wo_details($woid, $suppress_view_link=false) start_table("$table_style width=80%"); - if ($myrow["released"] == true) + if ($myrow["released"] == true) $th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"), _("Into Location"), _("Date"), _("Required By"), _("Quantity Required"), _("Released Date"), _("Manufactured")); - else + else $th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"), _("Into Location"), _("Date"), _("Required By"), _("Quantity Required")); @@ -287,7 +287,7 @@ function display_wo_details($woid, $suppress_view_link=false) qty_cell($myrow["units_reqd"]); - if ($myrow["released"] == true) + if ($myrow["released"] == true) { label_cell(sql2date($myrow["released_date"])); qty_cell($myrow["units_issued"]); @@ -298,7 +298,7 @@ function display_wo_details($woid, $suppress_view_link=false) end_table(); - if ($myrow["closed"] == true) + if ($myrow["closed"] == true) { display_note(_("This work order is closed.")); } @@ -312,7 +312,7 @@ function display_wo_details_quick($woid, $suppress_view_link=false) $myrow = get_work_order($woid); - if (strlen($myrow[0]) == 0) + if (strlen($myrow[0]) == 0) { display_note(_("The work order number sent is not valid.")); exit; @@ -322,7 +322,7 @@ function display_wo_details_quick($woid, $suppress_view_link=false) $th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"), _("Into Location"), _("Date"), _("Quantity")); - table_header($th); + table_header($th); start_row(); if ($suppress_view_link) @@ -343,7 +343,7 @@ function display_wo_details_quick($woid, $suppress_view_link=false) end_table(); - if ($myrow["closed"] == true) + if ($myrow["closed"] == true) { display_note(_("This work order is closed.")); } diff --git a/manufacturing/view/wo_issue_view.php b/manufacturing/view/wo_issue_view.php index 19b62bc0..484b08ec 100644 --- a/manufacturing/view/wo_issue_view.php +++ b/manufacturing/view/wo_issue_view.php @@ -4,7 +4,10 @@ $page_security = 10; $path_to_root="../.."; include_once($path_to_root . "/includes/session.inc"); -page(_("View Work Order Issue"), true); +$js = ""; +if ($use_popup_windows) + $js .= get_js_open_window(900, 500); +page(_("View Work Order Issue"), true, false, "", $js); include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/manufacturing.inc"); @@ -15,7 +18,7 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc"); //------------------------------------------------------------------------------------------------- -if ($_GET['trans_no'] != "") +if ($_GET['trans_no'] != "") { $wo_issue_no = $_GET['trans_no']; } @@ -31,7 +34,7 @@ function display_wo_issue($issue_no) start_table($table_style); $th = array(_("Issue #"), _("Reference"), _("For Work Order #"), _("Item"), _("From Location"), _("To Work Centre"), _("Date of Issue")); - table_header($th); + table_header($th); start_row(); label_cell($myrow["issue_no"]); @@ -60,9 +63,9 @@ function display_wo_issue_details($issue_no) if (db_num_rows($result) == 0) { - echo "
" . _("There are no items for this issue."); - } - else + display_note(_("There are no items for this issue.")); + } + else { start_table($table_style); $th = array(_("Component"), _("Quantity"), _("Units")); @@ -74,7 +77,7 @@ function display_wo_issue_details($issue_no) $total_cost = 0; - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); diff --git a/manufacturing/view/work_order_view.php b/manufacturing/view/work_order_view.php index fb28310c..d63f2de3 100644 --- a/manufacturing/view/work_order_view.php +++ b/manufacturing/view/work_order_view.php @@ -18,8 +18,8 @@ page(_("View Work Order"), true, false, "", $js); //------------------------------------------------------------------------------------------------- $woid = 0; -if ($_GET['trans_no'] != "") -{ +if ($_GET['trans_no'] != "") +{ $woid = $_GET['trans_no']; } @@ -34,33 +34,33 @@ else echo "
"; -// display the WO requirements +// display the WO requirements echo "
"; -if ($myrow["released"] == false) -{ +if ($myrow["released"] == false) +{ display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]); display_bom($myrow["stock_id"]); -} -else +} +else { - display_heading2(_("Work Order Requirements")); + display_heading2(_("Work Order Requirements")); display_wo_requirements($woid, $myrow["units_reqd"]); - if ($myrow["type"] == wo_types::advanced()) - { + if ($myrow["type"] == wo_types::advanced()) + { echo "
"; - display_heading2(_("Issues")); + display_heading2(_("Issues")); display_wo_issues($woid); echo ""; display_heading2(_("Productions")); display_wo_productions($woid); echo ""; display_heading2(_("Payments")); - display_wo_payments($woid); + display_wo_payments($woid); echo "
"; - } + } } -echo "
"; +echo "
"; is_voided_display(systypes::work_order(), $woid, _("This work order has been voided.")); diff --git a/manufacturing/work_order_add_finished.php b/manufacturing/work_order_add_finished.php index 9cb56074..545b694b 100644 --- a/manufacturing/work_order_add_finished.php +++ b/manufacturing/work_order_add_finished.php @@ -12,6 +12,8 @@ include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc"); include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc"); $js = ""; +if ($use_popup_windows) + $js .= get_js_open_window(900, 500); if ($use_date_picker) $js .= get_js_date_picker(); page(_("Produce or Unassemble Finished Items From Work Order"), false, false, "", $js); @@ -23,7 +25,7 @@ if (isset($_GET['trans_no']) && $_GET['trans_no'] != "") //-------------------------------------------------------------------------------------------------- -if (isset($_GET['AddedID'])) +if (isset($_GET['AddedID'])) { display_note(_("The manufacturing process has been entered.")); @@ -38,7 +40,7 @@ if (isset($_GET['AddedID'])) $wo_details = get_work_order($_POST['selected_id']); -if (strlen($wo_details[0]) == 0) +if (strlen($wo_details[0]) == 0) { display_error(_("The order number sent is not valid.")); exit; @@ -50,14 +52,14 @@ function can_process() { global $wo_details; - if (!references::is_valid($_POST['ref'])) + if (!references::is_valid($_POST['ref'])) { display_error(_("You must enter a reference.")); set_focus('ref'); return false; } - if (!is_new_reference($_POST['ref'], 29)) + if (!is_new_reference($_POST['ref'], 29)) { display_error(_("The entered reference is already in use.")); set_focus('ref'); @@ -76,14 +78,14 @@ function can_process() display_error(_("The entered date is invalid.")); set_focus('date_'); return false; - } - elseif (!is_date_in_fiscalyear($_POST['date_'])) + } + elseif (!is_date_in_fiscalyear($_POST['date_'])) { display_error(_("The entered date is not in fiscal year.")); set_focus('date_'); return false; } - if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) + if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) { display_error(_("The production date cannot be before the release date of the work order.")); set_focus('date_'); @@ -96,7 +98,7 @@ function can_process() $wo_details = get_work_order($_POST['selected_id']); $qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $date_); - if (-$_POST['quantity'] + $qoh < 0) + if (-$_POST['quantity'] + $qoh < 0) { display_error(_("The unassembling cannot be processed because there is insufficient stock.")); set_focus('quantity'); @@ -109,7 +111,7 @@ function can_process() //-------------------------------------------------------------------------------------------------- -if (isset($_POST['Process']) || (isset($_POST['ProcessAndClose']) && can_process() == true)) +if (isset($_POST['Process']) || (isset($_POST['ProcessAndClose']) && can_process() == true)) { $close_wo = 0; @@ -137,7 +139,7 @@ start_form(); hidden('selected_id', $_POST['selected_id']); //hidden('WOReqQuantity', $_POST['WOReqQuantity']); -if (!isset($_POST['quantity']) || $_POST['quantity'] == '') +if (!isset($_POST['quantity']) || $_POST['quantity'] == '') { $_POST['quantity'] = max($wo_details["units_reqd"] - $wo_details["units_issued"], 0); } diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index b0252561..c20262d5 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -185,8 +185,7 @@ while ($myrow = db_fetch($result)) } label_cell(systypes::name($myrow["type"])); - - label_cell(get_customer_trans_view_str($myrow["type"], $myrow["trans_no"])); + label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"])); label_cell($myrow["reference"]); label_cell($preview_order_str); label_cell(sql2date($myrow["tran_date"]), "nowrap"); diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index db68dfdd..ab2cdd61 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -29,8 +29,9 @@ if (!isset($_POST['customer_id'])) $_POST['customer_id'] = get_global_customer(); start_table("class='tablestyle_noborder'"); +start_row(); -customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true); +customer_list_cells(_("Select a customer: "), 'customer_id', null, true); date_cells(_("From:"), 'TransAfterDate', null, -30); date_cells(_("To:"), 'TransToDate', null, 1); @@ -41,7 +42,7 @@ if (!isset($_POST['filterType'])) cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true); submit_cells('Refresh Inquiry', _("Search")); - +end_row(); end_table(); end_form(); @@ -145,8 +146,7 @@ function get_transactions() } //------------------------------------------------------------------------------------------------ - -if (($_POST['customer_id'] != "") && ($_POST['customer_id'] != reserved_words::get_all())) +if ($_POST['customer_id'] != "" && $_POST['customer_id'] != reserved_words::get_all()) { $customer_record = get_customer_details($_POST['customer_id']); display_customer_summary($customer_record);