diff --git a/back/methods/collection/getTickets.js b/back/methods/collection/getTickets.js index 3c2f6cb2d..677c9e444 100644 --- a/back/methods/collection/getTickets.js +++ b/back/methods/collection/getTickets.js @@ -63,7 +63,8 @@ module.exports = Self => { p.pickingOrder pickingOrder, iss.id itemShelvingSaleFk, iss.isPicked, - iss.itemShelvingFk + iss.itemShelvingFk, + st.code stateCode FROM ticketCollection tc LEFT JOIN collection c ON c.id = tc.collectionFk JOIN sale s ON s.ticketFk = tc.ticketFk @@ -77,6 +78,7 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk + LEFT JOIN state st ON st.id = sg.stateFk WHERE tc.collectionFk = ? GROUP BY s.id, ish.id, p.code, p2.code UNION ALL @@ -104,7 +106,8 @@ module.exports = Self => { p.pickingOrder, iss.id itemShelvingSaleFk, iss.isPicked, - iss.itemShelvingFk + iss.itemShelvingFk, + st.code stateCode FROM sectorCollection sc JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id JOIN saleGroup sg ON sg.id = ss.saleGroupFk @@ -118,6 +121,7 @@ module.exports = Self => { LEFT JOIN parking p ON p.id = sh.parkingFk LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk + LEFT JOIN state st ON st.id = sg.stateFk WHERE sc.id = ? AND sgd.saleGroupFk GROUP BY s.id, ish.id, p.code, p2.code`, [id, id], myOptions); diff --git a/modules/ticket/back/models/saleGroup.json b/modules/ticket/back/models/saleGroup.json index aa78b4167..5f432b514 100644 --- a/modules/ticket/back/models/saleGroup.json +++ b/modules/ticket/back/models/saleGroup.json @@ -29,6 +29,11 @@ "type": "belongsTo", "model": "Parking", "foreignKey": "parkingFk" + }, + "state": { + "type": "belongsTo", + "model": "State", + "foreignKey": "stateFk" } } -} +} \ No newline at end of file