added invoiceOut descriptor #377
|
@ -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
|
||||
|
|
|
@ -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() => {
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
<vn-th field="stateFk" >State</vn-th>
|
||||
<vn-th field="zoneFk">Zone</vn-th>
|
||||
<vn-th field="warehouseFk">Warehouse</vn-th>
|
||||
<vn-th field="refFk" class="expendable">Invoice</vn-th>
|
||||
<vn-th field="hour" shrink>Closure</vn-th>
|
||||
<vn-th number>Total</vn-th>
|
||||
<vn-th></vn-th>
|
||||
|
@ -89,8 +88,17 @@
|
|||
</span>
|
||||
</vn-td>
|
||||
<vn-td class="expendable">{{::ticket.province}}</vn-td>
|
||||
<vn-td>
|
||||
<span class="chip {{$ctrl.stateColor(ticket)}}">
|
||||
<vn-td class="expendable">
|
||||
<span
|
||||
ng-show="ticket.refFk"
|
||||
title="{{::ticket.refFk}}"
|
||||
vn-click-stop="invoiceOutDescriptor.show($event, ticket.invoiceOutId)"
|
||||
class="link">
|
||||
{{::ticket.refFk}}
|
||||
</span>
|
||||
<span
|
||||
ng-show="!ticket.refFk"
|
||||
class="chip {{$ctrl.stateColor(ticket)}}">
|
||||
{{ticket.state}}
|
||||
</span>
|
||||
</vn-td>
|
||||
|
@ -103,7 +111,6 @@
|
|||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{::ticket.warehouse}}</vn-td>
|
||||
<vn-td class="expendable">{{::ticket.refFk | dashIfEmpty}}</vn-td>
|
||||
<vn-td shrink>{{::ticket.zoneLanding | date: 'HH:mm'}}</vn-td>
|
||||
<vn-td number>
|
||||
<span class="chip {{$ctrl.totalPriceColor(ticket)}}">
|
||||
|
@ -169,6 +176,9 @@
|
|||
<vn-client-balance-create
|
||||
vn-id="balanceCreateDialog">
|
||||
</vn-client-balance-create>
|
||||
<vn-invoice-out-descriptor-popover
|
||||
vn-id="invoiceOutDescriptor">
|
||||
</vn-invoice-out-descriptor-popover>
|
||||
<vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
|
||||
expr-builder="$ctrl.exprBuilder(param, value)">
|
||||
<slot-menu>
|
||||
|
|
Loading…
Reference in New Issue