llx_societe.sql 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. -- ========================================================================
  2. -- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.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 <http://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(128), -- reference into an external system (not used by dolibarr)
  30. ref_int varchar(60), -- reference into an internal system (deprecated)
  31. statut tinyint DEFAULT 0, -- statut
  32. parent integer,
  33. tms timestamp,
  34. datec datetime, -- creation date
  35. status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité)
  36. code_client varchar(24), -- code client
  37. code_fournisseur varchar(24), -- code founisseur
  38. code_compta varchar(24), -- code compta client
  39. code_compta_fournisseur varchar(24), -- code compta founisseur
  40. address varchar(255), -- company address
  41. zip varchar(25), -- zipcode
  42. town varchar(50), -- town
  43. fk_departement integer DEFAULT 0, --
  44. fk_pays integer DEFAULT 0, --
  45. fk_account integer DEFAULT 0, --
  46. phone varchar(20), -- phone number
  47. fax varchar(20), -- fax number
  48. url varchar(255), --
  49. email varchar(128), --
  50. skype varchar(255), --
  51. fk_effectif integer DEFAULT 0, --
  52. fk_typent integer DEFAULT 0, --
  53. fk_forme_juridique integer DEFAULT 0, -- juridical status
  54. fk_currency varchar(3), -- default currency
  55. siren varchar(128), -- IDProf1: siren or RCS for france
  56. siret varchar(128), -- IDProf2: siret for france
  57. ape varchar(128), -- IDProf3: code ape for france
  58. idprof4 varchar(128), -- IDProf4: nu for france
  59. idprof5 varchar(128), -- IDProf5: nu for france
  60. idprof6 varchar(128), -- IDProf6: nu for france
  61. tva_intra varchar(20), -- tva
  62. capital real, -- capital de la societe
  63. fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
  64. note_private text, --
  65. note_public text, --
  66. model_pdf varchar(255),
  67. prefix_comm varchar(5), -- prefix commercial
  68. client tinyint DEFAULT 0, -- client 0/1/2
  69. fournisseur tinyint DEFAULT 0, -- fournisseur 0/1
  70. supplier_account varchar(32), -- compte client chez un fournisseur
  71. fk_prospectlevel varchar(12), -- prospect level (in llx_c_prospectlevel)
  72. fk_incoterms integer, -- for incoterms
  73. location_incoterms varchar(255), -- for incoterms
  74. customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1
  75. customer_rate real DEFAULT 0, -- taux fiabilite client (0 a 1)
  76. supplier_rate real DEFAULT 0, -- taux fiabilite fournisseur (0 a 1)
  77. fk_user_creat integer NULL, -- utilisateur qui a cree l'info
  78. fk_user_modif integer, -- utilisateur qui a modifie l'info
  79. remise_client real DEFAULT 0, -- remise systematique pour le client
  80. mode_reglement tinyint, -- mode de reglement
  81. cond_reglement tinyint, -- condition de reglement
  82. mode_reglement_supplier tinyint, -- mode de reglement fournisseur
  83. cond_reglement_supplier tinyint, -- condition de reglement fournisseur
  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(6,3),
  88. localtax2_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 2
  89. localtax2_value double(6,3),
  90. barcode varchar(255), -- 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. default_lang varchar(6), -- default language
  95. logo varchar(255),
  96. canvas varchar(32), -- type of canvas if used (null by default)
  97. import_key varchar(14), -- import key
  98. webservices_url varchar(255), -- supplier webservice url
  99. webservices_key varchar(128), -- supplier webservice key
  100. fk_multicurrency integer,
  101. multicurrency_code varchar(255)
  102. )ENGINE=innodb;