llx_facture_fourn_det.sql 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. -- ===================================================================
  2. -- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2010 juanjo Menent <jmenent@2byte.es>
  5. --
  6. -- This program is free software; you can redistribute it and/or modify
  7. -- it under the terms of the GNU General Public License as published by
  8. -- the Free Software Foundation; either version 3 of the License, or
  9. -- (at your option) any later version.
  10. --
  11. -- This program is distributed in the hope that it will be useful,
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. -- GNU General Public License for more details.
  15. --
  16. -- You should have received a copy of the GNU General Public License
  17. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. --
  19. -- ===================================================================
  20. create table llx_facture_fourn_det
  21. (
  22. rowid integer AUTO_INCREMENT PRIMARY KEY,
  23. fk_facture_fourn integer NOT NULL,
  24. fk_parent_line integer NULL,
  25. fk_product integer NULL,
  26. ref varchar(128), -- supplier product ref
  27. label varchar(255), -- product label
  28. description text,
  29. pu_ht double(24,8), -- unit price excluding tax
  30. pu_ttc double(24,8), -- unit price with tax
  31. qty real, -- quantity of product/service
  32. remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
  33. fk_remise_except integer NULL, -- Lien vers table des remises fixes
  34. vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
  35. tva_tx double(7,4), -- TVA taux product/service
  36. localtax1_tx double(7,4) DEFAULT 0, -- localtax1 rate
  37. localtax1_type varchar(10) NULL, -- localtax1 type
  38. localtax2_tx double(7,4) DEFAULT 0, -- localtax2 rate
  39. localtax2_type varchar(10) NULL, -- localtax2 type
  40. total_ht double(24,8), -- Total line price of product excluding tax
  41. tva double(24,8), -- Total TVA of line
  42. total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
  43. total_localtax2 double(24,8) DEFAULT 0, -- total LocalTax2 for total quantity of line
  44. total_ttc double(24,8), -- Total line with tax
  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. fk_code_ventilation integer DEFAULT 0 NOT NULL,
  50. special_code integer DEFAULT 0, -- code for special lines
  51. rang integer DEFAULT 0,
  52. import_key varchar(14),
  53. fk_unit integer DEFAULT NULL,
  54. fk_multicurrency integer,
  55. multicurrency_code varchar(3),
  56. multicurrency_subprice double(24,8) DEFAULT 0,
  57. multicurrency_total_ht double(24,8) DEFAULT 0,
  58. multicurrency_total_tva double(24,8) DEFAULT 0,
  59. multicurrency_total_ttc double(24,8) DEFAULT 0
  60. )ENGINE=innodb;