llx_stock_mouvement.sql 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- ============================================================================
  2. -- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2009-2015 Laurent Destailleur <eldy@users.sourceofrge.net>
  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 <https://www.gnu.org/licenses/>.
  17. --
  18. -- ============================================================================
  19. create table llx_stock_mouvement
  20. (
  21. rowid integer AUTO_INCREMENT PRIMARY KEY,
  22. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  23. datem datetime, -- Date and hour of movement
  24. fk_product integer NOT NULL, -- Id of product
  25. batch varchar(128) DEFAULT NULL, -- Lot or serial number
  26. eatby date DEFAULT NULL, -- Eatby date (deprecated, we should get value from batch number in table llx_product_lot)
  27. sellby date DEFAULT NULL, -- Sellby date (deprecated, we should get value from batch number in table llx_product_lot)
  28. fk_entrepot integer NOT NULL, -- Id warehouse
  29. value real, -- Qty of movement
  30. price double(24,8) DEFAULT 0, -- Entry price (used to calculate PMP, FIFO or LIFO value)
  31. type_mouvement smallint, -- Type/Direction of movement
  32. fk_user_author integer, -- Id user making movement
  33. label varchar(255), -- Comment on movement
  34. inventorycode varchar(128), -- Code used to group different movement line into one operation (may be an inventory, a mass picking)
  35. fk_project integer,
  36. fk_origin integer,
  37. origintype varchar(64),
  38. model_pdf varchar(255),
  39. fk_projet integer NOT NULL DEFAULT 0
  40. )ENGINE=innodb;