2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'upstream/develop' into 14a22

This commit is contained in:
Alexandre SPANGARO
2021-03-16 03:26:28 +01:00
674 changed files with 18715 additions and 9254 deletions

View File

@@ -278,4 +278,5 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24
-- Set field eec
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GB','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI','UK');
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');

View File

@@ -178,3 +178,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
-- Description of chart of account Canada CA-ENG-BASE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1);
-- Description of chart of account Mexico SAT/24-2019
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1);

File diff suppressed because it is too large Load Diff

View File

@@ -48,3 +48,8 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
-- Code used from 3.3+ when type of event is not used
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL, 1, 20);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50,'AC_OTH','system','Other (manually inserted events)',NULL, 1, 5);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 60,'AC_EO_ONLINECONF','module','Online/Virtual conference','conference@eventorganization', 1, 60);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 61,'AC_EO_INDOORCONF','module','Indoor conference','conference@eventorganization', 1, 61);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 62,'AC_EO_ONLINEBOOTH','module','Online/Virtual booth','booth@eventorganization', 1, 62);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 63,'AC_EO_INDOORBOOTH','module','Indoor booth','booth@eventorganization', 1, 63);

View File

@@ -328,7 +328,7 @@ ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL AFTER fk_country;
ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255);
ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);

View File

@@ -43,8 +43,20 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant double(24,8) NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN montant DROP NOT NULL;
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');
-- For v14
ALTER TABLE llx_oauth_token ADD COLUMN restricted_ips varchar(200);
ALTER TABLE llx_oauth_token ADD COLUMN datec datetime DEFAULT NULL;
ALTER TABLE llx_oauth_token ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_mailing_cibles MODIFY COLUMN tag varchar(64) NULL;
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_tag (tag);
ALTER TABLE llx_c_availability ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_adherent ADD COLUMN ref varchar(30) AFTER rowid;
@@ -164,7 +176,7 @@ create table llx_payment_vat
ALTER TABLE llx_tva ADD COLUMN paye smallint default 1 NOT NULL;
ALTER TABLE llx_tva ADD COLUMN fk_account integer;
--INSERT INTO llx_payment_vat (fk_tva, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_bank, fk_user_creat, fk_user_modif) SELECT rowid, NOW(), datep, amount, COALESCE(fk_typepayment, 0), num_payment, '', fk_bank, fk_user_creat, fk_user_modif FROM llx_tva;
INSERT INTO llx_payment_vat (rowid, fk_tva, datec, datep, amount, fk_typepaiement, num_paiement, note, fk_bank, fk_user_creat, fk_user_modif) SELECT rowid, rowid, NOW(), datep, amount, COALESCE(fk_typepayment, 0), num_payment, 'Created automatically by migration v13 to v14', fk_bank, fk_user_creat, fk_user_modif FROM llx_tva WHERE fk_bank IS NOT NULL;
--UPDATE llx_bank_url as url INNER JOIN llx_tva tva ON tva.rowid = url.url_id SET url.type = 'vat', url.label = CONCAT('(', tva.label, ')') WHERE type = 'payment_vat';
--INSERT INTO llx_bank_url (fk_bank, url_id, url, label, type) SELECT b.fk_bank, ptva.rowid, REPLACE(b.url, 'tva/card.php', 'payment_vat/card.php'), '(paiement)', 'payment_vat' FROM llx_bank_url b INNER JOIN llx_tva tva ON (tva.fk_bank = b.fk_bank) INNER JOIN llx_payment_vat ptva on (ptva.fk_bank = b.fk_bank) WHERE type = 'vat';
@@ -185,7 +197,21 @@ ALTER TABLE llx_projet ADD COLUMN accept_booth_suggestions integer DEFAULT 0;
ALTER TABLE llx_projet ADD COLUMN price_registration double(24,8);
ALTER TABLE llx_projet ADD COLUMN price_booth double(24,8);
ALTER TABLE llx_actioncomm ADD COLUMN num_vote integer DEFAULT NULL AFTER reply_to;
ALTER TABLE llx_actioncomm ADD COLUMN event_paid smallint NOT NULL DEFAULT 0 AFTER num_vote;
ALTER TABLE llx_actioncomm ADD COLUMN status smallint NOT NULL DEFAULT 0 AFTER event_paid;
ALTER TABLE llx_actioncomm ADD COLUMN ref varchar(30) AFTER id;
UPDATE llx_actioncomm SET ref = id WHERE ref = '' OR ref IS NULL;
ALTER TABLE llx_actioncomm MODIFY COLUMN ref varchar(30) NOT NULL;
ALTER TABLE llx_actioncomm ADD UNIQUE INDEX uk_actioncomm_ref (ref, entity);
ALTER TABLE llx_c_actioncomm MODIFY code varchar(50) NOT NULL;
ALTER TABLE llx_c_actioncomm MODIFY module varchar(50) DEFAULT NULL;
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 60,'AC_EO_ONLINECONF','module','Online/Virtual conference','conference@eventorganization', 1, 60);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 61,'AC_EO_INDOORCONF','module','Indoor conference','conference@eventorganization', 1, 61);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 62,'AC_EO_ONLINEBOOTH','module','Online/Virtual booth','booth@eventorganization', 1, 62);
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) VALUES ( 63,'AC_EO_INDOORBOOTH','module','Indoor booth','booth@eventorganization', 1, 63);
-- Code enhanced - Standardize field name
ALTER TABLE llx_commande CHANGE COLUMN tva total_tva double(24,8) default 0;
ALTER TABLE llx_supplier_proposal CHANGE COLUMN tva total_tva double(24,8) default 0;
@@ -198,3 +224,53 @@ ALTER TABLE llx_facture_rec CHANGE COLUMN tva total_tva double(24,8) default 0;
ALTER TABLE llx_facture_rec CHANGE COLUMN total total_ht double(24,8) default 0;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN tva total_tva double(24,8) default 0;
--VMYSQL4.3 ALTER TABLE llx_c_civility CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
--VPGSQL8.2 CREATE SEQUENCE llx_c_civility_rowid_seq OWNED BY llx_c_civility.rowid;
--VPGSQL8.2 ALTER TABLE llx_c_civility ALTER COLUMN rowid SET DEFAULT nextval('llx_c_civility_rowid_seq');
--VPGSQL8.2 SELECT setval('llx_c_civility_rowid_seq', MAX(rowid)) FROM llx_c_civility;
-- Change for salary intent table
create table llx_salary
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
label varchar(255),
tms timestamp,
datec datetime, -- Create date
fk_user integer NOT NULL,
datep date, -- payment date
datev date, -- value date (this field should not be here, only into bank tables)
salary double(24,8), -- salary of user when payment was done
amount double(24,8) NOT NULL DEFAULT 0,
fk_projet integer DEFAULT NULL,
datesp date, -- date start period
dateep date, -- date end period
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,
paye smallint default 1 NOT NULL,
fk_typepayment integer NOT NULL, -- default payment mode for payment
fk_account integer, -- default bank account for payment
fk_user_author integer, -- user creating
fk_user_modif integer -- user making last change
) ENGINE=innodb;
ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user fk_user integer NULL;
ALTER TABLE llx_payment_salary ADD COLUMN fk_salary integer;
INSERT INTO llx_salary (rowid, ref, fk_user, amount, fk_projet, fk_typepayment, label, datesp, dateep, entity, note, fk_bank, paye) SELECT ps.rowid, ps.rowid, ps.fk_user, ps.amount, ps.fk_projet, ps.fk_typepayment, ps.label, ps.datesp, ps.dateep, ps.entity, ps.note, ps.fk_bank, 1 FROM llx_payment_salary ps WHERE ps.fk_salary IS NULL;
UPDATE llx_payment_salary as ps SET ps.fk_salary = ps.rowid WHERE ps.fk_salary IS NULL;
UPDATE llx_payment_salary as ps SET ps.ref = ps.rowid WHERE ps.ref IS NULL;
ALTER TABLE llx_salary CHANGE paye paye smallint default 0 NOT NULL;
DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'));
DELETE FROM llx_boxes_def WHERE file IN ('box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php');
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_new_vs_close_ticket.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_new_vs_close_ticket.php' AND entity = 1);

