8267-devToTest #3270
|
@ -1,36 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`itemShelvingLog_get`(
|
||||
vShelvingCode VARCHAR(10)
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el log de los item en cada carro
|
||||
*
|
||||
* @param vShelvingCode Matrícula del carro
|
||||
*
|
||||
*/
|
||||
SELECT isl.itemShelvingFk,
|
||||
isl.created,
|
||||
isl.accion,
|
||||
isl.itemFk,
|
||||
isl.shelvingFk,
|
||||
isl.quantity,
|
||||
isl.visible,
|
||||
isl.available,
|
||||
isl.grouping,
|
||||
isl.packing,
|
||||
isl.stars,
|
||||
item.longName,
|
||||
item.size,
|
||||
item.subName,
|
||||
worker.code,
|
||||
isl.accion
|
||||
FROM item
|
||||
JOIN itemShelvingLog isl ON item.id = isl.itemFk
|
||||
JOIN worker ON isl.workerFk = worker.id
|
||||
JOIN shelving sh ON sh.id = isl.shelvingFk
|
||||
WHERE sh.code = vShelvingCode COLLATE utf8mb3_unicode_ci
|
||||
OR isl.itemFk = vShelvingCode -- ?? Respeto porque ya estaba
|
||||
ORDER BY isl.created DESC;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,18 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_afterInsert`
|
||||
AFTER INSERT ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO itemShelvingLog
|
||||
SET itemShelvingFk = NEW.id,
|
||||
workerFk = account.myUser_getId(),
|
||||
accion = 'CREA REGISTRO',
|
||||
itemFk = NEW.itemFk,
|
||||
shelvingFk = NEW.shelvingFk,
|
||||
visible = NEW.visible,
|
||||
`grouping` = NEW.`grouping`,
|
||||
packing = NEW.packing,
|
||||
available = NEW.available;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,18 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_afterUpdate`
|
||||
AFTER UPDATE ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO itemShelvingLog
|
||||
SET itemShelvingFk = NEW.id,
|
||||
workerFk = account.myUser_getId(),
|
||||
accion = 'CAMBIO',
|
||||
itemFk = NEW.itemFk,
|
||||
shelvingFk = NEW.shelvingFk,
|
||||
visible = NEW.visible,
|
||||
`grouping` = NEW.`grouping`,
|
||||
packing = NEW.packing,
|
||||
available = NEW.available;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,15 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_beforeDelete`
|
||||
BEFORE DELETE ON `itemShelving`
|
||||
FOR EACH ROW
|
||||
INSERT INTO vn.itemShelvingLog(itemShelvingFk,
|
||||
workerFk,
|
||||
accion,
|
||||
shelvingFk,
|
||||
itemFk)
|
||||
VALUES( OLD.id,
|
||||
account.myUser_getId(),
|
||||
'ELIMINADO',
|
||||
OLD.shelvingFk,
|
||||
OLD.itemFk)$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,2 @@
|
|||
RENAME TABLE vn.itemShelvingLog TO vn.itemShelvingLog__;
|
||||
ALTER TABLE vn.itemShelvingLog__ COMMENT='@deprecated 2024-11-26';
|
|
@ -56,9 +56,6 @@
|
|||
"ItemShelving": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ItemShelvingLog": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ItemShelvingSale": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
{
|
||||
"name": "ItemShelvingLog",
|
||||
"base": "VnModel",
|
||||
"mixins": {
|
||||
"Loggable": true
|
||||
},
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "itemShelvingLog"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"shelvingFk": {
|
||||
"type": "string"
|
||||
},
|
||||
"itemFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"visible": {
|
||||
"type": "number"
|
||||
},
|
||||
"accion": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"item": {
|
||||
"type": "belongsTo",
|
||||
"model": "Item",
|
||||
"foreignKey": "itemFk"
|
||||
},
|
||||
"worker": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"shelving": {
|
||||
"type": "belongsTo",
|
||||
"model": "Shelving",
|
||||
"foreignKey": "shelvingFk",
|
||||
"primaryKey": "code"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -258,7 +258,6 @@ localFixtures:
|
|||
- itemFamily
|
||||
- itemLog
|
||||
- itemShelving
|
||||
- itemShelvingLog
|
||||
- itemShelvingSale
|
||||
- itemTag
|
||||
- itemTaxCountry
|
||||
|
|
Loading…
Reference in New Issue