Sales invoice voiding is blocked when sales credit was issued against the invoice.
[fa-stable.git] / admin / create_coy.php
index c84219b3e941bb29224c7de9efb87280c7a93075..eb44a1bc060ea59d7e041c55387ac7038cff2228 100644 (file)
@@ -127,6 +127,8 @@ function handle_submit($selected_id)
                        display_error(_("Error creating Database: ") . $conn['dbname'] . _(", Please create it manually"));
                        $error = true;
                } else {
+                       if (strncmp(db_get_version(), "5.6", 3) >= 0) 
+                               db_query("SET sql_mode = ''");
                        if (!db_import($path_to_root.'/sql/'.get_post('coa'), $conn, $selected_id)) {
                                display_error(_('Cannot create new company due to bugs in sql file.'));
                                $error = true;
@@ -240,10 +242,10 @@ function display_companies()
 {
        global $def_coy, $db_connections;
 
-       $coyno = $_SESSION["wa_current_user"]->company;
+       $coyno = user_company();
 
        echo "
-               <script language='javascript'>
+               <script type='text/javascript'>
                function deleteCompany(id, name) {
                        if (!confirm('" . _("Are you sure you want to delete company no. ") . "'+id+' '+name+'?'))
                                return