FIX : tables

This commit is contained in:
Gauthier PC portable 024 2021-02-09 10:38:35 +01:00
parent bed723aec0
commit cd3ac694bb
4 changed files with 28 additions and 26 deletions

View File

@ -1,6 +1,5 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -18,11 +17,10 @@
-- ============================================================================ -- ============================================================================
ALTER TABLE llx_salary ADD INDEX idx_salary_ref (num_payment); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_ref (num_payment);
ALTER TABLE llx_salary ADD INDEX idx_salary_user (fk_user, entity); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_user (fk_user, entity);
ALTER TABLE llx_salary ADD INDEX idx_salary_datep (datep); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datep (datep);
ALTER TABLE llx_salary ADD INDEX idx_salary_datesp (datesp); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_datesp (datesp);
ALTER TABLE llx_salary ADD INDEX idx_salary_dateep (dateep); ALTER TABLE llx_payment_salary ADD INDEX idx_payment_salary_dateep (dateep);
ALTER TABLE llx_salary ADD CONSTRAINT fk_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
ALTER TABLE llx_payment_salary ADD CONSTRAINT fk_payment_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);

View File

@ -1,6 +1,5 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- 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 -- 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 -- it under the terms of the GNU General Public License as published by
@ -20,16 +19,23 @@
create table llx_payment_salary create table llx_payment_salary
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_salary integer, ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
datec datetime, -- date de creation tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
tms timestamp, datec datetime, -- Create date
datep datetime, -- payment date fk_user integer NOT NULL,
amount double(24,8) DEFAULT 0, datep date, -- payment date
fk_typepaiement integer NOT NULL, datev date, -- value date (this field should not be here, only into bank tables)
num_paiement varchar(50), 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, note text,
fk_bank integer NOT NULL, fk_bank integer,
fk_user_creat integer, -- creation user fk_user_author integer, -- user creating
fk_user_modif integer -- last modification user fk_user_modif integer -- user making last change
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,5 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2019 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 -- 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 -- it under the terms of the GNU General Public License as published by
@ -18,4 +17,4 @@
-- =================================================================== -- ===================================================================
ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object); ALTER TABLE llx_payment_salary_extrafields ADD INDEX idx_payment_salary_extrafields (fk_object);

View File

@ -1,6 +1,5 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2019 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 -- 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 -- it under the terms of the GNU General Public License as published by
@ -17,10 +16,10 @@
-- --
-- =================================================================== -- ===================================================================
create table llx_salary_extrafields create table llx_payment_salary_extrafields
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- salary payment id fk_object integer NOT NULL, -- salary payment id
import_key varchar(14) -- import key import_key varchar(14) -- import key
)ENGINE=innodb; )ENGINE=innodb;