Merged changes from master branch up to current state.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 10 May 2015 17:39:04 +0000 (19:39 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 10 May 2015 17:39:04 +0000 (19:39 +0200)
admin/users.php
includes/db_pager.inc
includes/page/header.inc
includes/ui/ui_lists.inc
purchasing/includes/ui/invoice_ui.inc
purchasing/supplier_credit.php

index d51426d71614421484974f88fc6631feb63b6343..c19a7dd9b5ab0b0e8996e5ea0af6c3d2f9a606fa 100644 (file)
@@ -23,7 +23,7 @@ include_once($path_to_root . "/admin/db/users_db.inc");
 simple_page_mode(true);
 //-------------------------------------------------------------------------------------------------
 
-function can_process() 
+function can_process($new
 {
 
        if (strlen($_POST['user_id']) < 4)
@@ -33,7 +33,7 @@ function can_process()
                return false;
        }
 
-       if ($_POST['password'] != "") 
+       if (!$new && ($_POST['password'] != ""))
        {
        if (strlen($_POST['password']) < 4)
        {
@@ -58,7 +58,7 @@ function can_process()
 if (($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') && check_csrf_token())
 {
 
-       if (can_process())
+       if (can_process($Mode == 'ADD_ITEM'))
        {
        if ($selected_id != -1) 
        {
index b9e7e75927445b30fc45140cc9bbe72119a542ca..70243392f75e53096ca1c1de63af72fa901c30fc 100644 (file)
@@ -300,11 +300,8 @@ class db_pager {
                }
                if ($where) $where = " WHERE ($where)";
 
-               if ($count) {
-                       $group = $group == '' ? "*" : "DISTINCT $group";
-
-                       return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count";
-               }
+               if ($count)
+                       return "SELECT COUNT(*) FROM ($this->sql) tmp_count";
 
                $sql = "$select FROM $from $where";
                if ($group) $sql.= " GROUP BY $group";
@@ -316,8 +313,8 @@ class db_pager {
                                        if(isset($col['ord_priority'])) {
                                                $columns[$col['ord_priority']] = $col;
                                        }
-                       }
-                       krsort($columns);
+               }
+               krsort($columns);
 
            foreach ($columns as $col) {
                if (isset($col['ord'])) {
@@ -326,7 +323,7 @@ class db_pager {
                            }
                        }
            }
-                               
+
            if (count($ord)) {
                        $ord = array_map('db_escape_function', $ord);
                        $sql .= " ORDER BY " . implode(',', $ord);
index 9f785f4b3d93f02a81b0aca617a5cccc9f53c19c..3661c7cf7b1240de475bead083d6fcbfb1bcd170 100644 (file)
@@ -127,6 +127,8 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
        echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
        echo "<head profile=\"http://www.w3.org/2005/10/profile\"><title>$title</title>";
+       if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') != -1) // IE 11 doesn't work with input file type in form.
+               echo "<meta http-equiv='X-UA-Compatible' content='IE=10'>\n";
        echo "<meta http-equiv='Content-type' content='text/html; charset=$encoding'>";
        echo "<link href='$path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css'> \n";
        echo "<link href='$path_to_root/themes/default/images/favicon.ico' rel='icon' type='image/x-icon'> \n";
index bfb5c6eb3b23beadfcd58d7e1723debc09f79c68..423e1a420b6210812d4a062d76977d33b9131489 100644 (file)
@@ -668,7 +668,7 @@ return combo_input($name, $selected_id, $sql, 'id', '',
 function _format_fiscalyears($row)
 {
        return sql2date($row[1]) . "&nbsp;-&nbsp;" . sql2date($row[2])
-       . "&nbsp;&nbsp;" . ($row[3] ? _('Closed') : _('Active')) . "</option>\n";
+       . "&nbsp;&nbsp;" . ($row[3] ? _('Closed') : _('Active'));
 }
 
 function fiscalyears_list_cells($label, $name, $selected_id=null)
index d8dee0429e636996d0c6086cbf88a63234065d45..11ebbf7ed2f32f96b2ab75cd699c2f843164c511 100644 (file)
@@ -515,7 +515,7 @@ function display_grn_items(&$supp_trans, $mode=0)
                $th[] = "";
                if ($supp_trans->trans_type == ST_SUPPCREDIT)
                {
-                       $th[8] = _("Qty Yet To Credit");
+                       $th[7] = _("Qty Yet To Credit");
                }
     }
     else
index 19337cbef13a094288de4dba7eca5b08cf439cf5..8a0ab8cb49b3296385eda82b417bdadd162c0bda 100644 (file)
@@ -204,7 +204,8 @@ function check_data()
                                        $stock = get_item($item->item_code);
                                        display_error(_("The return cannot be processed because there is an insufficient quantity for item:") .
                                                " " . $stock['stock_id'] . " - " . $stock['description'] . " - " .
-                                               _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($stock['stock_id'])));
+                                               _("Quantity On Hand") . " = " . number_format2(get_qoh_on_date($stock['stock_id'], null, 
+                                               $_SESSION['supp_trans']->tran_date), get_qty_dec($stock['stock_id'])));
                                        return false;
                                }
                        }
@@ -270,6 +271,7 @@ function commit_item_data($n)
                $_POST['prev_quantity_inv'.$n], input_num('This_QuantityCredited'.$n),
                $_POST['order_price'.$n], input_num('ChgPrice'.$n),
                $_POST['std_cost_unit'.$n], "");
+               reset_tax_input();
        }
 }