8355-testToMaster #3336

Merged
alexm merged 241 commits from 8355-testToMaster into master 2025-01-07 06:44:57 +00:00
3 changed files with 5 additions and 52 deletions
Showing only changes of commit db2a102a88 - Show all commits

View File

@ -1,48 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`inventoryFailureAdd`()
BEGIN
DECLARE done BOOL DEFAULT FALSE;
DECLARE vTicketFk INT;
DECLARE rs CURSOR FOR
SELECT id FROM vn.ticket
WHERE shipped = util.yesterday()
AND clientFk = 400
AND warehouseFk IN (1,44);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN rs;
FETCH rs INTO vTicketFk;
WHILE NOT done DO
INSERT INTO vn.inventoryFailure(dated, itemFk, quantity, value, warehouseFk, throwerFk)
SELECT t.shipped,
s.itemFk,
s.quantity,
b.buyingValue + b.freightValue + b.packageValue + b.comissionValue,
t.warehouseFk,
w.id
FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
LEFT JOIN cache.last_buy lb ON lb.warehouse_id = t.warehouseFk AND item_id = s.itemFk
LEFT JOIN vn.buy b ON b.id = lb.buy_id
LEFT JOIN vn.worker w ON w.code = LEFT(s.concept, 3)
WHERE t.id = vTicketFk
AND s.quantity > 0;
FETCH rs INTO vTicketFk;
END WHILE;
CLOSE rs;
END$$
DELIMITER ;

View File

@ -164,10 +164,6 @@ BEGIN
SET itemFk = vItemNew
WHERE itemFk = vItemOld;
UPDATE inventoryFailure
SET itemFk = vItemNew
WHERE itemFk = vItemOld;
UPDATE genericAllocation
SET itemFk = vItemNew
WHERE itemFk = vItemOld;

View File

@ -0,0 +1,5 @@
RENAME TABLE vn.inventoryFailure TO vn.inventoryFailure__;
ALTER TABLE vn.inventoryFailure__ COMMENT='@deprecated 2024-12-16';
RENAME TABLE vn.inventoryFailureCause TO vn.inventoryFailureCause__;
ALTER TABLE vn.inventoryFailureCause__ COMMENT='@deprecated 2024-12-16';