llx_product_perentity.sql 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. -- ========================================================================
  2. -- Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
  3. -- Copyright (C) 2022 Regis Houssin <regis.houssin@inodbox.com>
  4. --
  5. -- This program is free software; you can redistribute it and/or modify
  6. -- it under the terms of the GNU General Public License as published by
  7. -- the Free Software Foundation; either version 3 of the License, or
  8. -- (at your option) any later version.
  9. --
  10. -- This program is distributed in the hope that it will be useful,
  11. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. -- GNU General Public License for more details.
  14. --
  15. -- You should have received a copy of the GNU General Public License
  16. -- along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. --
  18. -- ========================================================================
  19. create table llx_product_perentity
  20. (
  21. rowid integer AUTO_INCREMENT PRIMARY KEY,
  22. fk_product integer,
  23. entity integer DEFAULT 1 NOT NULL, -- multi company id
  24. default_vat_code varchar(10), -- Same code than into table llx_c_tva (but no constraints). Should be used in priority to find default vat, npr, localtaxes for product.
  25. tva_tx double(7,4), -- Default VAT rate of product
  26. recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT
  27. localtax1_tx double(7,4) DEFAULT 0,
  28. localtax1_type varchar(10) NOT NULL DEFAULT '0',
  29. localtax2_tx double(7,4) DEFAULT 0,
  30. localtax2_type varchar(10) NOT NULL DEFAULT '0',
  31. tosell tinyint DEFAULT 1, -- Product you sell
  32. tobuy tinyint DEFAULT 1, -- Product you buy
  33. url varchar(255),
  34. barcode varchar(180) DEFAULT NULL, -- barcode
  35. fk_barcode_type integer DEFAULT NULL, -- barcode type
  36. accountancy_code_sell varchar(32), -- Selling accountancy code
  37. accountancy_code_sell_intra varchar(32), -- Selling accountancy code for vat intracommunity
  38. accountancy_code_sell_export varchar(32), -- Selling accountancy code for vat export
  39. accountancy_code_buy varchar(32), -- Buying accountancy code
  40. accountancy_code_buy_intra varchar(32), -- Buying accountancy code for vat intracommunity
  41. accountancy_code_buy_export varchar(32), -- Buying accountancy code for vat import
  42. pmp double(24,8)
  43. )ENGINE=innodb;