closes #4511 kkear-expedition.itemFk #1146
|
@ -0,0 +1 @@
|
||||||
|
Alter table `vn`.`expedition` RENAME COLUMN itemFk TO itemFk__;
|
|
@ -921,7 +921,7 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
|
||||||
(3, 'Perdida', 'LOST');
|
(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
|
VALUES
|
||||||
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 18, 'UR9000006041', 94, 1, 'pc1'),
|
(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),
|
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 18, 'UR9000006041', 94, 1, NULL),
|
||||||
|
|
|
@ -37,7 +37,6 @@ module.exports = Self => {
|
||||||
i1.name packageItemName,
|
i1.name packageItemName,
|
||||||
e.counter,
|
e.counter,
|
||||||
i2.name freightItemName,
|
i2.name freightItemName,
|
||||||
e.itemFk,
|
|
||||||
u.name userName,
|
u.name userName,
|
||||||
e.created,
|
e.created,
|
||||||
e.externalId,
|
e.externalId,
|
||||||
|
@ -50,10 +49,10 @@ module.exports = Self => {
|
||||||
est.description state
|
est.description state
|
||||||
FROM vn.expedition e
|
FROM vn.expedition e
|
||||||
LEFT JOIN vn.expeditionStateType est ON est.id = e.stateTypeFk
|
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
|
INNER JOIN vn.item i1 ON i1.id = e.freightItemFk
|
||||||
LEFT JOIN vn.packaging p ON p.id = e.packagingFk
|
LEFT JOIN vn.packaging p ON p.id = e.packagingFk
|
||||||
LEFT JOIN vn.item i3 ON i3.id = p.itemFk
|
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 account.user u ON u.id = e.workerFk
|
||||||
LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id
|
LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id
|
||||||
LEFT JOIN account.user su ON su.id = es.workerFk
|
LEFT JOIN account.user su ON su.id = es.workerFk
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
"model": "agency-mode",
|
"model": "agency-mode",
|
||||||
"foreignKey": "agencyModeFk"
|
"foreignKey": "agencyModeFk"
|
||||||
},
|
},
|
||||||
"packageItem": {
|
|
||||||
"type": "belongsTo",
|
|
||||||
"model": "Item",
|
|
||||||
"foreignKey": "itemFk"
|
|
||||||
},
|
|
||||||
"worker": {
|
"worker": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "Worker",
|
"model": "Worker",
|
||||||
|
|
Loading…
Reference in New Issue