From 34b4b07fe21c35d476d2f7a3e1fb8023021c805b Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Nov 2024 04:40:38 +0200 Subject: [PATCH] New: prepare for e-shipment (SQL part) (#31773) * Add issue date * Add field fk_unit * Add shipment contacts * New Add is_delivery_note SQL part * New fields for e-shipment SQL part * Update llx_facture.sql * Update 20.0.0-21.0.0.sql * Update 20.0.0-21.0.0.sql * Update llx_expedition.sql --------- Co-authored-by: Laurent Destailleur --- htdocs/install/mysql/data/llx_c_type_contact.sql | 5 +++++ htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 5 +++++ htdocs/install/mysql/tables/llx_expedition.sql | 3 +-- htdocs/install/mysql/tables/llx_expeditiondet.sql | 13 +++++++------ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 07178dacdcd64..b7e649559e949 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -73,6 +73,11 @@ insert into llx_c_type_contact (element, source, code, libelle, active ) values insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1); insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'SHIPPING', 'Contact client livraison commande', 1); +-- Shipment / Expedition +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Loading facility', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Delivery facility', 1); +insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Customer shipping contact', 1); + -- Intervention / Fichinter insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1); insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'internal', 'INTERVENING', 'Intervenant', 1); diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 5d8523c0dac74..6cc7b0bfa76b8 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -320,4 +320,9 @@ ALTER TABLE llx_c_tva ADD COLUMN fk_department_buyer integer DEFAULT NULL AFTER ALTER TABLE llx_c_tva ADD INDEX idx_tva_fk_department_buyer (fk_department_buyer); ALTER TABLE llx_c_tva ADD CONSTRAINT fk_tva_fk_department_buyer FOREIGN KEY (fk_department_buyer) REFERENCES llx_c_departements (rowid); +ALTER TABLE llx_expeditiondet ADD COLUMN fk_unit integer AFTER qty; +INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Loading facility', 1); +INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Delivery facility', 1); +INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Customer shipping contact', 1); + ALTER TABLE llx_facture_rec ADD COLUMN fk_societe_rib integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_expedition.sql b/htdocs/install/mysql/tables/llx_expedition.sql index 5743e9b454371..3c4cfb545f6ca 100644 --- a/htdocs/install/mysql/tables/llx_expedition.sql +++ b/htdocs/install/mysql/tables/llx_expedition.sql @@ -27,11 +27,10 @@ create table llx_expedition ref varchar(30) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id fk_soc integer NOT NULL, - fk_projet integer DEFAULT NULL, + fk_projet integer DEFAULT NULL, ref_ext varchar(255), -- reference into an external system (not used by dolibarr) ref_customer varchar(255), -- customer number - date_creation datetime, -- date of creation fk_user_author integer, -- author of creation fk_user_modif integer, -- author of last change diff --git a/htdocs/install/mysql/tables/llx_expeditiondet.sql b/htdocs/install/mysql/tables/llx_expeditiondet.sql index 3fdda0c344289..be3cd6163186e 100644 --- a/htdocs/install/mysql/tables/llx_expeditiondet.sql +++ b/htdocs/install/mysql/tables/llx_expeditiondet.sql @@ -22,12 +22,13 @@ create table llx_expeditiondet ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_expedition integer NOT NULL, -- ID of parent object - fk_element integer, -- ID of main source object - fk_elementdet integer, -- ID of line of source object (proposal, sale order) + fk_expedition integer NOT NULL, -- ID of parent object + fk_element integer, -- ID of main source object + fk_elementdet integer, -- ID of line of source object (proposal, sale order) element_type varchar(50) DEFAULT 'commande' NOT NULL, -- Type of source object ('commande', ...) - fk_product integer, -- ID of product. If empy, you can retreive it using fk_element/element_type link - qty real, -- Quantity - fk_entrepot integer, -- Warehouse for departure of product + fk_product integer, -- ID of product. If empy, you can retreive it using fk_element/element_type link + qty real, -- Quantity + fk_unit integer, -- ID of unit code + fk_entrepot integer, -- Warehouse for departure of product rang integer DEFAULT 0 )ENGINE=innodb;