diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 062c161a29e..f241182b465 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -86,17 +86,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta $result[4] = price2num($result[5] - $result3bis, 'MU'); } - // Local taxes 1 - if ($txlocaltax1>0) + // Local taxes 1. Local tax1 is a second tax that is added after standard one) + if ($txlocaltax1 > 0) { $result[14] = price2num(($result[6] * ( 1 + ( $txlocaltax1 / 100))) - $result[6], 'MT'); // amount tax1 for total_ht_without_discount - $result[8] = price2num($result[8] + $result[14], 'MT'); // total_ttc_without_discount + tax1 - $result[9] = price2num(($result[0] * ( 1 + ( $txlocaltax1 / 100))) - $result[0], 'MT'); // amount tax1 for total_ht - $result[2] = price2num($result[2] + $result[9], 'MT'); // total_ttc + tax1 + $result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MU'); // amount tax1 for pu_ht - $result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MT'); // amount tax1 for pu_ht - $result[5] = price2num($result[5] + $result[11], 'MT'); // pu_ht + tax1 + $result[8] = price2num($result[8] + $result[14], 'MT'); // total_ttc_without_discount + tax1 + $result[2] = price2num($result[2] + $result[9], 'MT'); // total_ttc + tax1 + $result[5] = price2num($result[5] + $result[11], 'MU'); // pu_ht + tax1 } else { @@ -105,26 +104,17 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta $result[11] = 0; } - // Local taxes 2 - if ($txlocaltax2>0) + // Local taxes 2. Local tax2 is a second tax that is substracted after standard one) + // Example: Country = Spain, localtax2 is IRPF + if ($txlocaltax2 > 0) { $result[15] = price2num(($result[6] * ( 1 + ( $txlocaltax2 / 100))) - $result[6], 'MT'); // amount tax2 for total_ht_without_discount $result[10] = price2num(($result[0] * ( 1 + ( $txlocaltax2 / 100))) - $result[0], 'MT'); // amount tax2 for total_ht - $result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MT'); // amount tax2 for pu_ht + $result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MU'); // amount tax2 for pu_ht - //If Country is Spain, localtax2 (IRPF) will be subtracted - if ($mysoc->country_code=='ES') - { - $result[8] = price2num($result[8] - $result[15], 'MT'); // total_ttc_without_discount + tax2 - $result[2] = price2num($result[2] - $result[10], 'MT'); // total_ttc + tax2 - $result[5] = price2num($result[5] - $result[12], 'MU'); // pu_ttc + tax2 - } - else - { - $result[8] = price2num($result[8] + $result[15], 'MT'); // total_ttc_without_discount + tax2 - $result[2] = price2num($result[2] + $result[10], 'MT'); // total_ttc + tax2 - $result[5] = price2num($result[5] + $result[12], 'MU'); // pu_ttc + tax2 - } + $result[8] = price2num($result[8] - $result[15], 'MT'); // total_ttc_without_discount + tax2 + $result[2] = price2num($result[2] - $result[10], 'MT'); // total_ttc + tax2 + $result[5] = price2num($result[5] - $result[12], 'MU'); // pu_ttc + tax2 } else { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 2b208660b52..4a28e5c0ae4 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -82,6 +82,7 @@ if (! empty($dolibarr_strict_mode)) } else { + if (! defined('E_DEPRECATED')) define('E_DEPRECATED',0); // For PHP < 5.3.0 compatibility error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED)); } diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 3b93d301c8c..004798eadbc 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -15,6 +15,8 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +DROP TABLE llx_product_ca; + ALTER TABLE llx_societe ADD COLUMN idprof6 varchar(128) after idprof5; ALTER TABLE llx_societe DROP COLUMN fk_secteur; ALTER TABLE llx_societe DROP COLUMN description; diff --git a/htdocs/install/mysql/tables/llx_product_ca.sql b/htdocs/install/mysql/tables/llx_product_ca.sql deleted file mode 100644 index e089632d07c..00000000000 --- a/htdocs/install/mysql/tables/llx_product_ca.sql +++ /dev/null @@ -1,26 +0,0 @@ --- ============================================================================ --- Copyright (C) 2006 Rodolphe Quiedeville --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 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 --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- ============================================================================ - -create table llx_product_ca -( - fk_product integer, - date_calcul datetime, - year smallint UNSIGNED, - ca_genere float, - UNIQUE (fk_product, year) -)ENGINE=innodb;