diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js
index 878b4278e..60b57064f 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -197,6 +197,7 @@ module.exports = Self => {
t.routeFk,
t.warehouseFk,
t.clientFk,
+ io.id AS invoiceOutId,
a.provinceFk,
p.name AS province,
w.name AS warehouse,
@@ -216,6 +217,7 @@ module.exports = Self => {
z.id AS zoneFk,
CAST(z.hour AS CHAR) AS hour
FROM ticket t
+ LEFT JOIN invoiceOut io ON t.refFk = io.ref
LEFT JOIN zone z ON z.id = t.zoneFk
LEFT JOIN address a ON a.id = t.addressFk
LEFT JOIN province p ON p.id = a.provinceFk
diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js
index c03a41975..524354646 100644
--- a/modules/ticket/back/methods/ticket/specs/filter.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js
@@ -67,14 +67,12 @@ describe('ticket filter()', () => {
const ctx = {req: {accessToken: {userId: 9}}, args: {pending: true}};
const filter = {};
const result = await app.models.Ticket.filter(ctx, filter);
- const firstRow = result[0];
- const secondRow = result[1];
- const thirdRow = result[2];
+
+ const length = result.length;
+ const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
expect(result.length).toEqual(7);
- expect(firstRow.state).toEqual('Libre');
- expect(secondRow.state).toEqual('Libre');
- expect(thirdRow.state).toEqual('Libre');
+ expect(anyResult.state).toMatch(/(Libre|Arreglar)/);
});
it('should return the tickets that are not pending', async() => {
diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html
index 2c598ca03..3e9809952 100644
--- a/modules/ticket/front/index/index.html
+++ b/modules/ticket/front/index/index.html
@@ -23,7 +23,6 @@
State
Zone
Warehouse
- Invoice
Closure
Total
@@ -89,8 +88,17 @@
{{::ticket.province}}
-
-
+
+
+ {{::ticket.refFk}}
+
+
{{ticket.state}}
@@ -103,7 +111,6 @@
{{::ticket.warehouse}}
- {{::ticket.refFk | dashIfEmpty}}
{{::ticket.zoneLanding | date: 'HH:mm'}}
@@ -169,6 +176,9 @@
+
+