Moved all SQL statements from PHP files into relevant *_db.inc files.
[fa-stable.git] / purchasing / supplier_credit.php
index 1a8d63e9bdca091b7b481876a72b7e6d01d80baa..69ead86d7e8ea2c6c2b6c77577a74f4d1651c66a 100644 (file)
@@ -97,8 +97,7 @@ if (isset($_POST['AddGLCodeToTrans'])){
        $Ajax->activate('gl_items');
        $input_error = false;
 
-       $sql = "SELECT account_code, account_name FROM ".TB_PREF."chart_master WHERE account_code=".db_escape($_POST['gl_code']);
-       $result = db_query($sql,"get account information");
+       $result = get_gl_account_info($_POST['gl_code']);
        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."));