llx_facture_fourn_det_rec.sql 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. -- ===================================================================
  2. --
  3. -- This program is free software; you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation; either version 3 of the License, or
  6. -- (at your option) any later version.
  7. --
  8. -- This program is distributed in the hope that it will be useful,
  9. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. -- GNU General Public License for more details.
  12. --
  13. -- You should have received a copy of the GNU General Public License
  14. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. --
  16. -- ===================================================================
  17. create table llx_facture_fourn_det_rec
  18. (
  19. rowid integer AUTO_INCREMENT PRIMARY KEY,
  20. fk_facture_fourn integer NOT NULL,
  21. fk_parent_line integer NULL,
  22. fk_product integer NULL,
  23. ref varchar(50), -- supplier product ref
  24. label varchar(255) DEFAULT NULL,
  25. description text,
  26. pu_ht double(24,8), -- unit price excluding tax
  27. pu_ttc double(24,8), -- unit price with tax
  28. qty real, -- quantity of product/service
  29. remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
  30. fk_remise_except integer NULL, -- Lien vers table des remises fixes
  31. vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
  32. tva_tx double(7,4), -- taux tva
  33. localtax1_tx double(7,4) DEFAULT 0, -- localtax1 rate
  34. localtax1_type varchar(10) NULL, -- localtax1 type
  35. localtax2_tx double(7,4) DEFAULT 0, -- localtax2 rate
  36. localtax2_type varchar(10) NULL, -- localtax2 type
  37. total_ht double(24,8), -- Total HT de la ligne toute quantity et incluant remise ligne et globale
  38. total_tva double(24,8), -- Total TVA de la ligne toute quantity et incluant remise ligne et globale
  39. total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
  40. total_localtax2 double(24,8) DEFAULT 0, -- total LocalTax2 for total quantity of line
  41. total_ttc double(24,8), -- Total TTC de la ligne toute quantity et incluant remise ligne et globale
  42. product_type integer DEFAULT 0,
  43. date_start integer DEFAULT NULL, -- date debut si service
  44. date_end integer DEFAULT NULL, -- date fin si service
  45. info_bits integer DEFAULT 0, -- TVA NPR ou non
  46. special_code integer UNSIGNED DEFAULT 0, -- code for special lines
  47. rang integer DEFAULT 0, -- ordre d'affichage
  48. fk_unit integer DEFAULT NULL,
  49. import_key varchar(14),
  50. fk_user_author integer, -- user making creation
  51. fk_user_modif integer, -- user making last change
  52. fk_multicurrency integer,
  53. multicurrency_code varchar(3),
  54. multicurrency_subprice double(24,8) DEFAULT 0,
  55. multicurrency_total_ht double(24,8) DEFAULT 0,
  56. multicurrency_total_tva double(24,8) DEFAULT 0,
  57. multicurrency_total_ttc double(24,8) DEFAULT 0
  58. )ENGINE=innodb;