NEW input reason for customer invoice (SQL) (#33569)

This commit is contained in:
lvessiller-opendsi 2025-03-24 01:20:50 +01:00 committed by GitHub
parent 9055a90a84
commit 5ffcca92a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -219,3 +219,8 @@ UPDATE llx_expeditiondet as ed SET ed.fk_product = (SELECT cd.fk_product FROM ll
ALTER TABLE llx_webhook_target ADD COLUMN type integer DEFAULT 0 NOT NULL AFTER label;
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'pixelfed', 'Pixelfed', '{socialid}', 'fa-pixelfed', 0);
-- Add input reason on invoice
ALTER TABLE llx_facture ADD COLUMN fk_input_reason integer NULL DEFAULT NULL AFTER last_main_doc;
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_input_reason (fk_input_reason);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_input_reason FOREIGN KEY (fk_input_reason) REFERENCES llx_c_input_reason (rowid);

View file

@ -31,9 +31,11 @@ ALTER TABLE llx_facture ADD INDEX idx_facture_fk_currency (fk_currency);
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_statut (fk_statut);
ALTER TABLE llx_facture ADD INDEX idx_facture_datef (datef);
ALTER TABLE llx_facture ADD INDEX idx_facture_tms (tms);
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_input_reason (fk_input_reason);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_input_reason FOREIGN KEY (fk_input_reason) REFERENCES llx_c_input_reason (rowid);

View file

@ -84,7 +84,7 @@ create table llx_facture
note_public text,
model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
fk_input_reason integer DEFAULT NULL, -- id coming from c_input_reason
fk_incoterms integer, -- for incoterms
location_incoterms varchar(255), -- for incoterms