llx_commande_fournisseurdet.sql 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. -- ===================================================================
  2. -- Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
  5. -- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
  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_fournisseurdet
  22. (
  23. rowid integer AUTO_INCREMENT PRIMARY KEY,
  24. fk_commande integer NOT NULL,
  25. fk_parent_line integer NULL,
  26. fk_product integer,
  27. ref varchar(128), -- supplier product ref
  28. label varchar(255), -- product label
  29. description text,
  30. vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
  31. tva_tx double(7,4) DEFAULT 0, -- taux tva
  32. localtax1_tx double(7,4) DEFAULT 0, -- localtax1 rate
  33. localtax1_type varchar(10) NULL, -- localtax1 type
  34. localtax2_tx double(7,4) DEFAULT 0, -- localtax2 rate
  35. localtax2_type varchar(10) NULL, -- localtax2 type
  36. qty real, -- quantity
  37. remise_percent real DEFAULT 0, -- pourcentage de remise
  38. remise real DEFAULT 0, -- montant de la remise
  39. subprice double(24,8) DEFAULT 0, -- prix unitaire
  40. total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale
  41. total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
  42. total_localtax1 double(24,8) DEFAULT 0, -- Total Local Tax 1
  43. total_localtax2 double(24,8) DEFAULT 0, -- Total Local Tax 2
  44. total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
  45. product_type integer DEFAULT 0,
  46. date_start datetime DEFAULT NULL, -- date debut si service
  47. date_end datetime DEFAULT NULL, -- date fin si service
  48. info_bits integer DEFAULT 0, -- TVA NPR ou non
  49. special_code integer DEFAULT 0, -- code for special lines
  50. rang integer DEFAULT 0,
  51. import_key varchar(14),
  52. fk_unit integer DEFAULT NULL,
  53. fk_multicurrency integer,
  54. multicurrency_code varchar(3),
  55. multicurrency_subprice double(24,8) DEFAULT 0,
  56. multicurrency_total_ht double(24,8) DEFAULT 0,
  57. multicurrency_total_tva double(24,8) DEFAULT 0,
  58. multicurrency_total_ttc double(24,8) DEFAULT 0
  59. )ENGINE=innodb;