View File

@@ -17,7 +17,6 @@
--
-- ===========================================================================
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code);
@@ -27,5 +26,6 @@ ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_project (fk_project);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datep (datep);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datep2 (datep2);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_recurid (recurid);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_ref_ext (ref_ext);
ALTER TABLE llx_actioncomm ADD UNIQUE INDEX uk_actioncomm_ref (ref, entity);

View File

@@ -24,6 +24,7 @@
create table llx_actioncomm
(
id integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL,
ref_ext varchar(255), -- reference into an external system (not used by dolibarr). Example: An id coming from google calendar has length between 5 and 1024 chars. An event id must follow rule: chars used in base32hex encoding (i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938)
entity integer DEFAULT 1 NOT NULL, -- multi company id
datep datetime, -- date start
@@ -31,7 +32,7 @@ create table llx_actioncomm
fk_action integer, -- type of action (optional link with id in llx_c_actioncomm or null)
code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...)
datec datetime, -- date creation
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_author integer, -- user id of user that has created record
@@ -71,7 +72,11 @@ create table llx_actioncomm
recurid varchar(128), -- used to store event id to link each other all the repeating event record. It can be the 'iCalUID' as in RFC5545 (an id similar for all the same serie)
recurrule varchar(128), -- contains string with ical format recurring rule like 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19' or 'FREQ=WEEKLY;BYDAY=MO'
recurdateend datetime, -- no more recurring event after this date
num_vote integer DEFAULT NULL, -- use for Event Organization module
event_paid smallint NOT NULL DEFAULT 0, -- use for Event Organization module
status smallint NOT NULL DEFAULT 0, -- use for Event Organization module for now, but could be use after for event global status
fk_element integer DEFAULT NULL, -- For link to an element (proposal, invoice, order, ...)
elementtype varchar(255) DEFAULT NULL, -- For link to an element (proposal, invoice, order, ...)

