llx_accounting_bookkeeping.sql 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. -- ============================================================================
  2. -- Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
  3. -- Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
  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 <http://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. doc_date date NOT NULL, -- FEC:PieceDate
  24. doc_type varchar(30) NOT NULL, -- | facture_client/reglement_client/facture_fournisseur/reglement_fournisseur
  25. doc_ref varchar(300) NOT NULL, -- FEC:PieceRef | facture_client/reglement_client/... reference number
  26. fk_doc integer NOT NULL, -- | facture_client/reglement_client/... rowid
  27. fk_docdet integer NOT NULL, -- | facture_client/reglement_client/... line rowid
  28. thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
  29. subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account
  30. subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account
  31. numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number
  32. label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
  33. label_operation varchar(255), -- FEC:EcritureLib | label of the operation
  34. debit double(24,8) NOT NULL, -- FEC:Debit
  35. credit double(24,8) NOT NULL, -- FEC:Credit
  36. montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary)
  37. sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
  38. multicurrency_amount double(24,8), -- FEC:Montantdevise
  39. multicurrency_code varchar(255), -- FEC:Idevise
  40. lettering_code varchar(255), -- FEC:EcritureLet
  41. date_lettering datetime, -- FEC:DateLet
  42. date_lim_reglement datetime DEFAULT NULL, -- | date limite de reglement
  43. fk_user_author integer NOT NULL, -- | user creating
  44. fk_user_modif integer, -- | user making last change
  45. date_creation datetime, -- FEC:EcritureDate | creation date
  46. tms timestamp, -- | date last modification
  47. fk_user integer NULL, -- The id of user that validate the accounting source document
  48. code_journal varchar(32) NOT NULL, -- FEC:JournalCode
  49. journal_label varchar(255), -- FEC:JournalLib
  50. piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document
  51. validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
  52. date_validated datetime, -- FEC:ValidDate
  53. import_key varchar(14),
  54. extraparams varchar(255) -- for other parameters with json format
  55. ) ENGINE=innodb;