llx_inventorydet-stock.sql 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. -- ===================================================================
  2. -- Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
  3. -- Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
  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_inventorydet
  20. (
  21. rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  22. datec datetime DEFAULT NULL,
  23. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  24. fk_inventory integer DEFAULT 0,
  25. fk_warehouse integer DEFAULT 0,
  26. fk_product integer DEFAULT 0,
  27. batch varchar(128) DEFAULT NULL, -- Lot or serial number
  28. qty_stock double DEFAULT NULL, -- Value or real stock we have, when we start the inventory (may be updated during intermediary steps).
  29. qty_view double DEFAULT NULL, -- Quantity found during inventory. It is the targeted value, filled during edition of inventory.
  30. qty_regulated double DEFAULT NULL, -- Never used. Deprecated because we already have the fk_movement now.
  31. pmp_real double DEFAULT NULL,
  32. pmp_expected double DEFAULT NULL,
  33. fk_movement integer NULL -- can contain the id of stock movement we recorded to make the inventory regulation of this line
  34. )
  35. ENGINE=innodb;