View File

@@ -21,10 +21,10 @@
create table llx_c_actioncomm
(
id integer PRIMARY KEY,
code varchar(12) NOT NULL,
code varchar(50) NOT NULL,
type varchar(50) DEFAULT 'system' NOT NULL,
libelle varchar(48) NOT NULL,
module varchar(16) DEFAULT NULL,
module varchar(50) DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL,
todo tinyint, -- deprecated
color varchar(9),

View File

@@ -19,7 +19,7 @@
create table llx_c_civility
(
rowid integer PRIMARY KEY,
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
code varchar(6) NOT NULL,
label varchar(50),
active tinyint DEFAULT 1 NOT NULL,

View File

@@ -26,8 +26,8 @@ create table llx_events
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
type varchar(32) NOT NULL, -- action type
entity integer DEFAULT 1 NOT NULL, -- multi company id
prefix_session varchar(255) NULL, -- prefix of session, obtained with dol_getprefix
entity integer DEFAULT 1 NOT NULL, -- multi company id
prefix_session varchar(255) NULL, -- prefix of session, obtained with dol_getprefix
dateevent datetime, -- date event
fk_user integer, -- id user
description varchar(250) NOT NULL, -- full description of action
@@ -36,10 +36,3 @@ create table llx_events
fk_object integer -- id of related object
) ENGINE=innodb;
--
-- List of codes for the field entity
--
-- 1 : first company events
-- 2 : second company events
-- 3 : etc...
--

View File

@@ -21,3 +21,5 @@ ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email);
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email);
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_tag (tag);

View File

