projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug in /includes/ui/ui_lists.inc:914. Sql clause was cut.
[fa-stable.git]
/
gl
/
gl_payment.php
diff --git
a/gl/gl_payment.php
b/gl/gl_payment.php
index c1771cdf6ec5fecf1d191e8e89a17422779f1930..12d05480f5dbf4b393e2b70947b296f85fc4879b 100644
(file)
--- a/
gl/gl_payment.php
+++ b/
gl/gl_payment.php
@@
-12,13
+12,13
@@
include_once($path_to_root . "/gl/includes/ui/gl_payment_ui.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/gl/includes/gl_ui.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/gl/includes/gl_ui.inc");
-$js =
get_js_form_entry("CodeID2", "code_id", "amount")
;
+$js =
''
;
if ($use_popup_windows)
$js .= get_js_open_window(800, 500);
if ($use_date_picker)
$js .= get_js_date_picker();
if ($use_popup_windows)
$js .= get_js_open_window(800, 500);
if ($use_date_picker)
$js .= get_js_date_picker();
-
$js .= get_js_
set_focus('CodeID2');
-page(_("Bank Account Payment Entry"), false, false,
"setFocus()"
, $js);
+set_focus('CodeID2');
+page(_("Bank Account Payment Entry"), false, false,
''
, $js);
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
@@
-102,21
+102,25
@@
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::bank_payment()))
{
display_error( _("The entered reference is already in use."));
$input_error = 1;
}
elseif (!is_new_reference($_POST['ref'], systypes::bank_payment()))
{
display_error( _("The entered reference is already in use."));
+ set_focus('ref');
$input_error = 1;
}
elseif (!is_date($_POST['date_']))
{
display_error(_("The entered date for the payment is invalid."));
$input_error = 1;
}
elseif (!is_date($_POST['date_']))
{
display_error(_("The entered date for the payment is invalid."));
+ set_focus('date_');
$input_error = 1;
}
elseif (!is_date_in_fiscalyear($_POST['date_']))
{
display_error(_("The entered date is not in fiscal year."));
$input_error = 1;
}
elseif (!is_date_in_fiscalyear($_POST['date_']))
{
display_error(_("The entered date is not in fiscal year."));
+ set_focus('date_');
$input_error = 1;
}
$input_error = 1;
}
@@
-146,27
+150,24
@@
if (isset($_POST['Process']))
function check_item_data()
{
function check_item_data()
{
- if (!
is_numeric($_POST['amount']
))
+ if (!
check_num('amount', 0
))
{
{
- display_error( _("The amount entered is not a valid number."));
- return false;
- }
-
- if ($_POST['amount'] <= 0)
- {
- display_error( _("The amount entered must be a postitive number."));
+ display_error( _("The amount entered is not a valid number or is less than zero."));
+ set_focus('amount');
return false;
}
if ($_POST['code_id'] == $_POST['bank_account'])
{
display_error( _("The source and destination accouts cannot be the same."));
return false;
}
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']))
{
display_error( _("You cannot make a payment to a bank account. Please use the transfer funds facility for this."));
return false;
}
if (is_bank_account($_POST['code_id']))
{
display_error( _("You cannot make a payment to a bank account. Please use the transfer funds facility for this."));
+ set_focus('code_id');
return false;
}
return false;
}
@@
-180,7
+181,7
@@
function handle_update_item()
if($_POST['UpdateItem'] != "" && check_item_data())
{
$_SESSION['pay_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'],
if($_POST['UpdateItem'] != "" && check_item_data())
{
$_SESSION['pay_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'],
- $_POST['dimension2_id'],
$_POST['amount']
, $_POST['LineMemo']);
+ $_POST['dimension2_id'],
input_num('amount')
, $_POST['LineMemo']);
}
}
}
}
@@
-199,7
+200,7
@@
function handle_new_item()
return;
$_SESSION['pay_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'],
return;
$_SESSION['pay_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'],
- $_POST['dimension2_id'],
$_POST['amount']
, $_POST['LineMemo']);
+ $_POST['dimension2_id'],
input_num('amount')
, $_POST['LineMemo']);
}
//-----------------------------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------------------------