llx_facture_fourn.sql 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. -- ===========================================================================
  2. -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
  5. -- Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  6. -- Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
  7. --
  8. -- This program is free software; you can redistribute it and/or modify
  9. -- it under the terms of the GNU General Public License as published by
  10. -- the Free Software Foundation; either version 3 of the License, or
  11. -- (at your option) any later version.
  12. --
  13. -- This program is distributed in the hope that it will be useful,
  14. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. -- GNU General Public License for more details.
  17. --
  18. -- You should have received a copy of the GNU General Public License
  19. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. --
  21. -- ===========================================================================
  22. create table llx_facture_fourn
  23. (
  24. rowid integer AUTO_INCREMENT PRIMARY KEY,
  25. ref varchar(180) NOT NULL,
  26. ref_supplier varchar(180) NOT NULL,
  27. entity integer DEFAULT 1 NOT NULL, -- multi company id
  28. ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
  29. type smallint DEFAULT 0 NOT NULL,
  30. fk_soc integer NOT NULL,
  31. datec datetime, -- date de creation de la facture
  32. datef date, -- date invoice
  33. date_pointoftax date DEFAULT NULL, -- date point of tax (for GB)
  34. date_valid date, -- date validation
  35. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
  36. date_closing datetime, -- date closing
  37. libelle varchar(255),
  38. paye smallint DEFAULT 0 NOT NULL,
  39. amount double(24,8) DEFAULT 0 NOT NULL,
  40. remise double(24,8) DEFAULT 0,
  41. close_code varchar(16), -- Code motif cloture sans paiement complet
  42. close_missing_amount double(24,8), -- Amount missing when closing with a not complete payment
  43. close_note varchar(128), -- Commentaire cloture sans paiement complet
  44. tva double(24,8) DEFAULT 0,
  45. localtax1 double(24,8) DEFAULT 0,
  46. localtax2 double(24,8) DEFAULT 0,
  47. total double(24,8) DEFAULT 0,
  48. total_ht double(24,8) DEFAULT 0,
  49. total_tva double(24,8) DEFAULT 0,
  50. total_ttc double(24,8) DEFAULT 0,
  51. fk_statut smallint DEFAULT 0 NOT NULL,
  52. fk_user_author integer, -- user making creation
  53. fk_user_modif integer, -- user making last change
  54. fk_user_valid integer, -- user validating
  55. fk_user_closing integer, -- user closing
  56. fk_fac_rec_source integer, -- facture rec source
  57. fk_facture_source integer, -- facture origine si facture avoir
  58. fk_projet integer, -- projet auquel est associee la facture
  59. fk_account integer, -- bank account
  60. fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
  61. fk_mode_reglement integer, -- mode de reglement (CHQ, VIR, ...)
  62. date_lim_reglement date, -- date limite de reglement
  63. note_private text,
  64. note_public text,
  65. fk_incoterms integer, -- for incoterms
  66. location_incoterms varchar(255), -- for incoterms
  67. fk_transport_mode integer, -- for intracomm report
  68. model_pdf varchar(255),
  69. last_main_doc varchar(255), -- relative filepath+filename of last main generated document
  70. import_key varchar(14),
  71. extraparams varchar(255), -- for stock other parameters with json format
  72. fk_multicurrency integer,
  73. multicurrency_code varchar(3),
  74. multicurrency_tx double(24,8) DEFAULT 1,
  75. multicurrency_total_ht double(24,8) DEFAULT 0,
  76. multicurrency_total_tva double(24,8) DEFAULT 0,
  77. multicurrency_total_ttc double(24,8) DEFAULT 0
  78. )ENGINE=innodb;