@@ -28,7 +28,7 @@ create table llx_mailing_cibles
firstname varchar(160),
email varchar(160) NOT NULL,
other varchar(255) NULL,
tag varchar(128) NULL,
tag varchar(64) NULL, -- a unique key as a hash of: dolibarr_main_instance_unique_id;email;lastname;mailing_id;MAILING_EMAIL_UNSUBSCRIBE_KEY
statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ...
source_url varchar(255),
source_id integer,

View File

@@ -17,11 +17,14 @@
CREATE TABLE llx_oauth_token (
rowid integer AUTO_INCREMENT PRIMARY KEY,
service varchar(36),
token text, -- token in serialize() format, of an object StdOAuth2Token of library phpoauth2
tokenstring text, -- token in json format '{"access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write"}
service varchar(36), -- 'Google', 'Stripe', 'auth-public-key', ...
token text, -- token in serialize() format, of an object StdOAuth2Token of library phpoauth2
tokenstring text, -- token in text or json format. Value depends on 'service. For example for an OAUTH service: '{"access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write"}
fk_soc integer,
fk_user integer,
fk_user integer, -- Id of user in llx_user
fk_adherent integer,
restricted_ips varchar(200), -- Restrict the authentication mode/token to some IPs
datec datetime DEFAULT NULL, -- date creation project
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
entity integer DEFAULT 1
)ENGINE=innodb;

View File

@@ -24,4 +24,3 @@ ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datesp (datesp);
ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_dateep (dateep);
ALTER TABLE llx_payment_salary ADD CONSTRAINT fk_payment_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);

View File

@@ -22,7 +22,7 @@ create table llx_payment_salary
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- Create date
fk_user integer NOT NULL,
fk_user integer DEFAULT NULL,
datep date, -- payment date
datev date, -- value date (this field should not be here, only into bank tables)
salary double(24,8), -- salary of user when payment was done
@@ -37,5 +37,6 @@ create table llx_payment_salary
note text,
fk_bank integer,
fk_user_author integer, -- user creating
fk_user_modif integer -- user making last change
fk_user_modif integer, -- user making last change
fk_salary integer
)ENGINE=innodb;

View File

@@ -0,0 +1,44 @@
-- ===================================================================
-- Copyright (C) 2011-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
--
-- 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 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
-- 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 <https://www.gnu.org/licenses/>.
--
-- ===================================================================
create table llx_salary
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
tms timestamp,
datec datetime, -- Create date
fk_user integer NOT NULL,
datep date, -- payment date
datev date, -- value date (this field should not be here, only into bank tables)
salary double(24,8), -- salary of user when payment was done
amount double(24,8) NOT NULL DEFAULT 0,
fk_projet integer DEFAULT NULL,
fk_typepayment integer NOT NULL,
num_payment varchar(50), -- num cheque or other
label varchar(255),
datesp date, -- date start period
dateep date, -- date end period
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,
paye smallint default 0 NOT NULL,
fk_account integer,
fk_user_author integer, -- user creating
fk_user_modif integer -- user making last change
)ENGINE=innodb;

View File

@@ -21,6 +21,6 @@ create table llx_user_alert
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
type integer,
fk_contact integer, -- pointe sur llx_socpeople
fk_user integer
fk_contact integer, -- id of llx_socpeople
fk_user integer -- id of llx_user
)ENGINE=innodb;

View File

@@ -17,14 +17,12 @@
-- ===========================================================================
--
-- Stockage des informations relatives au click to dial
-- Table to store each different IP / devices / puclib key used for login
--
create table llx_user_clicktodial
create table llx_user_ipdevices
(
fk_user integer PRIMARY KEY,
url varchar(255),
login varchar(32),
pass varchar(64),
poste varchar(20)
rowid integer PRIMARY KEY,
fk_user integer NOT NULL, -- ID llx_user
ip varchar(64),
user_agent varchar(255) NULL, -- user agent
)ENGINE=innodb;