From ab48351d15ce4fa150618fd2f189039fd8a84379 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 29 Sep 2021 11:10:58 +0200 Subject: [PATCH] NEW: deposit payment terms: database fields --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 5 +++++ htdocs/install/mysql/tables/llx_c_payment_term.sql | 1 + htdocs/install/mysql/tables/llx_commande.sql | 1 + htdocs/install/mysql/tables/llx_propal.sql | 1 + htdocs/install/mysql/tables/llx_societe.sql | 1 + 5 files changed, 9 insertions(+) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 03bb7631dda..3e5d86b5dd6 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -149,3 +149,8 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', ' INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening'); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse'); +-- Deposit generation helper with specific payment terms +ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent real DEFAULT NULL AFTER decalage; +ALTER TABLE llx_societe ADD COLUMN deposit_percent real DEFAULT NULL AFTER cond_reglement; +ALTER TABLE llx_propal ADD COLUMN deposit_percent real DEFAULT NULL AFTER fk_cond_reglement; +ALTER TABLE llx_commande ADD COLUMN deposit_percent real DEFAULT NULL AFTER fk_cond_reglement; diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.sql b/htdocs/install/mysql/tables/llx_c_payment_term.sql index 087ab63c184..6ed1c580e4f 100644 --- a/htdocs/install/mysql/tables/llx_c_payment_term.sql +++ b/htdocs/install/mysql/tables/llx_c_payment_term.sql @@ -30,6 +30,7 @@ create table llx_c_payment_term type_cdr tinyint, -- Type of change date reckoning. 1=Payment at end of current month, 2=the Nth of next month nbjour smallint, decalage smallint, + deposit_percent real DEFAULT NULL, module varchar(32) NULL, position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index e3a075933c2..096bd8305a2 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -63,6 +63,7 @@ create table llx_commande fk_account integer, -- bank account fk_currency varchar(3), -- currency code fk_cond_reglement integer, -- condition de reglement + deposit_percent real DEFAULT NULL, -- default deposit % if payment term needs it fk_mode_reglement integer, -- mode de reglement date_livraison datetime default NULL, diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index 7c94086b3b9..e795d63ff8b 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -58,6 +58,7 @@ create table llx_propal fk_account integer, -- bank account fk_currency varchar(3), -- currency code fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...) + deposit_percent real DEFAULT NULL, -- default deposit % if payment term needs it fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement) note_private text, diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 7112b6e93ea..eb2ac1cd136 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -92,6 +92,7 @@ create table llx_societe remise_supplier real DEFAULT 0, -- discount by default granted by this supplier mode_reglement tinyint, -- payment mode customer cond_reglement tinyint, -- payment term customer + deposit_percent real DEFAULT NULL, -- default deposit % if payment term needs it transport_mode tinyint, -- transport mode customer (Intracomm report) mode_reglement_supplier tinyint, -- payment mode supplier cond_reglement_supplier tinyint, -- payment term supplier