1-- ============================================================================ 2-- Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> 3-- Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr> 4-- 5-- This program is free software; you can redistribute it and/or modify 6-- it under the terms of the GNU General Public License as published by 7-- the Free Software Foundation; either version 3 of the License, or 8-- (at your option) any later version. 9-- 10-- This program is distributed in the hope that it will be useful, 11-- but WITHOUT ANY WARRANTY; without even the implied warranty of 12-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13-- GNU General Public License for more details. 14-- 15-- You should have received a copy of the GNU General Public License 16-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- 18-- ============================================================================ 19 20CREATE TABLE llx_accounting_bookkeeping 21( 22 rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, 23 entity integer DEFAULT 1 NOT NULL, -- | multi company id 24 piece_num integer NOT NULL, -- FEC:EcritureNum | accounting transaction id 25 doc_date date NOT NULL, -- FEC:PieceDate | date of source document 26 doc_type varchar(30) NOT NULL, -- | facture_client/reglement_client/facture_fournisseur/reglement_fournisseur/import 27 doc_ref varchar(300) NOT NULL, -- FEC:PieceRef | facture_client/reglement_client/... reference number 28 fk_doc integer NOT NULL, -- | facture_client/reglement_client/... rowid 29 fk_docdet integer NOT NULL, -- | facture_client/reglement_client/... line rowid 30 thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug) 31 subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account 32 subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account 33 numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number 34 label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account 35 label_operation varchar(255), -- FEC:EcritureLib | label of the operation 36 debit double(24,8) NOT NULL, -- FEC:Debit 37 credit double(24,8) NOT NULL, -- FEC:Credit 38 montant double(24,8) NULL, -- FEC:Montant (Not necessary) 39 sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) 40 multicurrency_amount double(24,8), -- FEC:Montantdevise 41 multicurrency_code varchar(255), -- FEC:Idevise 42 lettering_code varchar(255), -- FEC:EcritureLet 43 date_lettering datetime, -- FEC:DateLet 44 date_lim_reglement datetime DEFAULT NULL, -- FEC_suppl:DateLimitReglmt | payment deadline 45 fk_user_author integer NOT NULL, -- | user creating 46 fk_user_modif integer, -- | user making last change 47 date_creation datetime, -- FEC:EcritureDate | creation date 48 tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date 49 fk_user integer NULL, -- The id of user that validate the accounting source document 50 code_journal varchar(32) NOT NULL, -- FEC:JournalCode 51 journal_label varchar(255), -- FEC:JournalLib 52 date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification) 53 date_export datetime DEFAULT NULL, -- 54 import_key varchar(14), -- ID of import when data was inserted by a mass import 55 extraparams varchar(255) -- for other parameters with json format 56) ENGINE=innodb; 57