Merged changes form stable branch up to 2.3.13
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 22 Nov 2012 15:21:58 +0000 (16:21 +0100)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 22 Nov 2012 15:21:58 +0000 (16:21 +0100)
27 files changed:
CHANGELOG.txt
admin/attachments.php
admin/db/attachments_db.inc
applications/setup.php
config.default.php
includes/current_user.inc
includes/packages.inc
includes/page/header.inc
includes/remote_url.inc
includes/session.inc
includes/ui/view_package.php
inventory/adjustments.php
inventory/transfers.php
js/inserts.js
js/utils.js
purchasing/allocations/supplier_allocate.php
purchasing/includes/ui/invoice_ui.inc
reporting/includes/class.mail.inc
reporting/rep601.php
reporting/reports_main.php
sales/allocations/customer_allocate.php
sales/includes/cart_class.inc
sales/includes/sales_ui.inc
sales/includes/ui/sales_order_ui.inc
sales/manage/recurrent_invoices.php
sales/manage/sales_groups.php
update.html

index 338492992790ec394a1ef9c2f9959c5f0b0b91b5..6130f276cb27d4529ec83d37ecd1240acf2dd36c 100644 (file)
 ------------
 This is a changelog for FrontAccounting All releases.
 
+<<<<<<< local
 2012-09-09 08:07 +0200 Janusz Dobrowolski
 (3033) Security cleanup on 'where' parameter in a couple of list helpers
  includes/ui/ui_lists.inc
+=======
+2012-11-15 16:45 +0100 Joe Hunt
+(3104) Updated update.html
+ update.html
+>>>>>>> other
 
+<<<<<<< local
 2012-06-25 12:56 +0200 Janusz Dobrowolski
 (3032) Switching database to UTF8 encoding on upgrade to FA 2.4.
  admin/db/maintenance_db.inc
  admin/inst_upgrade.php
  doc/api_changes.txt
+=======
+2012-11-15 16:38 +0100 Joe Hunt
+(3103) Rollback of Session Abondoned Error and new variable, $no_check_edit_conflicts in config.php.
+ config.default.php
+ includes/session.inc
+ sales/includes/sales_ui.inc
+
+2012-11-15 15:23 +0100 Joe Hunt
+(3102) New Changelog.txt
+ CHANGELOG.txt
+
+2012-11-15 15:18 +0100 Joe Hunt
+(3101) Release 2.3.13
+ version.php
+
+2012-11-15 15:18 +0100 Joe Hunt
+(3100) Fixed session abandoned error in Windows Servers
+ includes/session.inc
+
+2012-11-12 13:09 +0100 Janusz Dobrowolski
+(3099) Prevent 'Page expired' messages when 'Back' link is used after login.
+ includes/session.inc
+
+2012-11-12 09:52 +0100 Janusz Dobrowolski
+(3098) Cleanup in curent_user.inc/session.inc
+>>>>>>> other
  includes/current_user.inc
+<<<<<<< local
  includes/db/connect_db.inc
  includes/lang/language.php
+=======
+>>>>>>> other
  includes/session.inc
+<<<<<<< local
  sql/alter2.4.php
