From: Janusz Dobrowolski Date: Sat, 18 Apr 2015 09:41:45 +0000 (+0200) Subject: Merging latest changes from stable branch up to 2.3.24 X-Git-Tag: v2.4.2~19^2~198 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=d1babda7c01b314d35fb89f2d195553b55936532 Merging latest changes from stable branch up to 2.3.24 --- d1babda7c01b314d35fb89f2d195553b55936532 diff --cc gl/includes/db/gl_db_trans.inc index d5adab4f,dcb04ece..78bff3a9 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@@ -558,26 -602,18 +558,26 @@@ function clear_gl_trans($type, $trans_i commit_transaction(); } -function get_sql_for_journal_inquiry($filter, $from, $to, $ref='', $memo='', $alsoclosed=false) +function get_sql_for_journal_inquiry($filter, $from, $to, $ref='', $memo='', $alsoclosed=false, + $user_id=null, $contractor_id=null, $dimension=null) { - $sql = "SELECT IF(ISNULL(a.gl_seq),0,a.gl_seq) as gl_seq, + $sql = "SELECT IFNULL(a.gl_seq,0) as gl_seq, gl.tran_date, - gl.type, - gl.type_no, - refs.reference, - SUM(IF(gl.amount>0, gl.amount,0)) as amount, - com.memo_, - IF(ISNULL(u.user_id),'',u.user_id) as user_id - FROM ".TB_PREF."gl_trans as gl + gl.type as trans_type, + gl.type_no as trans_no, + IFNULL(MAX(supp.supp_name), MAX(cust.name)) as name, + IF(ISNULL(st.supp_reference), '', st.supp_reference) AS supp_reference, + refs.reference," + .($dimension ? " -SUM(IF(dim.dimension in(gl.dimension_id,gl.dimension2_id), gl.amount, 0)) as amount,":" SUM(IF(gl.amount>0, gl.amount,0)) as amount,") + ."com.memo_, + IF(ISNULL(u.user_id),'',u.user_id) as user_id"; + + if ($contractor_id > 0) { + $sql.= ", st.supplier_id, dt.debtor_no "; + } + + $sql.= " FROM ".TB_PREF."gl_trans as gl LEFT JOIN ".TB_PREF."audit_trail as a ON (gl.type=a.type AND gl.type_no=a.trans_no) LEFT JOIN ".TB_PREF."comments as com ON diff --cc includes/current_user.inc index 87f71b1e,515f6e4e..72a97118 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@@ -159,9 -148,9 +159,9 @@@ class current_use $hash = md5($password); - update_user_password($myrow['id'], $myrow['user_id'], $hash); + update_user_password($user['id'], $user['user_id'], $hash); - mail($user['email'], _("New password for")." ".$app_title, $password); + mail($myrow['email'], _("New password for")." ".$SysPrefs->app_title, $password); return true; } diff --cc reporting/rep304.php index 4bdedbcb,9e7e3046..72385966 --- a/reporting/rep304.php +++ b/reporting/rep304.php @@@ -33,39 -33,41 +33,48 @@@ function getTransactions($category, $lo { $from = date2sql($from); $to = date2sql($to); - $sql = "SELECT ".TB_PREF."stock_master.category_id, - ".TB_PREF."stock_category.description AS cat_description, - ".TB_PREF."stock_master.stock_id, - ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive, - ".TB_PREF."stock_master.mb_flag, - ".TB_PREF."stock_moves.loc_code, - ".TB_PREF."debtor_trans.debtor_no, - ".TB_PREF."debtors_master.name AS debtor_name, - ".TB_PREF."stock_moves.tran_date, - SUM(-".TB_PREF."stock_moves.qty) AS qty, - SUM(-".TB_PREF."stock_moves.qty*".TB_PREF."stock_moves.price*(1-".TB_PREF."stock_moves.discount_percent)) AS amt, - SUM(-IF(".TB_PREF."stock_moves.standard_cost <> 0, ".TB_PREF."stock_moves.qty * ".TB_PREF."stock_moves.standard_cost, ".TB_PREF."stock_moves.qty *(".TB_PREF."stock_master.material_cost + ".TB_PREF."stock_master.labour_cost + ".TB_PREF."stock_master.overhead_cost))) AS cost - FROM ".TB_PREF."stock_master, - ".TB_PREF."stock_category, - ".TB_PREF."debtor_trans, - ".TB_PREF."debtors_master, - ".TB_PREF."stock_moves - WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."stock_moves.stock_id - AND ".TB_PREF."stock_master.category_id=".TB_PREF."stock_category.category_id - AND ".TB_PREF."debtor_trans.debtor_no=".TB_PREF."debtors_master.debtor_no - AND ".TB_PREF."stock_moves.type=".TB_PREF."debtor_trans.type - AND ".TB_PREF."stock_moves.trans_no=".TB_PREF."debtor_trans.trans_no - AND ".TB_PREF."stock_moves.tran_date>='$from' - AND ".TB_PREF."stock_moves.tran_date<='$to' - AND (".TB_PREF."debtor_trans.type=".ST_CUSTDELIVERY." OR ".TB_PREF."stock_moves.type=".ST_CUSTCREDIT.")"; - if (!$show_service) - $sql .= " AND (".TB_PREF."stock_master.mb_flag='B' OR ".TB_PREF."stock_master.mb_flag='M')"; - if ($category != 0) - $sql .= " AND ".TB_PREF."stock_master.category_id = ".db_escape($category); - if ($location != '') - $sql .= " AND ".TB_PREF."stock_moves.loc_code = ".db_escape($location); - if ($fromcust != '') - $sql .= " AND ".TB_PREF."debtors_master.debtor_no = ".db_escape($fromcust); - $sql .= " GROUP BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."debtors_master.name ORDER BY ".TB_PREF."stock_master.category_id, - ".TB_PREF."stock_master.stock_id, ".TB_PREF."debtors_master.name"; ++<<<<<<< HEAD + $sql = "SELECT item.category_id, + category.description AS cat_description, + item.stock_id, + item.description, item.inactive, ++ item.mb_flag, + move.loc_code, + trans.debtor_no, + debtor.name AS debtor_name, + move.tran_date, + SUM(-move.qty) AS qty, + SUM(-move.qty*move.price) AS amt, + SUM(-IF(move.standard_cost <> 0, move.qty * move.standard_cost, move.qty *(item.material_cost + item.labour_cost + item.overhead_cost))) AS cost + FROM ".TB_PREF."stock_master item, + ".TB_PREF."stock_category category, + ".TB_PREF."debtor_trans trans, + ".TB_PREF."debtors_master debtor, + ".TB_PREF."stock_moves move + WHERE item.stock_id=move.stock_id + AND item.category_id=category.category_id + AND trans.debtor_no=debtor.debtor_no + AND move.type=trans.type + AND move.trans_no=trans.trans_no + AND move.tran_date>='$from' + AND move.tran_date<='$to' - AND (trans.type=".ST_CUSTDELIVERY." OR move.type=".ST_CUSTCREDIT.") - AND (item.mb_flag='B' OR item.mb_flag='M')"; - if ($category != 0) - $sql .= " AND item.category_id = ".db_escape($category); - if ($location != '') - $sql .= " AND move.loc_code = ".db_escape($location); - if ($fromcust != '') - $sql .= " AND debtor.debtor_no = ".db_escape($fromcust); - $sql .= " GROUP BY item.stock_id, debtor.name ORDER BY item.category_id, - item.stock_id, debtor.name"; ++ AND (trans.type=".ST_CUSTDELIVERY." OR move.type=".ST_CUSTCREDIT.")"; ++ ++ if (!$show_service) ++ $sql .= " AND (item.mb_flag='B' OR item.mb_flag='M')"; ++ ++ if ($category != 0) ++ $sql .= " AND item.category_id = ".db_escape($category); ++ ++ if ($location != '') ++ $sql .= " AND move.loc_code = ".db_escape($location); ++ ++ if ($fromcust != '') ++ $sql .= " AND debtor.debtor_no = ".db_escape($fromcust); ++ ++ $sql .= " GROUP BY item.stock_id, debtor.name ORDER BY item.category_id, ++ item.stock_id, debtor.name"; ++ return db_query($sql,"No transactions were returned"); } diff --cc update.html index 51dd4709,d2c1929f..d88329d5 --- a/update.html +++ b/update.html @@@ -1,105 -1,299 +1,288 @@@ - - - - - - - - - FrontAccounting Update - - - - -

FrontAccounting - Update

-

1. Application files update

- -

a. Source - files update

- -

Extract distribution - zip/tar.gz file in empty directory, and copy all the files to your - FrontAccounting directory overwriting old files. If it is major - release upgrade you can skip next step and go directly to cleanup.

- -

b. Configuration - files update

- -

Compare new - config.default.php - file with the - old - config.php and - add all new - settings (if any). -

- - The following variables has been moved from config.default.php into sys_prefs table:
-
- $no_zero_lines_amount = 1;
- $show_po_item_codes = 0;
- $accounts_alpha = 0;
- $loc_notification = 0;
- $print_invoice_no = 0;
- $allow_negative_prices = 1;
- $print_item_images_on_quote = 0;
-
- These values can be maintained in Setup tab -> System and GL Setup.
-
- The following variables has been moved from config.default.php into sys_refs table:
-
- $alternative_tax_include_on_docs = 0;
- $suppress_tax_rates = 0;
-
- These values can be maintained in Setup tab -> Company Setup.
-
- The following variables has been moved from config.default.php into users table:
-
- $save_report_selections = 0;
- $use_date_picker = 1;
- $def_print_destination = 0;
- $def_print_orientation = 0;
-
- These values can be maintained in Setup tab -> Display Setup or Preferences.
-
-  Please also remove these variables from your existing config.php file

-

2. Database upgrade

-

This step can be - skipped - for small version updates i.e. when you have already installed - FrontAccounting version 2.4 or later. Before database upgrade is - done on all company databases backup file is created automatically to - enable database restore after failure.

-

After major version - upgrade overwriting files in first step makes the system unaccessible - for all users but site admin, who have to run upgrade procedures to - update all company databases to the new version provided with the - release. After logging to administrator account of first installed - company go directly to Setup/Software Upgrade screen, mark all - subsequent 'Install' checkboxes and press 'Upgrade System'.

-

If something goes wrong during - upgrade, you can eventually try forced upgrade option. Forced upgrade - ignores some smaller errors which can arise during upgrade due to - some exotic database configuration. This is depreciated option, so - first read error messages if any, try to fix signalized problems, - restore databases from backup and retry normal installation. To run - upgrade in forced mode check box 'Force Upgrade', and press 'Upgrade - System' again.

-

3. Final cleanup

-

Remove or rename install folder in main FrontAccounting - directory. -

4. New features configuration

-

During upgrade process new features are initialized to default - status, and sometimes old settings are also changed to conform with - new security policy. This automatic process is designed to be as - neutral for end users as possible, however sometimes site or company - admin intervention can be necessary to set thing after changes to - their best state. Below you will find description of new settings - available after upgrade.

- -

----------------------

- + - - - - - + FrontAccounting Update - + + + +

FrontAccounting + Update

+

Important Notes for release 2.3.22.

+ - +

New global flags in config.php (config-default.php):

+ /* Show average costed values instead of fixed standard cost */ In Enventory Valuation Report.
+ $use_costed_values = 0;
+
+ /* Print Item Images on Sales Quotations. Set to 1 if so. */
+ $print_item_images_on_quote = 0;
+

Important Notes for release 2.3.21.

+ - - - +

Crucial security patches:

+ + This version consists of crucial security patches and this applies especially to all publicly available servers,
+  f.i. installations which are run in not fully trusted environment like public demos, shared accounts or SAAS.
+

New global flags in config.php (config-default.php):

+ /* Whether to allow sending new password by e-mail */
+ $allow_password_reset = false

Important Notes for release 2.3.20.

+ - +

Crucial security patches:

+ This version consists of crucial security patches and all guest FA + installations (I mean whenever FA is run in not fully trusted + environment) should be updtaed.
+

Important Notes for release 2.3.17.

+ +

New global flags in config.php (config-default.php):

+ /*
+     Choose Exchange Rate Provider
+     Default is ECB for backwards compatibility
+ */
+ $xr_providers = array("ECB", "YAHOO", "GOOGLE", "BLOOMBERG");
+ $dflt_xr_provider = 0;
+
+
/*
+     Set to true when remote service is authoritative + source of exchange rates, and can be stored automatically without
+     manual edition. Otherwise exrate is stored on first new currency transaction of the day.
+ */
+ $xr_provider_authoritative = false;
+

Important Notes for release 2.3.16.

+

New global flags in config.php (config-default.php):

/*
  
 Optional sorting new sales documents lines according to item code
*/
$sort_sales_items = false;

/*
    
Trial Balance opening balance presentation option.
    When set to true past years part of opening balance is cleared.
*/
$clear_trial_balance_opening = false;

Important Notes for release 2.3.14.

+

New global flags in config.php (config-default.php):

+ /* default print orientation. 0 = Portrait, 1 = Landscape */
+     $def_print_orientation + = 0;
+

Important Notes for release 2.3.13.

+

New global flags in config.php (config-default.php):

+ /* No check on edit conflicts. Maybe needed to be set to 1 in certains + Windows Servers */
+     $no_check_edit_conflicts + = 0;
+

Important Notes for release 2.3.12.

+

New global flags in config.php (config-default.php):

+ /*
+     Display a dropdown select box for + choosing Company to login if false.
+     Show a blank editbox only if true where + the Company NickName
+     will have to be manually entered. This + is when privacy is needed.
+ */
+     $text_company_selection  + = false;
+
+ /*  Should FA hide menu items (Applications, Modules, and + Actions) from the user if they don't have access to them?
+     0 for + no       1 for yes
+ */
+
+     $hide_inaccessible_menu_items + = 0;
+
+ /*
+     Brute force prevention.
+     $login_delay seconds delay is required + between login attempts after $login_max_attemps failed logins.
+     Set $login_delay to 0 to disable the + feature (not recommended)
+ */
+     $login_delay + = 30;
+     $login_max_attempts + = 10; +

Important Notes for release + 2.3.5.

+ Change in the behaviour of Recurrent + Invoices.
+ +

Important Notes

+

Upgrade process can be done only by administrator of the first + company created during FrontAccounting installation. This person is + considered as a site admin who have granted access to potentially + dangerous setup options, like Setup/Software Upgrade.

+

In the following description sections related to older FA + versions are + prefixed with [color + tags] + . You can skip tagged fragment safely if currently FA + application is newer than the version in tag.

+

Upgrade process consists of up to four stages, some of them + are + optional:

+
    +
  1. +

    Application source files update

    +
  2. +
  3. +

    Database upgrade – this step is needed only during upgrade + which involves change in major application version number (e.g. from + 2.2.x to 2.3.x), and sometimes during upgrade from beta release to + stable version. Otherwise this step can be skipped.

    +
  4. +
  5. +

    Final cleanup – is needed when some old source files, + obsoleted by new release should be removed.

    +
  6. +
  7. +

    New features configuration – this is optional step needed + for most major releases and some minor ones.

    +
  8. +
+

Before starting upgrade + ensure nobody + is using the application and make database backup for all companies. + To be on safe side backup also old source files, especially those + locally customized (if any).

+

Log into admin account of first company. If + you use a theme other than the standard 3 (aqua, cool or default), + switch to one of these before going further.

+

1. Application files update

+

a. Source + files update

+

Extract distribution + zip/tar.gz file in empty directory, and copy all the files to your + FrontAccounting directory overwriting old files. If it is major + release upgrade you can skip next step and go directly to cleanup.

+

b. Configuration + files update

+

Compare new + config.default.php + file with the + old + config.php and + add all new + settings (if any). +

+

[<FA + 2.2beta]

+

$show_users_online + = 0;

+

$def_print_destination + = 0;

+

$dflt_date_fmt=0;

+

$dflt_date_sep=0;

+

$table_style,table_style2 + changed

+

[<FA + 2.3beta]

+

$alternative_tax_include_on_doc=0;

+

$suppress_tax_rates + = 0;

+

[<FA + 2.3RC1] +

+

Application version + information and a couple of other private FA variables are stored in + version.php + file. The + application version displayed in footer is defined in $version + variable unless this is set in config.php file. If you want current + release version to be displayed on every FA update just remove or + comment out $version variable in config.php.

+

[<FA + 2.3RC2]

+

$save_report_selections +  = 0;  // A value > 0 means days to save the + report selections.

+

[<FA + 2.3]

+

$save_po_item_codes +  = 0;  //  show item codes on purchase + order 

+

$def_print_destination + = 0; //  default print destination. 0 = PDF/Printer, 1 = Excel

+

$alternative_tax_include_on_docs + = 0; //  1 = print Subtotal tax excluded, tax and Total tax + included

+

$suppress_tax_rates + = 0; //  suppress tax rates on documents. 0 = no, 1 = yes.

+ +

2. Database upgrade

+

This step can be + skipped + for small version updates i.e. when you have already installed + FrontAccounting version 2.3.1 or later. Before database upgrade is + done on all company databases backup file is created automatically to + enable database restore after failure.

+

After major version + upgrade overwriting files in first step makes the system unaccessible + for all users but site admin, who have to run upgrade procedures to + update all company databases to the new version provided with the + release. After logging to administrator account of first installed + company go directly to Setup/Software Upgrade screen, mark all + subsequent 'Install' checkboxes and press 'Upgrade System'.

+

If something goes wrong during + upgrade, you can eventually try forced upgrade option. Forced upgrade + ignores some smaller errors which can arise during upgrade due to + some exotic database configuration. This is depreciated option, so + first read error messages if any, try to fix signalized problems, + restore databases from backup and retry normal installation. To run + upgrade in forced mode check box 'Force Upgrade', and press 'Upgrade + System' again.

+

3. Final cleanup

+

Remove or rename install folder in main FrontAccounting + directory. +

+

After upgrade is installed you can remove files obsoleted by + new + FrontAccounting version. Also old, unused settings can + be removed from config.php + file.

+

a. + Source files cleanup

+

[<FA + 2.2beta]

+

/includes/reserved.inc + – removed.

+

[<FA + 2.1] +

+

/admin/db/v_banktrans.inc + - removed

+

b. + Config.php cleanup +

+

[<FA + 2.2RC1] +

+

$security_headings, + $security_groups arrays – moved to database (see Access Setup) +

+

$def_app – moved + to user configuration in database.

+

$version + – moved to version.php + file. Remove

+

4. New features configuration

+

During upgrade process new features are initialized to default + status, and sometimes old settings are also changed to conform with + new security policy. This automatic process is designed to be as + neutral for end users as possible, however sometimes site or company + admin intervention can be necessary to set thing after changes to + their best state. Below you will find description of new settings + available after upgrade.

+


+
+

+

----------------------

+