From 0dc77851c007d22a9c83086e11dea0e05e96251b Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 11 Nov 2024 11:34:37 +0100 Subject: [PATCH] fix: refs #4948 Tests --- db/dump/fixtures.before.sql | 4 ++-- db/routines/vn/triggers/expedition_afterDelete.sql | 2 -- db/routines/vn/triggers/expedition_beforeDelete.sql | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index f25a4aab4..b0fb3a8d9 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -2954,9 +2954,9 @@ INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`) VALUES (1, 9); -INSERT INTO `vn`.`productionConfig` (`isPreviousPreparationRequired`, `ticketPrintedMax`, `ticketTrolleyMax`, `rookieDays`, `notBuyingMonths`, `id`, `isZoneClosedByExpeditionActivated`, `maxNotReadyCollections`, `minTicketsToCloseZone`, `movingTicketDelRoute`, `defaultZone`, `defautlAgencyMode`, `hasUniqueCollectionTime`, `maxCollectionWithoutUser`, `pendingCollectionsOrder`, `pendingCollectionsAge`, `backupPrinterNotificationDelay`) +INSERT INTO `vn`.`productionConfig` (`isPreviousPreparationRequired`, `ticketPrintedMax`, `ticketTrolleyMax`, `rookieDays`, `notBuyingMonths`, `id`, `isZoneClosedByExpeditionActivated`, `maxNotReadyCollections`, `minTicketsToCloseZone`, `movingTicketDelRoute`, `defaultZone`, `defautlAgencyMode`, `hasUniqueCollectionTime`, `maxCollectionWithoutUser`, `pendingCollectionsOrder`, `pendingCollectionsAge`, `backupPrinterNotificationDelay`, `clientSelfConsumptionFk`, `addressSelfConsumptionFk`) VALUES - (0, 8, 80, 0, 0, 1, 0, 15, 25, -1, 697, 1328, 0, 1, 8, 6, 3600); + (0, 8, 80, 0, 0, 1, 0, 15, 25, -1, 697, 1328, 0, 1, 8, 6, 3600, 1112, 12); INSERT INTO `vn`.`collection` (`id`, `created`, `workerFk`, `stateFk`, `itemPackingTypeFk`, `saleTotalCount`, `salePickedCount`, `trainFk`, `sectorFk`, `wagons`) VALUES diff --git a/db/routines/vn/triggers/expedition_afterDelete.sql b/db/routines/vn/triggers/expedition_afterDelete.sql index 0a9a37375..5d74a71e5 100644 --- a/db/routines/vn/triggers/expedition_afterDelete.sql +++ b/db/routines/vn/triggers/expedition_afterDelete.sql @@ -8,7 +8,5 @@ BEGIN `changedModel` = 'Expedition', `changedModelId` = OLD.id, `userFk` = account.myUser_getId(); - - CALL expedition_selfConsumptionPackaging(OLD.id, 'remove'); END$$ DELIMITER ; diff --git a/db/routines/vn/triggers/expedition_beforeDelete.sql b/db/routines/vn/triggers/expedition_beforeDelete.sql index 13ba19631..60d3a6ca1 100644 --- a/db/routines/vn/triggers/expedition_beforeDelete.sql +++ b/db/routines/vn/triggers/expedition_beforeDelete.sql @@ -7,6 +7,7 @@ BEGIN SET packages = (SELECT COUNT(counter)-1 FROM expedition e WHERE e.ticketFk = OLD.ticketFk and e.freightItemFk) WHERE t.id = OLD.ticketFk; - + + CALL expedition_selfConsumptionPackaging(OLD.id, 'remove'); END$$ DELIMITER ;