feat: refs#5167 Update #1976

Merged
jbreso merged 11 commits from 5167-kk-warehouseAlias-y-warehouseJoined into dev 2024-02-06 09:16:16 +00:00
2 changed files with 7 additions and 8 deletions
Showing only changes of commit 4a73bd0133 - Show all commits

View File

@ -1,16 +1,15 @@
CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`ticketStateToday`
AS SELECT `ts`.`ticketFk` AS `ticket`,
AS SELECT
`ts`.`ticketFk` AS `ticketFk`,
`ts`.`state` AS `state`,
`ts`.`productionOrder` AS `productionOrder`,
`ts`.`alertLevel` AS `alertLevel`,
`ts`.`userFk` AS `worker`,
`ts`.`userFk` AS `userFk`,
`ts`.`code` AS `code`,
`ts`.`updated` AS `updated`,
`ts`.`isPicked` AS `isPicked`
FROM (
`vn`.`ticketState` `ts`
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `ts`.`ticketFk`)
)
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`())
FROM `ticketState` `ts`
JOIN `ticket` `t` ON `t`.`id` = `ts`.`ticketFk`
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`());

View File

@ -9,7 +9,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
lhp.m3,
dl.minSpeed
FROM ticket t
JOIN ticketStateToday tst ON tst.ticket = t.id
JOIN ticketStateToday tst ON tst.ticketFk = t.id
JOIN state s ON s.id = tst.state
JOIN saleVolume sv ON sv.ticketFk = t.id
LEFT JOIN lastHourProduction lhp ON lhp.warehouseFk = t.warehouseFk