fix(getMovable): show correct movable
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b4bed608ab
commit
135aff27a4
|
@ -6,20 +6,23 @@ CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticket_getMovable`(vTicketFk INT, vDat
|
|||
BEGIN
|
||||
/**
|
||||
* Cálcula el stock movible para los artículos de un ticket
|
||||
* vDatedNew debe ser menor que vDatedOld, en los otros casos se
|
||||
* asume que siempre es posible
|
||||
*
|
||||
* @param vTicketFk -> Ticket
|
||||
* @param vDatedNew -> Nueva fecha
|
||||
* @return Sales con Movible
|
||||
*/
|
||||
DECLARE vDatedOld DATETIME;
|
||||
|
||||
SET vDatedNew = DATE_ADD(vDatedNew, INTERVAL 1 DAY);
|
||||
|
||||
SELECT t.shipped INTO vDatedOld
|
||||
FROM ticket t
|
||||
WHERE t.id = vTicketFk;
|
||||
|
||||
CALL itemStock(vWarehouseFk, vDatedNew, NULL);
|
||||
CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(vDatedOld, vDatedNew), NULL);
|
||||
|
||||
CALL itemStock(vWarehouseFk, vDatedNew, NULL);
|
||||
CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(DATE_SUB(vDatedOld, INTERVAL 1 DAY), vDatedNew), NULL);
|
||||
|
||||
SELECT s.id,
|
||||
s.itemFk,
|
||||
s.quantity,
|
||||
|
|
Loading…
Reference in New Issue