+=======
+
+2012-11-12 09:39 +0100 Janusz Dobrowolski
+(3097) Fixed small bug in mail class, added text/hmtl mime type.
+ includes/ui/view_package.php
+ reporting/includes/class.mail.inc
+
+2012-11-10 00:29 +0100 Joe Hunt
+(3096) Dimensions not utilized in Direct Invoice/Delivery
+ sales/includes/cart_class.inc
+
+2012-11-09 09:58 +0100 Joe Hunt
+(3095) Sales quotation and Sales order should not require sufficient stock.
+ sales/includes/ui/sales_order_ui.inc
+
+2012-11-05 23:33 +0100 Janusz Dobrowolski
+(3094) Fixed confirmation on ajax reloaded buttons (small fix for Gecko like browsers).
+ js/utils.js
+
+2012-11-05 17:49 +0100 Janusz Dobrowolski
+(3093) 0001879,0001880: Fixes in htaccess constraints, restricting System Diagnostic view to admin (ApMuthu)
+ .htaccess
+ applications/setup.php
+
+2012-11-05 08:30 +0100 Janusz Dobrowolski
+(3092) Fixed error messages on Sales Groups, updated gettext template.
+ lang/new_language_template/LC_MESSAGES/empty.po
+ sales/manage/sales_groups.php
+
+2012-11-03 22:46 +0100 Janusz Dobrowolski
+(3091) Improved error checking during extension packages installation.
+ includes/packages.inc
+ includes/remote_url.inc
+
+2012-11-03 22:34 +0100 Janusz Dobrowolski
+(3090) Fixed error message in recurrent invoices.
+ sales/manage/recurrent_invoices.php
+
+2012-11-01 01:02 +0100 Joe Hunt
+(3089) Replaced the transaction list in attachments with a pager and made the sorting descent.
+ admin/attachments.php
+ admin/db/attachments_db.inc
+
+2012-10-31 08:56 +0100 Joe Hunt
+(3088) Filter for non-zero values in Bank Statement Report
+ reporting/rep601.php
+ reporting/reports_main.php
+
+2012-10-28 07:30 +0100 Joe Hunt
+(3087) Removed commented deprecated Session_register().
+ includes/page/header.inc
+ inventory/adjustments.php
+ inventory/transfers.php
+ manufacturing/work_order_issue.php
+ purchasing/allocations/supplier_allocate.php
+ sales/allocations/customer_allocate.php
+
+2012-10-17 09:17 +0200 Joe Hunt
+(3086) Db error in invoice.ui.inc for certain MySql setup/releases.
+ purchasing/includes/ui/invoice_ui.inc
+
+2012-10-17 09:00 +0200 Joe Hunt
+(3085) Db error in po_entry_items.php was already fixed. Look at the line below.
+ purchasing/po_entry_items.php
+
+2012-10-16 17:00 +0200 Joe Hunt
+(3083) Cannot insert a supplier transaction record in Direct Supplier Invoice (certain MySql versions and setup).
+ purchasing/po_entry_items.php
+
+2012-10-11 15:18 +0200 Joe Hunt
+(3082) Date format helper complete.
+ js/inserts.js
+
+2012-10-11 15:09 +0200 Joe Hunt
+(3081) Purchase order/Direct GRN/Direct Invoice showed inactive items in item list.
+ purchasing/includes/ui/po_ui.inc
+
+2012-10-11 08:35 +0200 Joe Hunt
+(3080) Small fix and rerun of inserts.js.
+ js/inserts.js
+
+2012-10-11 08:18 +0200 Joe Hunt
+(3078) Fixed date_fix to act like before. day and day-month entrance only.
+ js/inserts.js
+
+2012-10-05 11:17 +0200 Joe Hunt
+(3076) Bug in function is_date when implementing new date formats.
+ includes/date_functions.inc
+
+2012-10-04 10:18 +0200 Joe Hunt
+(3075) Moved declaration of short monthnames from config.default.php. Too early for translations.
+ config.default.php
+ includes/sysnames.inc
+
+2012-10-04 00:58 +0200 Joe Hunt
+(3074) Minor improvement to add_days/months/years for the new dateformats.
+ includes/date_functions.inc
+
+2012-10-02 22:50 +0200 Joe Hunt
+(3073) 0001806: Date problems fixed and new date formats MmmDDYYYY, DDMmmYYYY and YYYYMmmDD implemented.
+ admin/display_prefs.php
+ config.default.php
+ includes/date_functions.inc
+ includes/prefs/userprefs.inc
+ includes/ui/ui_input.inc
+ includes/ui/ui_view.inc
+ js/inserts.js
+
+2012-10-02 13:22 +0200 Janusz Dobrowolski
+(3071) Fixed void_stock_move() to avoid sparse lines in Inventory Items Movements register after DN edition.
+ includes/db/inventory_db.inc
+
+2012-10-02 09:42 +0200 Joe Hunt
+(3070) Having memo or comment displayed on bank_inquiry.php.
+ gl/inquiry/bank_inquiry.php
+
+2012-10-01 01:12 +0200 Joe Hunt
+(3069) Improved headers in printing Purchase Orders.
+ reporting/includes/doctext.inc
+ reporting/includes/pdf_report.inc
+ reporting/rep209.php
+
+2012-09-25 18:06 +0200 Joe Hunt
+(3068) Moved access functions from renderer to current_user. They were cluttered into all themes.
+ includes/current_user.inc
+ themes/aqua/renderer.php
+ themes/cool/renderer.php
+ themes/default/renderer.php
+
+2012-09-23 17:56 +0200 Janusz Dobrowolski
+(3067) Invalid input description in account groups for account class parameter.
+ gl/manage/gl_account_types.php
+
+2012-09-17 13:25 +0200 Janusz Dobrowolski
+(3066) Cleanup in check_faillog().
+ includes/session.inc
+
+2012-09-23 09:23 +0200 Joe Hunt
+(3065) 0001792: BLOOMBERG added to Exchange Rate Providers and config fix, improvement
+ gl/includes/db/gl_db_rates.inc
+
+2012-09-22 10:31 +0200 Joe Hunt
+(3064) 0001792: BLOOMBERG added to Exchange Rate Providers and config fix.
+ config.default.php
+ gl/includes/db/gl_db_rates.inc
+ gl/manage/exchange_rates.php
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2012-09-15 10:34 +0200 Janusz Dobrowolski
+(3061) Added tag version_2_3_12 for changeset 05b037ff3c0b
+ .hgtags
+
+2012-09-15 10:09 +0200 Joe Hunt
+(3060) Changelog.txt
+ CHANGELOG.txt
+
+2012-09-15 10:07 +0200 Joe Hunt
+(3059) Changelog.txt
+ CHANGELOG.txt
+
+2012-09-15 10:04 +0200 Joe Hunt
+(3058) Release 2.3.12
+ update.html
+>>>>>>> other
  version.php
 
 2012-06-22 16:05 +0200 Janusz Dobrowolski
index cc2efe935563032b6f8bdb0eacf262786b16202e..b75c58bf280fa5c5bffe9ec735eb268446f4787a 100644 (file)
@@ -12,6 +12,7 @@
 $path_to_root="..";
 $page_security = 'SA_ATTACHDOCUMENT';
 
+include_once($path_to_root . "/includes/db_pager.inc");
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -164,31 +165,51 @@ function viewing_controls()
 
 }
 
+function trans_view($trans)
+{
+       return get_trans_view_str($trans["type_no"], $trans["trans_no"]);
+}
+
+function edit_link($row)
+{
+       return button('Edit'.$row["id"], _("Edit"), _("Edit"), ICON_EDIT);
+}
+
+function view_link($row)
+{
+       return button('view'.$row["id"], _("View"), _("View"), ICON_VIEW);
+}
+
+function download_link($row)
+{
+       return button('download'.$row["id"], _("Download"), _("Download"), ICON_DOWN);
+}
+
+function delete_link($row)
+{
+       return button('Delete'.$row["id"], _("Delete"), _("Delete"), ICON_DELETE);
+}
+
 function display_rows($type)
 {
-       $rows = get_attached_documents($type);
-       $th = array(_("#"), _("Description"), _("Filename"), _("Size"), _("Filetype"), _("Date Uploaded"), "", "", "", "");
-       
-       start_table(TABLESTYLE);
-       table_header($th);
-       $k = 0;
-       while ($row = db_fetch($rows))
-       {
-               alt_table_row_color($k);
-               
-               label_cell(get_trans_view_str($type, $row['trans_no']));
-               label_cell($row['description']);
-               label_cell($row['filename']);
-               label_cell($row['filesize']);
-               label_cell($row['filetype']);
-               label_cell(sql2date($row['tran_date']));
-               edit_button_cell("Edit".$row['id'], _("Edit"));
-               button_cell("view".$row['id'], _("View"), false, ICON_VIEW);
-               button_cell("download".$row['id'], _("Download"), false, ICON_DOWN);
-               delete_button_cell("Delete".$row['id'], _("Delete"));
-       end_row();
-       }       
-       end_table(1);
+       $sql = get_sql_for_attached_documents($type);
+       $cols = array(
+               _("#") => array('fun'=>'trans_view', 'ord'=>''),
+           _("Description") => array('name'=>'description'),
+           _("Filename") => array('name'=>'filename'),
+           _("Size") => array('name'=>'filesize'),
+           _("Filetype") => array('name'=>'filetype'),
+           _("Date Uploaded") => array('name'=>'tran_date', 'type'=>'date'),
+               array('insert'=>true, 'fun'=>'edit_link'),
+               array('insert'=>true, 'fun'=>'view_link'),
+               array('insert'=>true, 'fun'=>'download_link'),
+               array('insert'=>true, 'fun'=>'delete_link')
+           );  
+               $table =& new_db_pager('trans_tbl', $sql, $cols);
+
+               $table->width = "60%";
+
+               display_db_pager($table);
 }
 
 //----------------------------------------------------------------------------------------
@@ -199,6 +220,7 @@ viewing_controls();
 
 display_rows($_POST['filterType']);
 
+br(2);
 
 start_table(TABLESTYLE2);
 
index 6ce9960f2d1024321c49b50f12626ae7a1f9aa24..e18000fe3f8f2db9e6f61a70a4b416cdf3ca488c 100644 (file)
@@ -78,5 +78,11 @@ function has_attachment($type, $id)
                return $myrow['id'];
 }
 
+function get_sql_for_attached_documents($type)
+{
+       return "SELECT trans_no, description, filename, filesize, filetype, tran_date, id, type_no FROM ".TB_PREF."attachments WHERE type_no=".db_escape($type)
+       ." ORDER BY trans_no DESC";
+}
+
 
 ?>
\ No newline at end of file
index 7ee9fb792bd74d4141b591d925a4e48e1d27ec88..0079b75df21236f63f972453b494ee32c4772e01 100644 (file)
@@ -59,7 +59,7 @@ class setup_app extends application
                $this->add_lapp_function(2, _("&Attach Documents"),
                        "admin/attachments.php?filterType=20", 'SA_ATTACHDOCUMENT', MENU_MAINTENANCE);
                $this->add_lapp_function(2, _("System &Diagnostics"),
-                       "admin/system_diagnostics.php?", 'SA_OPEN', MENU_SYSTEM);
+                       "admin/system_diagnostics.php?", 'SA_SOFTWAREUPGRADE', MENU_SYSTEM);
 
                $this->add_rapp_function(2, _("&Backup and Restore"),
                        "admin/backups.php?", 'SA_BACKUP', MENU_SYSTEM);
index 1eeba6e41c992b5cfc92388898ed08c57f4b499e..a5a8920e0e12d895c151658b664b29b0e624e3c5 100644 (file)
@@ -68,6 +68,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        $power_by               = "FrontAccounting";
        $power_url              = "http://frontaccounting.com";
 
+       /* No check on edit conflicts. Maybe needed to be set to 1 in certains Windows Servers */
+       $no_check_edit_conflicts = 0;
+       
        /* Do not print zero lines amount of 0.00 in Sales Documents if service item. 1 = do not */
        $no_zero_lines_amount = 1;
 
