@@ -160,6 +160,35 @@ CREATE TABLE llx_bank_record_link
160160 fk_bank_import integer NOT NULL
161161)ENGINE= innodb;
162162
163+ CREATE TABLE llx_bank_import
164+ (
165+ rowid integer AUTO_INCREMENT PRIMARY KEY ,
166+ id_account integer NOT NULL , -- bank account ID in Dolibarr
167+ record_type varchar (64 ) NULL , -- OFX Type of transaction: DIRECTDEBIT, XFER, OTHER or code/type of operation
168+ label varchar (255 ) NOT NULL , -- label of operation
169+ record_type_origin varchar (255 ) NOT NULL , -- operation code/type origin
170+ label_origin varchar (255 ) NOT NULL , -- label of operation origin
171+ comment text NULL , -- Comment/Motif
172+ note text NULL , -- Notes like "References"
173+ bdate date NULL , -- date operation
174+ vdate date NULL , -- date value
175+ date_scraped datetime NULL , -- date discarded
176+ original_amount double(24 ,8 ) NULL , -- OFX amount
177+ original_currency varchar (255 ) NULL , -- OFX Currency
178+ amount_debit double(24 ,8 ) NOT NULL , -- money spent. For statement using debit/credit. For statement using 1 amount, use original_amount.
179+ amount_credit double(24 ,8 ) NOT NULL , -- money received. For statement using debit/credit. For statement using 1 amount, use original_amount.
180+ deleted_date datetime NULL , -- to flag this record as deleted
181+ fk_duplicate_of integer NULL , -- to flag this record as a duplicate of another one
182+ status smallint NOT NULL , -- 0=just imported
183+ datec datetime NOT NULL , -- date creation
184+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , -- date of last modification
185+ fk_user_author integer NOT NULL , -- user who created the record
186+ fk_user_modif integer , -- user who modified the record
187+ import_key varchar (14 ), -- import key
188+ datas text NOT NULL -- full record/line coming from source
189+ )ENGINE= innodb;
190+
191+
163192ALTER TABLE llx_bank_record_link ADD CONSTRAINT fk_bank_record_bank_record FOREIGN KEY (fk_bank_record) REFERENCES llx_bank_record (rowid);
164193ALTER TABLE llx_bank_record_link ADD CONSTRAINT fk_bank_import_bank_import FOREIGN KEY (fk_bank_import) REFERENCES llx_bank_import (rowid);
165194
0 commit comments