llx_societe.sql 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. -- ========================================================================
  2. -- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
  5. -- Copyright (C) 2010 Juanjo Menent <dolibarr@2byte.es>
  6. -- Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
  7. -- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
  8. --
  9. -- This program is free software; you can redistribute it and/or modify
  10. -- it under the terms of the GNU General Public License as published by
  11. -- the Free Software Foundation; either version 3 of the License, or
  12. -- (at your option) any later version.
  13. --
  14. -- This program is distributed in the hope that it will be useful,
  15. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. -- GNU General Public License for more details.
  18. --
  19. -- You should have received a copy of the GNU General Public License
  20. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. --
  22. -- ========================================================================
  23. create table llx_societe
  24. (
  25. rowid integer AUTO_INCREMENT PRIMARY KEY,
  26. nom varchar(128), -- company reference name (should be same length than adherent.societe)
  27. name_alias varchar(128) NULL,
  28. entity integer DEFAULT 1 NOT NULL, -- multi company id
  29. ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
  30. ref_int varchar(255), -- reference into an internal system (deprecated)
  31. statut tinyint DEFAULT 0, -- statut
  32. parent integer,
  33. status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité)
  34. code_client varchar(24), -- code client
  35. code_fournisseur varchar(24), -- code fournisseur
  36. code_compta varchar(24), -- customer accountancy auxiliary account
  37. code_compta_fournisseur varchar(24), -- supplier accountancy auxiliary account
  38. address varchar(255), -- company address
  39. zip varchar(25), -- zipcode
  40. town varchar(50), -- town
  41. fk_departement integer DEFAULT 0, --
  42. fk_pays integer DEFAULT 0, --
  43. fk_account integer DEFAULT 0, --
  44. phone varchar(20), -- phone number
  45. fax varchar(20), -- fax number
  46. url varchar(255), --
  47. email varchar(128), --
  48. socialnetworks text DEFAULT NULL, -- json with socialnetworks
  49. fk_effectif integer DEFAULT 0, --
  50. fk_typent integer DEFAULT NULL, -- type ent
  51. fk_forme_juridique integer DEFAULT 0, -- juridical status
  52. fk_currency varchar(3), -- default currency
  53. siren varchar(128), -- IDProf1: depends on country (example: siren or RCS for france, ...)
  54. siret varchar(128), -- IDProf2: depends on country (example: siret for france, ...)
  55. ape varchar(128), -- IDProf3: depends on country (example: code ape for france, ...)
  56. idprof4 varchar(128), -- IDProf4: depends on country (example: nu for france, ...)
  57. idprof5 varchar(128), -- IDProf5: depends on country (example: nu for france, ...)
  58. idprof6 varchar(128), -- IDProf6: depends on country (example: nu for france, ...
  59. tva_intra varchar(20), -- vat numero
  60. capital double(24,8) DEFAULT NULL, -- capital of company
  61. fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial status
  62. note_private text, --
  63. note_public text, --
  64. model_pdf varchar(255),
  65. last_main_doc varchar(255), -- relative filepath+filename of last main generated document
  66. prefix_comm varchar(5), -- prefix commercial (deprecated)
  67. client tinyint DEFAULT 0, -- client 0/1/2
  68. fournisseur tinyint DEFAULT 0, -- fournisseur 0/1
  69. supplier_account varchar(32), -- Id of our customer account known by the supplier
  70. fk_prospectlevel varchar(12), -- prospect level (in llx_c_prospectlevel)
  71. fk_incoterms integer, -- for incoterms
  72. location_incoterms varchar(255), -- for incoterms
  73. customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1
  74. customer_rate real DEFAULT 0, -- taux fiabilite client (0 a 1)
  75. supplier_rate real DEFAULT 0, -- taux fiabilite fournisseur (0 a 1)
  76. remise_client real DEFAULT 0, -- discount by default granted to this customer
  77. remise_supplier real DEFAULT 0, -- discount by default granted by this supplier
  78. mode_reglement tinyint, -- payment mode customer
  79. cond_reglement tinyint, -- payment term customer
  80. transport_mode tinyint, -- transport mode customer (Intracomm report)
  81. mode_reglement_supplier tinyint, -- payment mode supplier
  82. cond_reglement_supplier tinyint, -- payment term supplier
  83. transport_mode_supplier tinyint, -- transport mode supplier (Intracomm report)
  84. fk_shipping_method integer, -- preferred shipping method id
  85. tva_assuj tinyint DEFAULT 1, -- assujeti ou non a la TVA
  86. localtax1_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 1
  87. localtax1_value double(7,4),
  88. localtax2_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 2
  89. localtax2_value double(7,4),
  90. barcode varchar(180), -- barcode
  91. fk_barcode_type integer NULL DEFAULT 0, -- barcode type
  92. price_level integer NULL, -- level of price for multiprices
  93. outstanding_limit double(24,8) DEFAULT NULL, -- allowed outstanding limit
  94. order_min_amount double(24,8) DEFAULT NULL, -- min amount for orders
  95. supplier_order_min_amount double(24,8) DEFAULT NULL, -- min amount for supplier orders
  96. default_lang varchar(6), -- default language
  97. logo varchar(255) DEFAULT NULL,
  98. logo_squarred varchar(255) DEFAULT NULL,
  99. canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default)
  100. fk_warehouse integer DEFAULT NULL, -- if we need a link between third party and warehouse
  101. webservices_url varchar(255), -- supplier webservice url
  102. webservices_key varchar(128), -- supplier webservice key
  103. accountancy_code_sell varchar(32), -- Selling accountancy code
  104. accountancy_code_buy varchar(32), -- Buying accountancy code
  105. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
  106. datec datetime, -- creation date
  107. fk_user_creat integer NULL, -- utilisateur qui a cree l'info
  108. fk_user_modif integer, -- utilisateur qui a modifie l'info
  109. fk_multicurrency integer,
  110. multicurrency_code varchar(3),
  111. import_key varchar(14) -- import key
  112. )ENGINE=innodb;