closes #4511 kkear-expedition.itemFk #1146

Merged
pau merged 9 commits from 4511-kkear-expedition.itemFk into dev 2022-11-23 07:37:35 +00:00
4 changed files with 3 additions and 8 deletions

View File

@ -0,0 +1 @@
Alter table `vn`.`expedition` RENAME COLUMN itemFk TO itemFk__;
pau marked this conversation as resolved Outdated
Outdated
Review

Template strings

Template strings

View File

@ -921,7 +921,7 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
(3, 'Perdida', 'LOST');
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `itemFk`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `itemFk__`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
VALUES
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 18, 'UR9000006041', 94, 1, 'pc1'),
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 18, 'UR9000006041', 94, 1, NULL),

View File

@ -37,7 +37,6 @@ module.exports = Self => {
i1.name packageItemName,
e.counter,
i2.name freightItemName,
e.itemFk,
u.name userName,
e.created,
e.externalId,
@ -50,10 +49,10 @@ module.exports = Self => {
est.description state
FROM vn.expedition e
LEFT JOIN vn.expeditionStateType est ON est.id = e.stateTypeFk
LEFT JOIN vn.item i2 ON i2.id = e.itemFk
INNER JOIN vn.item i1 ON i1.id = e.freightItemFk
LEFT JOIN vn.packaging p ON p.id = e.packagingFk
LEFT JOIN vn.item i3 ON i3.id = p.itemFk
LEFT JOIN vn.item i2 ON i2.id = p.itemFk
LEFT JOIN account.user u ON u.id = e.workerFk
LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id
LEFT JOIN account.user su ON su.id = es.workerFk

View File

@ -37,11 +37,6 @@
"model": "agency-mode",
"foreignKey": "agencyModeFk"
},
"packageItem": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk"
},
"worker": {
"type": "belongsTo",
"model": "Worker",