Skip to content

Commit

Permalink
New: prepare for e-shipment (SQL part) (#31773)
Browse files Browse the repository at this point in the history
* 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 <eldy@destailleur.fr>
  • Loading branch information
sonikf and eldy authored Nov 12, 2024
1 parent 836bb71 commit 34b4b07
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions htdocs/install/mysql/data/llx_c_type_contact.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions htdocs/install/mysql/migration/20.0.0-21.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 1 addition & 2 deletions htdocs/install/mysql/tables/llx_expedition.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions htdocs/install/mysql/tables/llx_expeditiondet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 34b4b07

Please sign in to comment.