From ddfd301aaab1897a4440fc3d779d23766bf7ce5c Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 6 Jun 2008 08:09:27 +0000 Subject: [PATCH] Final fixes in html layout --- CHANGELOG.txt | 13 +++++++++ admin/create_coy.php | 2 +- gl/gl_deposit.php | 30 +++++++++++--------- gl/gl_payment.php | 6 +++- gl/manage/exchange_rates.php | 3 +- inventory/inquiry/stock_status.php | 22 +++++++------- inventory/prices.php | 24 ++++++++-------- inventory/purchasing_data.php | 28 +++++++++--------- inventory/reorder_level.php | 8 +++--- manufacturing/inquiry/where_used_inquiry.php | 14 ++++----- manufacturing/manage/bom_edit.php | 9 +++--- 11 files changed, 91 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4d11e26d..ada9ee18 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,19 @@ Legend: ! -> Note $ -> Affected files +06-Jun-2008 Joe Hunt +# Final fixes in html layout +$ /admin/create_coy.php + /gl/gl_deposit.php + /gl/gl_payment.php + /gl/manage/exchange_rates.php + /inventory/prices.php + /inventory/purchasing_date.php + /inventory/reorder_level.php + /inventory/inquiry/stock_status.php + /manufacturing/inquiry/where_used_inquiry.php + /manufacturing/manage/bom_edit.php + 05-Jun-2008 Joe Hunt ! Made an improment to the date picker. Shows the week number as well. Many delivery systems are week number based. $ /includes/ui/ui_view.inc diff --git a/admin/create_coy.php b/admin/create_coy.php index d2498b01..a54ef45f 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -311,7 +311,7 @@ function display_company_edit($selected_id) end_table(); display_note(_("Choose from Database scripts in SQL folder. No Datase is created without a script."), 0, 1); - echo "
"; + echo "
"; end_form(); diff --git a/gl/gl_deposit.php b/gl/gl_deposit.php index 3b9a3c62..3c0fc97a 100644 --- a/gl/gl_deposit.php +++ b/gl/gl_deposit.php @@ -28,7 +28,7 @@ check_db_has_bank_trans_types(_("There are no bank payment types defined in the //----------------------------------------------------------------------------------------------- -if (isset($_GET['AddedID'])) +if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = systypes::bank_deposit(); @@ -51,7 +51,7 @@ function copy_to_py() $_SESSION['deposit_items']->transfer_type = $_POST['type']; $_SESSION['deposit_items']->increase = $_POST['PayType']; if (!isset($_POST['person_id'])) - $_POST['person_id'] = ""; + $_POST['person_id'] = ""; $_SESSION['deposit_items']->person_id = $_POST['person_id']; if (!isset($_POST['PersonDetailID'])) $_POST['PersonDetailID'] = ""; @@ -88,7 +88,7 @@ function handle_new_order() $_POST['date_'] = Today(); if (!is_date_in_fiscalyear($_POST['date_'])) $_POST['date_'] = end_fiscalyear(); - $_SESSION['deposit_items']->tran_date = $_POST['date_']; + $_SESSION['deposit_items']->tran_date = $_POST['date_']; } //----------------------------------------------------------------------------------------------- @@ -98,20 +98,20 @@ if (isset($_POST['Process'])) $input_error = 0; - if (!references::is_valid($_POST['ref'])) + if (!references::is_valid($_POST['ref'])) { display_error( _("You must enter a reference.")); set_focus('ref'); $input_error = 1; - } - elseif (!is_new_reference($_POST['ref'], systypes::bank_deposit())) + } + elseif (!is_new_reference($_POST['ref'], systypes::bank_deposit())) { display_error( _("The entered reference is already in use.")); set_focus('ref'); $input_error = 1; } - if (!is_date($_POST['date_'])) + if (!is_date($_POST['date_'])) { display_error(_("The entered date for the deposit is invalid.")); set_focus('date_'); @@ -160,14 +160,14 @@ function check_item_data() return false; } - if ($_POST['code_id'] == $_POST['bank_account']) + if ($_POST['code_id'] == $_POST['bank_account']) { display_error( _("The source and destination accouts cannot be the same.")); set_focus('code_id'); return false; } - if (is_bank_account($_POST['code_id'])) + if (is_bank_account($_POST['code_id'])) { display_error( _("You cannot make a deposit from a bank account. Please use the transfer funds facility for this.")); set_focus('code_id'); @@ -183,7 +183,7 @@ function handle_update_item() { if($_POST['UpdateItem'] != "" && check_item_data()) { - $_SESSION['deposit_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'], + $_SESSION['deposit_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'], $_POST['dimension2_id'], -input_num('amount'), $_POST['LineMemo']); } } @@ -202,7 +202,7 @@ function handle_new_item() if (!check_item_data()) return; - $_SESSION['deposit_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'], + $_SESSION['deposit_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'], $_POST['dimension2_id'], -input_num('amount'), $_POST['LineMemo']); } @@ -216,7 +216,7 @@ if (isset($_GET['Delete'])) if (isset($_POST['AddItem']) || isset($_POST['UpdateItem'])) copy_to_py(); - + if (isset($_POST['AddItem'])) handle_new_item(); @@ -247,9 +247,13 @@ end_table(1); if (!isset($_POST['Process'])) { - submit_center_first('Update', _("Update")); if ($_SESSION['deposit_items']->count_gl_items() >= 1) + { + submit_center_first('Update', _("Update")); submit_center_last('Process', _("Process Deposit")); + } + else + submit_center('Update', _("Update")); } end_form(); diff --git a/gl/gl_payment.php b/gl/gl_payment.php index 12d05480..0b96feec 100644 --- a/gl/gl_payment.php +++ b/gl/gl_payment.php @@ -244,9 +244,13 @@ end_table(1); if (!isset($_POST['Process'])) { - submit_center_first('Update', _("Update")); if ($_SESSION['pay_items']->count_gl_items() >= 1) + { + submit_center_first('Update', _("Update")); submit_center_last('Process', _("Process Payment")); + } + else + submit_center('Update', _("Update")); } end_form(); diff --git a/gl/manage/exchange_rates.php b/gl/manage/exchange_rates.php index 2f0cce3c..6dfe221d 100644 --- a/gl/manage/exchange_rates.php +++ b/gl/manage/exchange_rates.php @@ -191,14 +191,15 @@ if (isset($_GET['delete'])) //--------------------------------------------------------------------------------------------- -echo "
"; start_form(false, true); if (!isset($_POST['curr_abrev'])) $_POST['curr_abrev'] = get_global_curr_code(); +echo "
"; echo _("Select a currency :") . " "; currencies_list('curr_abrev', $_POST['curr_abrev'], true); +echo "
"; // if currency sel has changed, clear the form if ($_POST['curr_abrev'] != get_global_curr_code()) diff --git a/inventory/inquiry/stock_status.php b/inventory/inquiry/stock_status.php index e9ffcf60..acaa0c0f 100644 --- a/inventory/inquiry/stock_status.php +++ b/inventory/inquiry/stock_status.php @@ -31,7 +31,7 @@ echo "
" . _("Item:"). " "; stock_items_list('stock_id', $_POST['stock_id'], false, true); echo "
"; -echo "
"; +echo "
"; set_global_stock_item($_POST['stock_id']); @@ -51,8 +51,8 @@ start_table($table_style); if ($kitset_or_service == true) { $th = array(_("Location"), _("Demand")); -} -else +} +else { $th = array(_("Location"), _("Quantity On Hand"), _("Re-Order Level"), _("Demand"), _("Available"), _("On Order")); @@ -61,7 +61,7 @@ table_header($th); $j = 1; $k = 0; //row colour counter -while ($myrow = db_fetch($loc_details)) +while ($myrow = db_fetch($loc_details)) { alt_table_row_color($k); @@ -79,8 +79,8 @@ while ($myrow = db_fetch($loc_details)) { $demand_row = db_fetch_row($demand_result); $demand_qty = $demand_row[0]; - } - else + } + else { $demand_qty =0; } @@ -100,8 +100,8 @@ while ($myrow = db_fetch($loc_details)) { $qoo_row = db_fetch_row($qoo_result); $qoo = $qoo_row[0]; - } - else + } + else { $qoo = 0; } @@ -114,8 +114,8 @@ while ($myrow = db_fetch($loc_details)) qty_cell($qoo); end_row(); - } - else + } + else { /* It must be a service or kitset part */ label_cell($myrow["location_name"]); @@ -126,7 +126,7 @@ while ($myrow = db_fetch($loc_details)) $j++; If ($j == 12) { - $j = 1; + $j = 1; table_header($th); } } diff --git a/inventory/prices.php b/inventory/prices.php index 64371bbe..81b2e2c7 100644 --- a/inventory/prices.php +++ b/inventory/prices.php @@ -44,10 +44,10 @@ if (!isset($_POST['stock_id'])) echo "
" . _("Item:"). " "; stock_items_list('stock_id', $_POST['stock_id'], false, true); -echo "
"; +echo "
"; // if stock sel has changed, clear the form -if ($_POST['stock_id'] != get_global_stock_item()) +if ($_POST['stock_id'] != get_global_stock_item()) { clear_data(); } @@ -64,10 +64,10 @@ function clear_data() //---------------------------------------------------------------------------------------------------- -if (isset($_POST['updatePrice'])) +if (isset($_POST['updatePrice'])) { - if (!check_num('price', 0)) + if (!check_num('price', 0)) { $input_error = 1; display_error( _("The price entered must be numeric.")); @@ -77,18 +77,18 @@ if (isset($_POST['updatePrice'])) if ($input_error != 1) { - if (isset($_POST['PriceID'])) + if (isset($_POST['PriceID'])) { //editing an existing price - update_item_price($_POST['PriceID'], $_POST['sales_type_id'], + update_item_price($_POST['PriceID'], $_POST['sales_type_id'], $_POST['curr_abrev'], input_num('price')); $msg = _("This price has been updated."); - } - elseif ($input_error !=1) + } + elseif ($input_error !=1) { - add_item_price($_POST['stock_id'], $_POST['sales_type_id'], + add_item_price($_POST['stock_id'], $_POST['sales_type_id'], $_POST['curr_abrev'], input_num('price')); display_note(_("The new price has been added.")); @@ -100,7 +100,7 @@ if (isset($_POST['updatePrice'])) //------------------------------------------------------------------------------------------------------ -if (isset($_GET['delete'])) +if (isset($_GET['delete'])) { //the link to delete a selected record was clicked @@ -121,7 +121,7 @@ $th = array(_("Currency"), _("Sales Type"), _("Price"), "", ""); table_header($th); $k = 0; //row colour counter -while ($myrow = db_fetch($prices_list)) +while ($myrow = db_fetch($prices_list)) { alt_table_row_color($k); @@ -138,7 +138,7 @@ end_table(); //------------------------------------------------------------------------------------------------ -if (db_num_rows($prices_list) == 0) +if (db_num_rows($prices_list) == 0) { display_note(_("There are no prices set up for this part.")); } diff --git a/inventory/purchasing_data.php b/inventory/purchasing_data.php index 80a71d14..0fd952dc 100644 --- a/inventory/purchasing_data.php +++ b/inventory/purchasing_data.php @@ -18,7 +18,7 @@ check_db_has_suppliers(_("There are no suppliers defined in the system.")); if (isset($_GET['supplier_id'])) { $supplier_id = strtoupper($_GET['supplier_id']); -} +} elseif (isset($_POST['supplier_id'])) { $supplier_id = strtoupper($_POST['supplier_id']); @@ -61,7 +61,7 @@ if ((isset($_POST['AddRecord']) || isset($_POST['UpdateRecord'])) && isset($supp $sql = "INSERT INTO ".TB_PREF."purch_data (supplier_id, stock_id, price, suppliers_uom, conversion_factor, supplier_description) VALUES ("; - $sql .= "'$supplier_id', '" . $_POST['stock_id'] . "', " . + $sql .= "'$supplier_id', '" . $_POST['stock_id'] . "', " . input_num('price') . ", '" . $_POST['suppliers_uom'] . "', " . input_num('conversion_factor') . ", '" . $_POST['supplier_description'] . "')"; @@ -117,18 +117,18 @@ if (!isset($_POST['stock_id'])) echo "
" . _("Item:"). " "; stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true); -echo "
"; +echo "
"; set_global_stock_item($_POST['stock_id']); $mb_flag = get_mb_flag($_POST['stock_id']); -if ($mb_flag == -1) +if ($mb_flag == -1) { display_error(_("Entered item is not defined. Please re-enter.")); set_focus('stock_id'); -} -else +} +else { $sql = "SELECT ".TB_PREF."purch_data.*,".TB_PREF."suppliers.supp_name,".TB_PREF."suppliers.curr_code @@ -141,8 +141,8 @@ else if (db_num_rows($result) == 0) { display_note(_("There is no purchasing data set up for the part selected")); - } - else + } + else { start_table("$table_style width=60%"); @@ -202,16 +202,16 @@ if (isset($_GET['Edit'])) echo "
"; start_table($table_style2); -if (isset($_GET['Edit'])) +if (isset($_GET['Edit'])) { hidden('supplier_id', $supplier_id); label_row(_("Supplier:"), $supp_name); -} +} else { supplier_list_row(_("Supplier:"), 'supplier_id', null, false, true); $supplier_id = $_POST['supplier_id']; -} +} amount_row(_("Price:"), 'price', null,'', get_supplier_currency($supplier_id)); text_row(_("Suppliers Unit of Measure:"), 'suppliers_uom', null, 50, 51); @@ -219,7 +219,7 @@ if (!isset($_POST['conversion_factor']) || $_POST['conversion_factor'] == "") { $_POST['conversion_factor'] = exrate_format(1); } -amount_row(_("Conversion Factor (to our UOM):"), 'conversion_factor', +amount_row(_("Conversion Factor (to our UOM):"), 'conversion_factor', exrate_format($_POST['conversion_factor']), null, null, user_exrate_dec() ); text_row(_("Supplier's Code or Description:"), 'supplier_description', null, 50, 51); @@ -228,8 +228,8 @@ end_table(1); if (isset($_GET['Edit'])) { submit_center('UpdateRecord', _("Update Purchasing Data")); -} -else +} +else { submit_center('AddRecord', _("Add Purchasing Data")); } diff --git a/inventory/reorder_level.php b/inventory/reorder_level.php index cfe3303c..a39d094e 100644 --- a/inventory/reorder_level.php +++ b/inventory/reorder_level.php @@ -31,7 +31,7 @@ if (!isset($_POST['stock_id'])) echo "
" . _("Item:"). " "; stock_costable_items_list('stock_id', $_POST['stock_id'], false, true); -echo "
"; +echo "
"; stock_item_heading($_POST['stock_id']); @@ -47,7 +47,7 @@ $k=0; //row colour counter $result = get_loc_details($_POST['stock_id']); -while ($myrow = db_fetch($result)) +while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -60,7 +60,7 @@ while ($myrow = db_fetch($result)) } $qoh = get_qoh_on_date($_POST['stock_id'], $myrow["loc_code"]); - + label_cell($myrow["location_name"]); $_POST[$myrow["loc_code"]] = qty_format($myrow["reorder_level"]); @@ -78,7 +78,7 @@ while ($myrow = db_fetch($result)) end_table(1); -submit('UpdateData', _("Update")); +submit_center('UpdateData', _("Update")); end_form(); end_page(); diff --git a/manufacturing/inquiry/where_used_inquiry.php b/manufacturing/inquiry/where_used_inquiry.php index c68b42df..0bbacaca 100644 --- a/manufacturing/inquiry/where_used_inquiry.php +++ b/manufacturing/inquiry/where_used_inquiry.php @@ -18,11 +18,11 @@ if (!isset($_POST['stock_id'])) echo "
" . _("Select an item to display its parent item(s).") . " "; stock_items_list('stock_id', $_POST['stock_id'], false, true); -echo "
"; +echo "
"; set_global_stock_item($_POST['stock_id']); -if (isset($_POST['stock_id'])) +if (isset($_POST['stock_id'])) { $sql = "SELECT ".TB_PREF."bom.*,".TB_PREF."stock_master.description,".TB_PREF."workcentres.name As WorkCentreName, ".TB_PREF."locations.location_name FROM ".TB_PREF."bom, ".TB_PREF."stock_master, ".TB_PREF."workcentres, ".TB_PREF."locations @@ -32,11 +32,11 @@ if (isset($_POST['stock_id'])) $result = db_query($sql,"No parent items were returned"); - if (db_num_rows($result) == 0) + if (db_num_rows($result) == 0) { display_note(_("The selected item is not used in any BOMs.")); - } - else + } + else { start_table("$table_style width=80%"); @@ -45,7 +45,7 @@ if (isset($_POST['stock_id'])) table_header($th); $k = $j = 0; - while ($myrow = db_fetch($result)) + while ($myrow = db_fetch($result)) { alt_table_row_color($k); @@ -57,7 +57,7 @@ if (isset($_POST['stock_id'])) label_cell($myrow["location_name"]); label_cell(qty_format($myrow["quantity"])); end_row(); - + $j++; If ($j == 12) { diff --git a/manufacturing/manage/bom_edit.php b/manufacturing/manage/bom_edit.php index 9399d99b..03af8059 100644 --- a/manufacturing/manage/bom_edit.php +++ b/manufacturing/manage/bom_edit.php @@ -139,8 +139,8 @@ function on_submit($selected_parent, $selected_component=null) elseif (!isset($selected_component) && isset($selected_parent)) { - /*Selected component is null cos no item selected on first time round - so must be adding a record must be Submitting new entries in the new + /*Selected component is null cos no item selected on first time round + so must be adding a record must be Submitting new entries in the new component form */ //need to check not recursive bom component of itself! @@ -158,8 +158,8 @@ function on_submit($selected_parent, $selected_component=null) if (db_num_rows($result) == 0) { $sql = "INSERT INTO ".TB_PREF."bom (parent, component, workcentre_added, loc_code, quantity) - VALUES ('$selected_parent', '" . $_POST['component'] . "', '" - . $_POST['workcentre_added'] . "', '" . $_POST['loc_code'] . "', " + VALUES ('$selected_parent', '" . $_POST['component'] . "', '" + . $_POST['workcentre_added'] . "', '" . $_POST['loc_code'] . "', " . input_num('quantity') . ")"; db_query($sql,"check failed"); @@ -200,6 +200,7 @@ start_form(false, true); echo "
" . _("Select a manufacturable item:") . " "; stock_bom_items_list('stock_id', null, false, true); +echo "
"; end_form(); -- 2.30.2