Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Regis Houssin 2012-09-05 10:17:33 +02:00
commit 1933bd4b50
4 changed files with 16 additions and 49 deletions

View File

@ -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
{

View File

@ -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));
}

View File

@ -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;

View File

@ -1,26 +0,0 @@
-- ============================================================================
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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 <http://www.gnu.org/licenses/>.
--
-- ============================================================================
create table llx_product_ca
(
fk_product integer,
date_calcul datetime,
year smallint UNSIGNED,
ca_genere float,
UNIQUE (fk_product, year)
)ENGINE=innodb;