refs #6321 feat: vCustomWhere
This commit is contained in:
parent
0111aa1b75
commit
2bcb6366b2
|
@ -2,7 +2,7 @@ DROP PROCEDURE IF EXISTS vn.item_getLack;
|
|||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getLack`(IN vForce BOOLEAN, IN vDays INT, IN vSearch VARCHAR(500))
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_getLack`(IN vForce BOOLEAN, IN vDays INT, IN vCustomWhere VARCHAR(500))
|
||||
BEGIN
|
||||
/**
|
||||
* Calcula una tabla con el máximo negativo visible para cada producto y almacen
|
||||
|
@ -12,15 +12,11 @@ BEGIN
|
|||
* @param vSearch Filtro items
|
||||
**/
|
||||
|
||||
DECLARE vIsSearch BOOL DEFAULT vSearch IS NOT NULL AND vSearch <> '';
|
||||
CALL `cache`.stock_refresh(vForce);
|
||||
CALL item_getMinacum(NULL, util.VN_CURDATE(), vDays, NULL);
|
||||
CALL item_getMinETD();
|
||||
CALL item_zoneClosure();
|
||||
|
||||
IF vIsSearch THEN
|
||||
SET vSearch =' ';
|
||||
END IF;
|
||||
|
||||
SELECT i.id itemFk,
|
||||
i.longName,
|
||||
|
@ -54,6 +50,7 @@ BEGIN
|
|||
WHERE w.isForTicket
|
||||
AND ic.display
|
||||
AND it.code != 'GEN'
|
||||
AND (vCustomWhere IS NULL OR vCustomWhere = '' OR vCustomWhere)
|
||||
GROUP BY i.id, w.id
|
||||
HAVING lack < 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue