llx_product_fournisseur_price.sql 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. -- ============================================================================
  2. -- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2009-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2009-2013 Regis Houssin <regis.houssin@inodbox.com>
  5. -- Copyright (C) 2012 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_product_fournisseur_price
  22. (
  23. rowid integer AUTO_INCREMENT PRIMARY KEY,
  24. entity integer DEFAULT 1 NOT NULL, -- multi company id
  25. datec datetime,
  26. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  27. fk_product integer,
  28. fk_soc integer,
  29. ref_fourn varchar(128),
  30. desc_fourn text,
  31. fk_availability integer,
  32. price double(24,8) DEFAULT 0, -- price without tax for quantity
  33. quantity double,
  34. remise_percent double NOT NULL DEFAULT 0,
  35. remise double NOT NULL DEFAULT 0,
  36. unitprice double(24,8) DEFAULT 0, -- unit price without tax (discount not taken into account, so rounding of price/quantity)
  37. charges double(24,8) DEFAULT 0, -- to store transport cost. Constant PRODUCT_CHARGES must be set to see it.
  38. default_vat_code varchar(10),
  39. barcode varchar(180) DEFAULT NULL, -- barcode
  40. fk_barcode_type integer DEFAULT NULL, -- barcode type
  41. tva_tx double(7,4) NOT NULL,
  42. localtax1_tx double(7,4) DEFAULT 0,
  43. localtax1_type varchar(10) NOT NULL DEFAULT '0',
  44. localtax2_tx double(7,4) DEFAULT 0,
  45. localtax2_type varchar(10) NOT NULL DEFAULT '0',
  46. info_bits integer NOT NULL DEFAULT 0,
  47. fk_user integer,
  48. fk_supplier_price_expression integer, -- Link to the rule for dynamic price calculation
  49. import_key varchar(14), -- Import key
  50. delivery_time_days integer,
  51. supplier_reputation varchar(10),
  52. packaging real DEFAULT NULL,
  53. fk_multicurrency integer,
  54. multicurrency_code varchar(3),
  55. multicurrency_tx double(24,8) DEFAULT 1,
  56. multicurrency_unitprice double(24,8) DEFAULT NULL, -- unit price without tax
  57. multicurrency_price double(24,8) DEFAULT NULL
  58. )ENGINE=innodb;