projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor fixes in the former files
[fa-stable.git]
/
inventory
/
transfers.php
diff --git
a/inventory/transfers.php
b/inventory/transfers.php
index e9e931faeab6829423c84511d8d87636554a192c..c28604c0be9a6803bbf013de67cdbe0655149a5c 100644
(file)
--- a/
inventory/transfers.php
+++ b/
inventory/transfers.php
@@
-14,6
+14,8
@@
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
$js = "";
if ($use_popup_windows)
$js .= get_js_open_window(800, 500);
$js = "";
if ($use_popup_windows)
$js .= get_js_open_window(800, 500);
+if ($use_date_picker)
+ $js .= get_js_date_picker();
page(_("Inventory Location Transfers"), false, false, "", $js);
page(_("Inventory Location Transfers"), false, false, "", $js);
@@
-89,26
+91,31
@@
if (isset($_POST['Process']))
if (!references::is_valid($_POST['ref']))
{
display_error(_("You must enter a reference."));
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::location_transfer()))
{
display_error(_("The entered reference is already in use."));
$input_error = 1;
}
elseif (!is_new_reference($_POST['ref'], systypes::location_transfer()))
{
display_error(_("The entered reference is already in use."));
+ set_focus('ref');
$input_error = 1;
}
elseif (!is_date($_POST['AdjDate']))
{
display_error(_("The entered date for the adjustment is invalid."));
$input_error = 1;
}
elseif (!is_date($_POST['AdjDate']))
{
display_error(_("The entered date for the adjustment is invalid."));
+ set_focus('AdjDate');
$input_error = 1;
}
elseif (!is_date_in_fiscalyear($_POST['AdjDate']))
{
display_error(_("The entered date is not in fiscal year."));
$input_error = 1;
}
elseif (!is_date_in_fiscalyear($_POST['AdjDate']))
{
display_error(_("The entered date is not in fiscal year."));
+ set_focus('AdjDate');
$input_error = 1;
}
elseif ($_POST['FromStockLocation'] == $_POST['ToStockLocation'])
{
display_error(_("The locations to transfer from and to must be different."));
$input_error = 1;
}
elseif ($_POST['FromStockLocation'] == $_POST['ToStockLocation'])
{
display_error(_("The locations to transfer from and to must be different."));
+ set_focus('FromStockLocation');
$input_error = 1;
}
else
$input_error = 1;
}
else
@@
-146,15
+153,17
@@
if (isset($_POST['Process']))
function check_item_data()
{
function check_item_data()
{
- if (!
is_numeric($_POST['qty']) || ($_POST['qty'] == 0
))
+ if (!
check_num('qty'
))
{
display_error( _("The quantity entered is not a valid number."));
{
display_error( _("The quantity entered is not a valid number."));
+ set_focus('qty');
return false;
}
return false;
}
- if (
$_POST['qty'] <= 0
)
+ if (
!check_num('qty', 0)
)
{
display_error(_("The quantity entered must be a positive number."));
{
display_error(_("The quantity entered must be a positive number."));
+ set_focus('qty');
return false;
}
return false;
}
@@
-169,7
+178,7
@@
function handle_update_item()
{
if (!isset($_POST['std_cost']))
$_POST['std_cost'] = $_SESSION['transfer_items']->line_items[$_POST['stock_id']]->standard_cost;
{
if (!isset($_POST['std_cost']))
$_POST['std_cost'] = $_SESSION['transfer_items']->line_items[$_POST['stock_id']]->standard_cost;
- $_SESSION['transfer_items']->update_cart_item($_POST['stock_id'],
$_POST['qty']
, $_POST['std_cost']);
+ $_SESSION['transfer_items']->update_cart_item($_POST['stock_id'],
input_num('qty')
, $_POST['std_cost']);
}
}
}
}
@@
-188,7
+197,7
@@
function handle_new_item()
return;
if (!isset($_POST['std_cost']))
$_POST['std_cost'] = 0;
return;
if (!isset($_POST['std_cost']))
$_POST['std_cost'] = 0;
- add_to_order($_SESSION['transfer_items'], $_POST['stock_id'],
$_POST['qty']
, $_POST['std_cost']);
+ add_to_order($_SESSION['transfer_items'], $_POST['stock_id'],
input_num('qty')
, $_POST['std_cost']);
}
//-----------------------------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------------------------