index 90a91a9c079b68e45344f3ed0609b87c9eddf2a8..ae0a4d753dcf152924a014a28d8520c7b2c90bf7 100644 (file)
@@ -58,7 +58,7 @@ class current_user
 
        function login($company, $loginname, $password)
        {
-               global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang;
+               global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang, $login_delay;
 
                $this->set_company($company);
            $this->logged = false;
@@ -76,7 +76,8 @@ class current_user
                if (!isset($Auth_Result))       // if not used: standard method
                        $Auth_Result = get_user_auth($loginname, md5($password));
 
-               write_login_filelog($loginname, $Auth_Result);
+               if ($login_delay > 0)
+                       write_login_filelog($loginname, $Auth_Result);
 
                if ($Auth_Result)
                {
index e3c55e28e4b38999da3bb66ae3d5635b5baf1f5c..67a328f359cea7ef814442bbed4c2ce0828fe0e0 100644 (file)
@@ -15,7 +15,6 @@ include_once($path_to_root. "/includes/hooks.inc");
 
 define('PKG_CACHE_PATH', $path_to_root.'/modules/_cache');
 define('PUBKEY_PATH', $path_to_root);
-define('REPO_URL', 'http://'.$repo_auth['login'].':'.$repo_auth['pass'].'@'.$repo_auth['host'].'/'.$repo_auth['branch']);
 //
 // FrontAccounting package class
 //
@@ -271,21 +270,33 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey
 
        global $path_to_root, $repo_auth;
 
+       $repo =  (isset($repo_auth['scheme']) ? $repo_auth['scheme'] : 'http://')
+                       .(isset($repo_auth['login'])  ? $repo_auth['login'].':' : '')
+                       .(isset($repo_auth['pass'])   ? $repo_auth['pass'].'@' : '')
+                       .(isset($repo_auth['host'])   ? $repo_auth['host'].'/' : '')
+                       .(isset($repo_auth['path'])   ? $repo_auth['path'].'/' : '')
+                       .$repo_auth['branch'];
+
        // first download local copy of repo release file
        // and check remote signature with local copy of public key
        //
        $loclist = PKG_CACHE_PATH.'/Release.gz';
-       
+       $target_dir = $download==true ? "$path_to_root/tmp/" : $download;
+
        if (isset($type) && !is_array($type)) {
                $type = array($type);
        }
        $refresh = true;
        do{
                if (!file_exists($loclist)) {
-                       url_copy(REPO_URL.'/Release.gz', $loclist);
+                       if (!url_copy($repo.'/Release.gz', $loclist))
+                       {
+                               display_error(_("Cannot download repo index file." ));
+                               return null;
+                       }
                        $refresh = false;
                }
-               $sig = url_get_contents(REPO_URL.'/Release.sig');
+               $sig = url_get_contents($repo.'/Release.sig');
                $data = file_get_contents($loclist);
                $cert = file_get_contents(PUBKEY_PATH.'/FA.pem');
                if (openssl_verify($data, $sig, $cert) <= 0) {
@@ -315,12 +326,15 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey
                if ($Release[$fname]['Version'] != $repo_auth['branch']) {
                        display_warning(_('Repository version does not match application version.')); // ?
                }
-               $remoteindex = REPO_URL.'/'.$fname;
+               $remoteindex = $repo.'/'.$fname;
                $locindex = PKG_CACHE_PATH.'/'.$fname;
                $refresh = true;
                do{
                        if (!file_exists($locindex)) { 
-                               url_copy($remoteindex, $locindex);
+                               if (!url_copy($remoteindex, $locindex)) {
+                                       display_error(sprintf(_("Cannot download '%s' file." ), $fname));
+                                       return null;
+                               }
                                $refresh = false;
                        }
                        if ($parms['SHA1sum'] != sha1_file($locindex)) {        // check subdir index consistency
@@ -341,7 +355,7 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey
                 // scan subdir list and select packages of given type
                $pkglist = get_control_file($locindex, 'Package');
                foreach($pkglist as $name => $pkg) {
-                       $pkgfullname = REPO_URL.'/'.$parms['Path']."/".$pkg['Filename'].'.pkg';
+                       $pkgfullname = $repo.'/'.$parms['Path']."/".$pkg['Filename'].'.pkg';
                        if (!isset($type) || in_array($pkg['Type'], $type)) {
                                if (empty($filter))
                                        $p = $pkg;
@@ -358,8 +372,11 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey
                                } elseif ($pkgname == $pkg['Package']) {
                                        //download package to temp directory
                                        if ($download) {
-                                               $locname = "$path_to_root/tmp/".$pkg['Filename'].'.pkg';
-                                               url_copy($pkgfullname, $locname);
+                                               $locname = $target_dir.$pkg['Filename'].'.pkg';
+                                               if (!url_copy($pkgfullname, $locname)) {
+                                                       display_error(sprintf(_("Cannot download '%s' file." ), $pkgfullname));
+                                                       return null;
+                                               }
                                                 // checking sha1 hash is expensive proces, so chekc the package
                                                 // consistency just before downloading
                                                if ($pkg['SHA1sum'] != sha1_file($locname)) {
index fc850b953b950172d173c2299d351463d3bd177a..87d0ee870c751ad1ba6045a90ff32a2190e1e5f2 100644 (file)
@@ -99,8 +99,6 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        {
                $no_menu = false;
        }
-       //if (!isset($_SESSION["sel_app"]))
-       //      session_register("sel_app");
        if (isset($_SESSION["App"]) && is_object($_SESSION["App"]) && isset($_SESSION["App"]->selected_application) &&
                $_SESSION["App"]->selected_application != "")
                $sel_app = $_SESSION["App"]->selected_application;
index 186b4f97660aeaabb6f9c737b6dacede1ad521e9..0e53dbf466eab1cc32445cd9ca935f1d8c919504 100644 (file)
@@ -19,6 +19,9 @@ function url_get_contents($url, $timeout=10)
        // get the host name and url path
        $parsedUrl = parse_url($url);
 
+       if (@$parsedUrl['scheme'] == 'file')
+               return file_get_contents($parsedUrl['path']);
+
        $host = $parsedUrl['host'];
 
        if (isset($parsedUrl['path'])) {
@@ -85,6 +88,8 @@ function url_get_contents($url, $timeout=10)
 function url_copy($from, $to, $timeout=10)
 {
        $f = fopen($to, 'wb');
-       fwrite($f, url_get_contents($from, $timeout));
+       if (!$f || !fwrite($f, url_get_contents($from, $timeout)))
+               return false;
        fclose($f);
+       return true;
 }
index 52d16bdf3e0f951233f19f5f293f89eb28de6633..9a3efc267fd696e5206ede57d78a6c29dc56d7fc 100644 (file)
@@ -77,7 +77,6 @@ class SessionManager
 
                // Create new session without destroying the old one
                session_regenerate_id();
                // Grab current session ID and close both sessions to allow other scripts to use them
                $newSession = session_id();
                session_write_close();
@@ -140,14 +139,6 @@ function login_fail()
        kill_login();
        die();
 }
-//----------------------------------------------------------------------------------------
-// set to reasonable values if not set in config file (pre-2.3.12 installations)
-
-if (!isset($login_delay))
-{
-       $login_delay = 10;
-       $login_max_attempts = 3;
-}
 
 function check_faillog()
 {
@@ -318,6 +309,16 @@ if (!isset($path_to_root))
        $path_to_root = ".";
 }
 
+//----------------------------------------------------------------------------------------
+// set to reasonable values if not set in config file (pre-2.3.12 installations)
+
+if ((!isset($login_delay)) || ($login_delay < 0))
+    $login_delay = 10;
+
+if ((!isset($login_max_attempts)) || ($login_max_attempts < 0))
+    $login_max_attempts = 3; 
+
+
 // Prevent register_globals vulnerability
 if (isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
        die("Restricted access");
@@ -331,7 +332,6 @@ include_once($path_to_root . "/frontaccounting.php");
 include_once($path_to_root . "/admin/db/security_db.inc");
 include_once($path_to_root . "/includes/lang/language.php");
 include_once($path_to_root . "/config_db.php");
-@include_once($path_to_root . "/faillog.php");
 include_once($path_to_root . "/includes/ajax.inc");
 include_once($path_to_root . "/includes/ui/ui_msgs.inc");
 include_once($path_to_root . "/includes/prefs/sysprefs.inc");
@@ -354,6 +354,7 @@ foreach ($installed_extensions as $ext)
 // ini_set('session.save_path', dirname(__FILE__).'/../tmp/');
 
 ini_set('session.gc_maxlifetime', 36000); // 10hrs
+ini_set('session.cache_limiter', 'private'); // prevent 'page expired' errors
 
 hook_session_start(@$_POST["company_login_name"]);
 
@@ -366,6 +367,9 @@ header("Cache-control: private");
 include_once($path_to_root . "/config.php");
 get_text_init();
 
+if ($login_delay > 0)
+       @include_once($path_to_root . "/faillog.php");
+
 // Page Initialisation
 if (!isset($_SESSION['wa_current_user']) || !$_SESSION['wa_current_user']->logged_in()
        || !isset($_SESSION['language']) || !method_exists($_SESSION['language'], 'set_language'))
index 9e68d046dbf1ef7800a6015cd42c6c7cfd9cdbe5..dee8a2f9945df7fe4fb03248e100c0ee426f141e 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $page_security = 'SA_OPEN';
 $path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
index 51edf4d4ed86495b9390c7176c64bbf8be80bc5c..18f26096f98c27f8fdad4536f12d5f8042fa120e 100644 (file)
@@ -69,8 +69,6 @@ function handle_new_order()
                unset ($_SESSION['adj_items']);
        }
 
-    //session_register("adj_items");
-
     $_SESSION['adj_items'] = new items_cart(ST_INVADJUST);
        $_POST['AdjDate'] = new_doc_date();
        if (!is_date_in_fiscalyear($_POST['AdjDate']))
index b4cc678e452c3a31b35f9a8fd9bd007bde1a0a4a..2599fd0f390b0f031066cd27a494edc157b6bc44 100644 (file)
@@ -65,8 +65,6 @@ function handle_new_order()
                unset ($_SESSION['transfer_items']);
        }
 
-    //session_register("transfer_items");
-
        $_SESSION['transfer_items'] = new items_cart(ST_LOCTRANSFER);
        $_POST['AdjDate'] = new_doc_date();
        if (!is_date_in_fiscalyear($_POST['AdjDate']))
index a22238b6dc899531452ca61340cc0e518694790f..ca55cfa110e8e592c102e939abbd138d6f384005 100644 (file)
@@ -216,7 +216,6 @@ function fix_date(date, last)
        var dat = last.split(user.datesep);
        var cur = date.split(user.datesep);
        var day, month, year;
-       var day1, month1, year1;
 
 // TODO: user.date as default?
 // TODO: user.datesys
@@ -225,22 +224,40 @@ function fix_date(date, last)
        if (user.datefmt == 0 || user.datefmt == 3) // set defaults
        {
                day = dat[1]; month = dat[0]; year = dat[2];
-               day1 = cur[1]; month1 = cur[0]; year1 = cur[2];
        } else if (user.datefmt == 1 || user.datefmt == 4){
                day = dat[0]; month = dat[1]; year = dat[2];
-               day1 = cur[0]; month1 = cur[1]; year1 = cur[2];
        } else {
                day = dat[2]; month = dat[1]; year = dat[0];
-               day1 = cur[2]; month1 = cur[1]; year1 = cur[0];
+       }
+       if (cur[1] != undefined && cur[1] != "") // day or month entered, could be string 3
+       { 
+               if (user.datefmt == 0 || user.datefmt == 3 || ((user.datefmt == 2 || user.datefmt == 5) && (cur[2] == undefined || cur[2] == "")))
+                       day = cur[1];
+               else    
+                       month = cur[1];
+       }               
+       if (cur[0] != undefined && cur[0] != "") // day or month entered. could be string 3
+       {
+               if (cur[1] == undefined || cur[1] == "")
+                       day = cur[0];
+               else if (user.datefmt == 0 || user.datefmt == 3 || ((user.datefmt == 2 || user.datefmt == 5) && (cur[2] == undefined || cur[2] == "")))
+                       month = cur[0];
+               else if (user.datefmt == 2 || user.datefmt == 5)
+                       year = cur[0];
+               else    
+                       day = cur[0];
+       }
+       if (cur[2] != undefined && cur[2] != "") // year,
+       {
+               if (user.datefmt == 2 || user.datefmt == 5)
+                       day = cur[2];
+               else
+                       year = cur[2];
+       }               
+       if (user.datefmt<3) {
+               if (day<10) day = '0'+parseInt(day, 10);
+               if (month<10) month = '0'+parseInt(month, 10);
        }       
-       if (day1 != undefined && day1 != "") // day entered
-               day = day1;
-       if (month1 != undefined && month1 != "") // month entered
-               month = month1;
-       if (year1 != undefined && year1 != "") // year entered
-               year = year1;
-       if (user.datefmt<3 && day<10) day = '0'+parseInt(day, 10);
-       if (user.datefmt<3 && month<10) month = '0'+parseInt(month, 10);
        if (year<100) year = year<60 ? (2000+parseInt(year,10)) : (1900+parseInt(year,10));
 
 //     console.info(day,month,year)
index cd416339e143dccfb65b69f4bdcbebb425e90e02..761378e4c4ddcf22df2f371d7414ae50559616be 100644 (file)
@@ -119,7 +119,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                          } else if(cmd=='fc') { // set focus
                                  _focus = data;
                          } else if(cmd=='js') {        // evaluate js code
-                                       setTimeout(function(){eval(data)}, 200); // timeout required by IE7/8
+                               __isGecko ? eval(data) : setTimeout(function(){eval(data)}, 200); // timeout required by IE7/8
                          } else if(cmd=='rd') {        // client-side redirection
                                  window.location = data;
                          } else if(cmd=='pu') {        // pop-up
@@ -317,7 +317,7 @@ function move_focus(dir, e0, neighbours)
        return t;
 }
 
-var __isFireFox = navigator.userAgent.match(/gecko/i);
+var __isGecko = navigator.userAgent.match(/gecko/i); // i.e. Gecko or KHTML, like Gecko ;)
 //returns the absolute position of some element within document
 function element_pos(e) {
        var res = new Object();
@@ -337,7 +337,7 @@ function element_pos(e) {
                                res.y -= offsetParent.scrollTop;
                        }
                              //next lines are necessary to support FireFox problem with offsetParent
-                       if (__isFireFox) {
+                       if (__isGecko) {
                                while (offsetParent != parentNode && parentNode !== null) {
                                        res.x -= parentNode.scrollLeft;
                                        res.y -= parentNode.scrollTop;
index 82530c762975bdc51e1651e806f0ceab5fd3cc75..a501d0b34a23eb8b0ba248a867df4ac13786659c 100644 (file)
@@ -37,7 +37,6 @@ function clear_allocations()
                unset($_SESSION['alloc']->allocs);
                unset($_SESSION['alloc']);
        }
-       //session_register("alloc");
 }
 //--------------------------------------------------------------------------------
 
index af1ba2021b699ffb5bed341bbcb05bff6ec246e2..062ff8f41024c4fc7e0f1d652926ae4b573ac923 100644 (file)
@@ -34,7 +34,7 @@ function copy_to_trans(&$supp_trans)
        if (isset($_POST['tax_algorithm']))
            $supp_trans->tax_algorithm = $_POST['tax_algorithm'];
 
-       $supp_trans->ov_amount = 0; /* for starters */
+       $supp_trans->ov_amount = $supp_trans->ov_discount = 0; /* for starters */
        if (count($supp_trans->grn_items) > 0)
        {
                foreach ( $supp_trans->grn_items as $grn)
index 778815534f01e83144c488434b8af765e21832a0..65066ca75fa8eb75ca4cbad1d3f6eaacc145f68e 100644 (file)
@@ -75,7 +75,7 @@ class email
     {
         $this->body = "--$this->boundary\n";
            $this->body .= "Content-Type: text/plain; charset=\"{$this->charset}\"\n";
-           $this->body .= "Content-Transfer-Encoding: 8bit\n";
+           $this->body .= "Content-Transfer-Encoding: 8bit\n\n";
            $this->body .= $text."\n";
     }
 
@@ -83,7 +83,7 @@ class email
     {
         $this->body = "--$this->boundary\n";
            $this->body .= "Content-Type: text/html; charset=\"{$this->charset}\"\n";
-           $this->body .= "Content-Transfer-Encoding: quoted-printable\n";
+           $this->body .= "Content-Transfer-Encoding: quoted-printable\n\n";
            $this->body .= "<html><body>\n".$html."\n</body></html>\n";
     }
 
@@ -103,6 +103,8 @@ class email
                if ($filename == $file . '.tgz') return 'application/x-tar-gz';
                $file = basename($filename, '.gz');
                if ($filename == $file . '.gz') return 'application/x-gzip';
+               $file = basename($filename, '.html');
+               if ($filename == $file . '.html') return 'text/html';
                return 'application/unknown';
        }
 
index 1cedff0df8f07ef669516ba0d638e2a13f4d7c9e..41eb26aff9e7ce406c5aef5332a0555bdd9a8a6c 100644 (file)
@@ -59,8 +59,9 @@ function print_bank_transactions()
        $acc = $_POST['PARAM_0'];
        $from = $_POST['PARAM_1'];
        $to = $_POST['PARAM_2'];
-       $comments = $_POST['PARAM_3'];
-       $destination = $_POST['PARAM_4'];
+       $zero = $_POST['PARAM_3'];
+       $comments = $_POST['PARAM_4'];
+       $destination = $_POST['PARAM_5'];
        if ($destination)
                include_once($path_to_root . "/reporting/includes/excel_report.inc");
        else
@@ -112,6 +113,8 @@ function print_bank_transactions()
                        
                        while ($myrow=db_fetch($trans))
                        {
+                               if ($zero == 0 && $myrow['amount'] == 0.0)
+                                       continue;
                                $total += $myrow['amount'];
 
                                $rep->TextCol(0, 1, $systypes_array[$myrow["type"]]);
index e91353097171e968f7aeaa4112cde2d03ddb8fe6..45dc419a701f9a37fa698a7afa1e17925c9628fb 100644 (file)
@@ -238,6 +238,7 @@ $reports->addReportClass(_('Banking'), RC_BANKING);
        array(  _('Bank Accounts') => 'BANK_ACCOUNTS',
                        _('Start Date') => 'DATEBEGINM',
                        _('End Date') => 'DATEENDM',
+                       _('Zero values') => 'YES_NO',
                        _('Comments') => 'TEXTBOX',
                        _('Destination') => 'DESTINATION'));
 
index 97ece6a3c4997f6293334fe63e121eac9c447aad..7f7fe7b1b31c030173da3e8a1089e7b5a9c53c19 100644 (file)
@@ -36,7 +36,6 @@ function clear_allocations()
                unset($_SESSION['alloc']->allocs);
                unset($_SESSION['alloc']);
        }
-       //session_register('alloc');
 }
 
 //--------------------------------------------------------------------------------
index 501ab6a93120346b69ec13acf685719d6b8f9668..3adf6c930a3b32675248834b78494b0f20edd360 100644 (file)
@@ -266,6 +266,8 @@ class cart
                        $ref = $this->reference;
                        $date = $this->document_date;
                        $due_date = $this->due_date;
+                       $dimension_id = $this->dimension_id;
+                       $dimension2_id = $this->dimension2_id;
                        $this->trans_type = get_parent_type($this->trans_type);
 
                        $this->reference = 'auto'; 
@@ -276,6 +278,8 @@ class cart
                        $this->document_date = $date;
                        $this->reference = $ref;
                        $this->due_date = $due_date;
+                       $this->dimension_id = $dimension_id;
+                       $this->dimension2_id = $dimension2_id;
                }
                $this->reference = @html_entity_decode($this->reference, ENT_QUOTES);
                $this->Comments = @html_entity_decode($this->Comments, ENT_QUOTES);
index 49232d81a8a3ca926f89ad1b3dcf1b2920a74a7a..8c56d4d3fea02ffa1fba2fcd29d07608f8afc9f0 100644 (file)
@@ -44,9 +44,9 @@ function processing_active()
 */
 function check_edit_conflicts($cartname='Items')
 {
-       global $Ajax;
+       global $Ajax, $no_check_edit_conflicts;
 
-       if (get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
+       if ((!isset($no_check_edit_conflicts) || $no_check_edit_conflicts==0) && get_post('cart_id') && $_POST['cart_id'] != $_SESSION[$cartname]->cart_id) {
                display_error(_('This edit session has been abandoned by opening sales document in another browser tab. You cannot edit more than one sales document at once.'));
                $Ajax->activate('_page_body');
                display_footer_exit();
index af675e7769c6a53b0574021b4b732e03f4b553a9..7de74b07dd2565a397703a25e5f362f04974eff6 100644 (file)
@@ -169,7 +169,8 @@ function display_order_summary($title, &$order, $editable_items=false)
                $qoh_msg = '';
                if (!$editable_items || $id != $line_no)
                {
-                       if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id)) {
+                       if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id) && 
+                               $order->trans_type != ST_SALESORDER && $order->trans_type!=ST_SALESQUOTE) {
                                $qoh = get_qoh_on_date($stock_item->stock_id, 
                                        $_POST['Location'], $_POST['delivery_date']);
                                if (($stock_item->qty_dispatched -$stock_item->qty_done) > $qoh)
index f5f18f6243943bc76442cedc0edd9b187844fd7b..999bccdb10765ec3c0f7b40fce37090ab7683214 100644 (file)
@@ -33,7 +33,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
        if (strlen($_POST['description']) == 0) 
        {
                $input_error = 1;
-               display_error(_("The area description cannot be empty."));
+               display_error(_("The invoice description cannot be empty."));
                set_focus('description');
        }
        if (!is_date($_POST['begin'])) {
index a67dc49aa8a7370741b4a73677511f5d3f38b0a2..60482ba34001523cc29c75221f8988be193db40a 100644 (file)
@@ -27,7 +27,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
        if (strlen($_POST['description']) == 0) 
        {
                $input_error = 1;
-               display_error(_("The area description cannot be empty."));
+               display_error(_("The sales group description cannot be empty."));
                set_focus('description');
        }
 
@@ -65,7 +65,7 @@ if ($Mode == 'Delete')
        {
                delete_sales_group($selected_id);
                display_notification(_('Selected sales group has been deleted'));
-       } //end if Delete area
+       } //end if Delete group
        $Mode = 'RESET';
 } 
 
@@ -111,7 +111,7 @@ start_table(TABLESTYLE2);
 if ($selected_id != -1) 
 {
        if ($Mode == 'Edit') {
-               //editing an existing area
+               //editing an existing group
                $myrow = get_sales_group($selected_id);
 
                $_POST['description']  = $myrow["description"];
index 16859242426e5d7302b44be38a54f37d692e5dd0..5a55293254809cde3a5bac4c7562c7e018112659 100644 (file)
@@ -7,7 +7,7 @@
        <meta name="CHANGED" content="20100902;19041400"></head>\r
 <body dir="ltr" lang="en-US">\r
 <h4><strong><font color="#cc6600"><font style="font-size: 20pt;" size="5"><i>Front</i></font></font></strong><strong><font style="font-size: 20pt;" size="5">Accounting\r
-Update</font></strong></h4><h2>Important Notes for release 2.3.12.</h2><h4>New global flags in config.php (config-default.php):</h4>/* <br>&nbsp;&nbsp;&nbsp; Display a dropdown select box for choosing Company to login if false.<br>&nbsp;&nbsp;&nbsp; Show a blank editbox only if true where the Company NickName<br>&nbsp;&nbsp;&nbsp; will have to be manually entered. This is when privacy is needed.<br>*/<br>&nbsp; &nbsp; <span style="font-weight: bold;">$text_company_selection</span>&nbsp; = false;<br><br>/*&nbsp; Should FA hide menu items (Applications, Modules, and Actions) from the user if they don't have access to them? <br>&nbsp;&nbsp;&nbsp; 0 for no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 for yes<br>*/<br><br>&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">$hide_inaccessible_menu_items</span> = 0;<br><br>/*<br>&nbsp;&nbsp;&nbsp; Brute force prevention.<br>&nbsp;&nbsp;&nbsp; $login_delay seconds delay is required between login attempts after $login_max_attemps failed logins.<br>&nbsp;&nbsp;&nbsp; Set $login_delay to 0 to disable the feature (not recommended)<br>*/<br>&nbsp; &nbsp; <span style="font-weight: bold;">$login_delay</span> = 30;<br>&nbsp; &nbsp; <span style="font-weight: bold;">$login_max_attempts</span> = 10;<h2><strong></strong>Important Notes for release 2.3.5.</h2>\r
+Update</font></strong></h4><h2>Important Notes for release 2.3.13.</h2><h4>New global flags in config.php (config-default.php):</h4>/* No check on edit conflicts. Maybe needed to be set to 1 in certains Windows Servers */<br>&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">$no_check_edit_conflicts = 0;</span><br><h2>Important Notes for release 2.3.12.</h2><h4>New global flags in config.php (config-default.php):</h4>/* <br>&nbsp;&nbsp;&nbsp; Display a dropdown select box for choosing Company to login if false.<br>&nbsp;&nbsp;&nbsp; Show a blank editbox only if true where the Company NickName<br>&nbsp;&nbsp;&nbsp; will have to be manually entered. This is when privacy is needed.<br>*/<br>&nbsp; &nbsp; <span style="font-weight: bold;">$text_company_selection</span>&nbsp; = false;<br><br>/*&nbsp; Should FA hide menu items (Applications, Modules, and Actions) from the user if they don't have access to them? <br>&nbsp;&nbsp;&nbsp; 0 for no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 for yes<br>*/<br><br>&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">$hide_inaccessible_menu_items</span> = 0;<br><br>/*<br>&nbsp;&nbsp;&nbsp; Brute force prevention.<br>&nbsp;&nbsp;&nbsp; $login_delay seconds delay is required between login attempts after $login_max_attemps failed logins.<br>&nbsp;&nbsp;&nbsp; Set $login_delay to 0 to disable the feature (not recommended)<br>*/<br>&nbsp; &nbsp; <span style="font-weight: bold;">$login_delay</span> = 30;<br>&nbsp; &nbsp; <span style="font-weight: bold;">$login_max_attempts</span> = 10;<h2><strong></strong>Important Notes for release 2.3.5.</h2>\r
 Change in the behaviour of <span style="font-weight: bold; font-style: italic;">Recurrent Invoices</span>.<br><ul><li>Now\r
 the Last Sent day is stamped with the former Last Sent (or Begin date\r
 the first time) + months + days. Before the Last Sent day was stamped\r