llx_accounting_bookkeeping.sql 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. CREATE TABLE llx_accounting_bookkeeping
  20. (
  21. rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  22. entity integer DEFAULT 1 NOT NULL, -- | multi company id
  23. piece_num integer NOT NULL, -- FEC:EcritureNum | accounting transaction id
  24. doc_date date NOT NULL, -- FEC:PieceDate | date of source document
  25. doc_type varchar(30) NOT NULL, -- | facture_client/reglement_client/facture_fournisseur/reglement_fournisseur/import
  26. doc_ref varchar(300) NOT NULL, -- FEC:PieceRef | facture_client/reglement_client/... reference number
  27. fk_doc integer NOT NULL, -- | facture_client/reglement_client/... rowid
  28. fk_docdet integer NOT NULL, -- | facture_client/reglement_client/... line rowid
  29. thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
  30. subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account
  31. subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account
  32. numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number
  33. label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
  34. label_operation varchar(255), -- FEC:EcritureLib | label of the operation
  35. debit double(24,8) NOT NULL, -- FEC:Debit
  36. credit double(24,8) NOT NULL, -- FEC:Credit
  37. montant double(24,8) NULL, -- FEC:Montant (Not necessary)
  38. sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
  39. multicurrency_amount double(24,8), -- FEC:Montantdevise
  40. multicurrency_code varchar(255), -- FEC:Idevise
  41. lettering_code varchar(255), -- FEC:EcritureLet
  42. date_lettering datetime, -- FEC:DateLet
  43. date_lim_reglement datetime DEFAULT NULL, -- FEC_suppl:DateLimitReglmt | payment deadline
  44. fk_user_author integer NOT NULL, -- | user creating
  45. fk_user_modif integer, -- | user making last change
  46. date_creation datetime, -- FEC:EcritureDate | creation date
  47. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date
  48. fk_user integer NULL, -- The id of user that validate the accounting source document
  49. code_journal varchar(32) NOT NULL, -- FEC:JournalCode
  50. journal_label varchar(255), -- FEC:JournalLib
  51. date_validated datetime, -- FEC:ValidDate | if empty: movement not validated / if not empty: movement validated (No deleting / No modification)
  52. date_export datetime DEFAULT NULL, --
  53. import_key varchar(14), -- ID of import when data was inserted by a mass import
  54. extraparams varchar(255) -- for other parameters with json format
  55. ) ENGINE=innodb;