llx_commande_fournisseur.sql 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. -- ===================================================================
  2. -- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  4. -- Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  5. -- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  6. --
  7. -- This program is free software; you can redistribute it and/or modify
  8. -- it under the terms of the GNU General Public License as published by
  9. -- the Free Software Foundation; either version 3 of the License, or
  10. -- (at your option) any later version.
  11. --
  12. -- This program is distributed in the hope that it will be useful,
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. -- GNU General Public License for more details.
  16. --
  17. -- You should have received a copy of the GNU General Public License
  18. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. --
  20. -- ===================================================================
  21. create table llx_commande_fournisseur
  22. (
  23. rowid integer AUTO_INCREMENT PRIMARY KEY,
  24. ref varchar(180) NOT NULL, -- order number
  25. entity integer DEFAULT 1 NOT NULL, -- multi company id
  26. ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
  27. ref_supplier varchar(255),
  28. fk_soc integer NOT NULL,
  29. fk_projet integer DEFAULT 0, -- project id
  30. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  31. date_creation datetime, -- date de creation
  32. date_valid datetime, -- date de validation
  33. date_approve datetime, -- date de approve
  34. date_approve2 datetime, -- date de approve 2 (when double approving is accivated)
  35. date_commande date, -- date de la commande
  36. fk_user_author integer, -- user making creation
  37. fk_user_modif integer, -- user making last change
  38. fk_user_valid integer, -- user validating
  39. fk_user_approve integer, -- user approving
  40. fk_user_approve2 integer, -- user approving 2 (when double approving is accivated)
  41. source smallint NOT NULL, -- not used, except by setting this to 42 for orders coming for replenishment and 0 in other case ?
  42. fk_statut smallint default 0,
  43. billed smallint default 0,
  44. amount_ht double(24,8) default 0,
  45. remise_percent real default 0,
  46. remise real default 0,
  47. total_tva double(24,8) default 0,
  48. localtax1 double(24,8) default 0,
  49. localtax2 double(24,8) default 0,
  50. total_ht double(24,8) default 0,
  51. total_ttc double(24,8) default 0,
  52. note_private text,
  53. note_public text,
  54. model_pdf varchar(255),
  55. last_main_doc varchar(255), -- relative filepath+filename of last main generated document
  56. date_livraison datetime default NULL,
  57. fk_account integer, -- bank account
  58. fk_cond_reglement integer, -- condition de reglement
  59. fk_mode_reglement integer, -- mode de reglement
  60. fk_input_method integer default 0, -- id coming from c_input_reason, '0' if no defined
  61. fk_incoterms integer, -- for incoterms
  62. location_incoterms varchar(255), -- for incoterms
  63. import_key varchar(14),
  64. extraparams varchar(255), -- for stock other parameters with json format
  65. fk_multicurrency integer,
  66. multicurrency_code varchar(3),
  67. multicurrency_tx double(24,8) DEFAULT 1,
  68. multicurrency_total_ht double(24,8) DEFAULT 0,
  69. multicurrency_total_tva double(24,8) DEFAULT 0,
  70. multicurrency_total_ttc double(24,8) DEFAULT 0
  71. )ENGINE=innodb;