diff --git a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql index 327934a43..166ec476c 100644 --- a/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql +++ b/db/routines/vn/procedures/expedition_selfConsumptionPackaging.sql @@ -54,7 +54,9 @@ proc:BEGIN WHERE shipped BETWEEN vCreated AND util.dayEnd(vCreated) AND clientFk = vClientFk AND addressFk = vAddressFk - AND warehouseFk = vWarehouseFk; + AND warehouseFk = vWarehouseFk + AND nickname = 'CAJAS AUTOCONSUMO' + LIMIT 1; IF vTicketFk IS NULL AND vAction = 'add' THEN INSERT INTO ticket(clientFk, warehouseFk, shipped, nickname, addressFk)