X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=purchasing%2Fsupplier_trans_gl.php;h=fdec05f83f6120e926de3eb23d8d735f5fe538aa;hb=de3a75773afa86df1739d14f24399d6f7a46f809;hp=ced011834b349babbcb3cb82ba402cba6667a08e;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git
diff --git a/purchasing/supplier_trans_gl.php b/purchasing/supplier_trans_gl.php
index ced01183..fdec05f8 100644
--- a/purchasing/supplier_trans_gl.php
+++ b/purchasing/supplier_trans_gl.php
@@ -3,12 +3,15 @@
$page_security=5;
$path_to_root="..";
-include($path_to_root . "/purchasing/includes/supp_trans_class.inc");
-include($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
+include_once($path_to_root . "/includes/session.inc");
-page(_("Add GL Items"));
+include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
+$js = "";
+if ($use_date_picker)
+ $js .= get_js_date_picker();
+page(_("Add GL Items"), false, false, "", $js);
-include($path_to_root . "/purchasing/includes/purchasing_ui.inc");
if (!isset($_SESSION['supp_trans']))
{
@@ -19,7 +22,7 @@ if (!isset($_SESSION['supp_trans']))
//------------------------------------------------------------------------------------------------
-function clear_fields()
+function clear_fields()
{
unset($_POST['gl_code']);
unset($_POST['dimension_id']);
@@ -27,7 +30,7 @@ function clear_fields()
unset($_POST['amount']);
unset($_POST['memo_']);
unset($_POST['AcctSelection']);
- unset($_POST['AddGLCodeToTrans']);
+ unset($_POST['AddGLCodeToTrans']);
}
//------------------------------------------------------------------------------------------------
@@ -40,18 +43,18 @@ if (isset($_POST['AddGLCodeToTrans'])){
$_POST['gl_code'] = $_POST['AcctSelection'];
}
- $sql = "SELECT account_code, account_name FROM ".TB_PREF."chart_master WHERE account_code=" . $_POST['gl_code'];
+ $sql = "SELECT account_code, account_name FROM ".TB_PREF."chart_master WHERE account_code='" . $_POST['gl_code'] . "'";
$result = db_query($sql,"get account information");
if (db_num_rows($result) == 0)
{
display_error(_("The account code entered is not a valid code, this line cannot be added to the transaction."));
$input_error = true;
- }
- else
+ }
+ else
{
$myrow = db_fetch_row($result);
$gl_act_name = $myrow[1];
- if (!is_numeric($_POST['amount']))
+ if (!check_num('amount'))
{
display_error(_("The amount entered is not numeric. This line cannot be added to the transaction."));
$input_error = true;
@@ -60,8 +63,9 @@ if (isset($_POST['AddGLCodeToTrans'])){
if ($input_error == false)
{
- $_SESSION['supp_trans']->add_gl_codes_to_trans($_POST['gl_code'], $gl_act_name,
- $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['amount'], $_POST['memo_']);
+ $_SESSION['supp_trans']->add_gl_codes_to_trans($_POST['gl_code'], $gl_act_name,
+ $_POST['dimension_id'], $_POST['dimension2_id'],
+ input_num('amount'), $_POST['memo_']);
clear_fields();
}
}
@@ -71,24 +75,24 @@ if (isset($_POST['AddGLCodeToTrans'])){
if (isset($_GET['Delete']))
{
$_SESSION['supp_trans']->remove_gl_codes_from_trans($_GET['Delete']);
- clear_fields();
+ clear_fields();
}
//------------------------------------------------------------------------------------------------
-display_heading($_SESSION['supp_trans']->supplier_name);
+display_heading($_SESSION['supp_trans']->supplier_name);
display_gl_items($_SESSION['supp_trans'], 1);
-
+
echo "
";
if ($_SESSION['supp_trans']->is_invoice == true)
{
hyperlink_no_params("$path_to_root/purchasing/supplier_invoice.php", _("Back to Invoice Entry"));
-}
-else
+}
+else
{
- hyperlink_no_params("$path_to_root/purchasing/supplier_credit.php", _("Back to Credit Note Entry"));
+ hyperlink_no_params("$path_to_root/purchasing/supplier_credit.php", _("Back to Credit Note Entry"));
}
echo "