Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
542b6f0731
@ -790,3 +790,14 @@ ALTER TABLE llx_categorie MODIFY COLUMN label varchar(255) NOT NULL;
|
||||
ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (entity, fk_parent, label, type);
|
||||
ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type);
|
||||
ALTER TABLE llx_categorie ADD INDEX idx_categorie_label (label);
|
||||
|
||||
-- Change index name to be compliant with SQL standard, index name must be unique in database schema
|
||||
ALTER TABLE llx_c_actioncomm DROP INDEX code, ADD UNIQUE uk_c_actioncomm (code);
|
||||
ALTER TABLE llx_c_civilite DROP INDEX code, ADD UNIQUE uk_c_civilite (code);
|
||||
ALTER TABLE llx_c_propalst DROP INDEX code, ADD UNIQUE uk_c_propalst (code);
|
||||
ALTER TABLE llx_c_stcomm DROP INDEX code, ADD UNIQUE uk_c_stcomm (code);
|
||||
ALTER TABLE llx_c_type_fees DROP INDEX code, ADD UNIQUE uk_c_type_fees (code);
|
||||
ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code);
|
||||
ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code);
|
||||
ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code);
|
||||
|
||||
|
||||
21
htdocs/install/mysql/tables/llx_c_actioncomm.key.sql
Executable file
21
htdocs/install/mysql/tables/llx_c_actioncomm.key.sql
Executable file
@ -0,0 +1,21 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_actioncomm ADD UNIQUE INDEX uk_c_actioncomm(code);
|
||||
@ -1,6 +1,7 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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
|
||||
@ -20,10 +21,10 @@
|
||||
create table llx_c_actioncomm
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
type varchar(10) DEFAULT 'system' NOT NULL,
|
||||
libelle varchar(48) NOT NULL,
|
||||
module varchar(16) DEFAULT NULL,
|
||||
module varchar(16) DEFAULT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
todo tinyint,
|
||||
position integer NOT NULL DEFAULT 0
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_civilite.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_civilite.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_civilite ADD UNIQUE INDEX uk_c_civilite(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_civilite
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
code varchar(6) UNIQUE NOT NULL,
|
||||
code varchar(6) NOT NULL,
|
||||
civilite varchar(50),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_effectif.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_effectif.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_effectif ADD UNIQUE INDEX uk_c_effectif(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_effectif
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
libelle varchar(30),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_paiement.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_paiement.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(code);
|
||||
@ -27,7 +27,7 @@
|
||||
create table llx_c_paiement
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(6) UNIQUE NOT NULL,
|
||||
code varchar(6) NOT NULL,
|
||||
libelle varchar(30),
|
||||
type smallint,
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_propalst.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_propalst.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_propalst ADD UNIQUE INDEX uk_c_propalst(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_propalst
|
||||
(
|
||||
id smallint PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
label varchar(30),
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_stcomm.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_stcomm.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_stcomm ADD UNIQUE INDEX uk_c_stcomm(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_stcomm
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
libelle varchar(30),
|
||||
active tinyint default 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_type_fees.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_type_fees.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_type_fees ADD UNIQUE INDEX uk_c_type_fees(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_type_fees
|
||||
(
|
||||
id integer AUTO_INCREMENT PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
libelle varchar(30),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL
|
||||
|
||||
19
htdocs/install/mysql/tables/llx_c_typent.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_typent.key.sql
Normal file
@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_typent ADD UNIQUE INDEX uk_c_typent(code);
|
||||
@ -20,7 +20,7 @@
|
||||
create table llx_c_typent
|
||||
(
|
||||
id integer PRIMARY KEY,
|
||||
code varchar(12) UNIQUE NOT NULL,
|
||||
code varchar(12) NOT NULL,
|
||||
libelle varchar(30),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL
|
||||
|
||||
@ -131,13 +131,13 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
||||
$this->savdb=$db;
|
||||
|
||||
// qty=1, unit_price=1.24, discount_line=0, vat_rate=10, price_base_type='HT'
|
||||
$result1=calcul_price_total(1, 1.24, 0, 10, 0, 0, 0, 'HT', 0);
|
||||
$result1=calcul_price_total(1, 1.24, 0, 10, 0, 0, 0, 'HT', 0, 0);
|
||||
print __METHOD__." result1=".join(', ',$result1)."\n";
|
||||
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
|
||||
$this->assertEquals(array(1.24, 0.12, 1.36, 1.24, 0.124, 1.364, 1.24, 0.12, 1.36, 0, 0, 0, 0, 0, 0, 0),$result1);
|
||||
|
||||
// 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1 type 1, 0% localtax2 type 0
|
||||
$result2=calcul_price_total(10, 10, 0, 10, 1.4, 0, 0, 'HT', 0, 0, 1, 0);
|
||||
$result2=calcul_price_total(10, 10, 0, 10, 1.4, 0, 0, 'HT', 0, 0);
|
||||
print __METHOD__." result2=".join(', ',$result2)."\n";
|
||||
$this->assertEquals(array(100, 10, 111.4, 10, 1, 11.14, 100, 10, 111.4, 1.4, 0, 0.14, 0, 0, 1.4, 0),$result2);
|
||||
|
||||
@ -145,7 +145,7 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
||||
global $mysoc;
|
||||
$mysoc=new Societe($db);
|
||||
$mysoc->country_code='ES';
|
||||
$result3=calcul_price_total(10, 10, 0, 10, 1.4, 0, 0, 'HT', 0); // 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1, 0% localtax2
|
||||
$result3=calcul_price_total(10, 10, 0, 10, 1.4, 0, 0, 'HT', 0, 0); // 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1, 0% localtax2
|
||||
print __METHOD__." result3=".join(', ',$result3)."\n";
|
||||
$this->assertEquals(array(100, 10, 111.4, 10, 1, 11.14, 100, 10, 111.4, 1.4, 0, 0.14, 0, 0, 1.4, 0),$result3);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user