7773-testToMaster_2430 #2774
|
@ -12,24 +12,16 @@ BEGIN
|
||||||
* @vWarehouseFk Id de almacén
|
* @vWarehouseFk Id de almacén
|
||||||
* @vDated Fecha a calcular, si es NULL muestra el histórico desde el inventario
|
* @vDated Fecha a calcular, si es NULL muestra el histórico desde el inventario
|
||||||
*/
|
*/
|
||||||
DECLARE vDateInventory DATETIME;
|
DECLARE vDateInventory DATETIME
|
||||||
DECLARE vLifeScope DATE;
|
DEFAULT (
|
||||||
DECLARE vWarehouseInventoryFk INT;
|
SELECT IF(vDated, uc.mockUtcTime, c.inventoried)
|
||||||
DECLARE vSupplierInventoryFk INT;
|
|
||||||
|
|
||||||
SELECT IF(vDated, uc.mockUtcTime, c.inventoried) INTO vDateInventory
|
|
||||||
FROM config c
|
FROM config c
|
||||||
JOIN util.config uc;
|
JOIN util.config uc
|
||||||
|
);
|
||||||
|
DECLARE vSupplierInventoryFk INT
|
||||||
|
DEFAULT (SELECT supplierFk FROM inventoryConfig);
|
||||||
|
|
||||||
SELECT vDateInventory - INTERVAL MAX(life) DAY
|
IF NOT vSupplierInventoryFk OR NOT vDateInventory THEN
|
||||||
INTO vLifeScope
|
|
||||||
FROM itemType;
|
|
||||||
|
|
||||||
SELECT warehouseOutFk, supplierFk
|
|
||||||
INTO vWarehouseInventoryFk, vSupplierInventoryFk
|
|
||||||
FROM inventoryConfig;
|
|
||||||
|
|
||||||
IF NOT vWarehouseInventoryFk OR NOT vSupplierInventoryFk THEN
|
|
||||||
CALL util.throw('Config variables are not set');
|
CALL util.throw('Config variables are not set');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue