! -> 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
end_table();
display_note(_("Choose from Database scripts in SQL folder. No Datase is created without a script."), 0, 1);
- echo "<center><input onclick='javascript:updateCompany()' type='button' style='width:150px' value='". _("Save"). "'>";
+ echo "<center><input onclick='javascript:updateCompany()' type='button' style='width:150px' value='". _("Save"). "'></center>";
end_form();
//-----------------------------------------------------------------------------------------------
-if (isset($_GET['AddedID']))
+if (isset($_GET['AddedID']))
{
$trans_no = $_GET['AddedID'];
$trans_type = systypes::bank_deposit();
$_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'] = "";
$_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_'];
}
//-----------------------------------------------------------------------------------------------
$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_');
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');
{
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']);
}
}
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']);
}
if (isset($_POST['AddItem']) || isset($_POST['UpdateItem']))
copy_to_py();
-
+
if (isset($_POST['AddItem']))
handle_new_item();
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();
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();
//---------------------------------------------------------------------------------------------
-echo "<center>";
start_form(false, true);
if (!isset($_POST['curr_abrev']))
$_POST['curr_abrev'] = get_global_curr_code();
+echo "<center>";
echo _("Select a currency :") . " ";
currencies_list('curr_abrev', $_POST['curr_abrev'], true);
+echo "</center>";
// if currency sel has changed, clear the form
if ($_POST['curr_abrev'] != get_global_curr_code())
stock_items_list('stock_id', $_POST['stock_id'], false, true);
echo "<br>";
-echo "<hr>";
+echo "<hr></center>";
set_global_stock_item($_POST['stock_id']);
if ($kitset_or_service == true)
{
$th = array(_("Location"), _("Demand"));
-}
-else
+}
+else
{
$th = array(_("Location"), _("Quantity On Hand"), _("Re-Order Level"),
_("Demand"), _("Available"), _("On Order"));
$j = 1;
$k = 0; //row colour counter
-while ($myrow = db_fetch($loc_details))
+while ($myrow = db_fetch($loc_details))
{
alt_table_row_color($k);
{
$demand_row = db_fetch_row($demand_result);
$demand_qty = $demand_row[0];
- }
- else
+ }
+ else
{
$demand_qty =0;
}
{
$qoo_row = db_fetch_row($qoo_result);
$qoo = $qoo_row[0];
- }
- else
+ }
+ else
{
$qoo = 0;
}
qty_cell($qoo);
end_row();
- }
- else
+ }
+ else
{
/* It must be a service or kitset part */
label_cell($myrow["location_name"]);
$j++;
If ($j == 12)
{
- $j = 1;
+ $j = 1;
table_header($th);
}
}
echo "<center>" . _("Item:"). " ";
stock_items_list('stock_id', $_POST['stock_id'], false, true);
-echo "<hr>";
+echo "<hr></center>";
// 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();
}
//----------------------------------------------------------------------------------------------------
-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."));
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."));
//------------------------------------------------------------------------------------------------------
-if (isset($_GET['delete']))
+if (isset($_GET['delete']))
{
//the link to delete a selected record was clicked
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);
//------------------------------------------------------------------------------------------------
-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."));
}
if (isset($_GET['supplier_id']))
{
$supplier_id = strtoupper($_GET['supplier_id']);
-}
+}
elseif (isset($_POST['supplier_id']))
{
$supplier_id = strtoupper($_POST['supplier_id']);
$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'] . "')";
echo "<center>" . _("Item:"). " ";
stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true);
-echo "<hr><center>";
+echo "<hr></center>";
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
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%");
echo "<br>";
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);
{
$_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);
if (isset($_GET['Edit']))
{
submit_center('UpdateRecord', _("Update Purchasing Data"));
-}
-else
+}
+else
{
submit_center('AddRecord', _("Add Purchasing Data"));
}
echo "<center>" . _("Item:"). " ";
stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
-echo "<hr>";
+echo "<hr></center>";
stock_item_heading($_POST['stock_id']);
$result = get_loc_details($_POST['stock_id']);
-while ($myrow = db_fetch($result))
+while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
}
$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"]);
end_table(1);
-submit('UpdateData', _("Update"));
+submit_center('UpdateData', _("Update"));
end_form();
end_page();
echo "<center>" . _("Select an item to display its parent item(s).") . " ";
stock_items_list('stock_id', $_POST['stock_id'], false, true);
-echo "<hr><center>";
+echo "<hr></center>";
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
$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%");
table_header($th);
$k = $j = 0;
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
label_cell($myrow["location_name"]);
label_cell(qty_format($myrow["quantity"]));
end_row();
-
+
$j++;
If ($j == 12)
{
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!
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");
echo "<center>" . _("Select a manufacturable item:") . " ";
stock_bom_items_list('stock_id', null, false, true);
+echo "</center>";
end_form();