Merge pull request 'added invoiceOut descriptor' (#377) from 2446-ticket_index_overlap_ref_and_state into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #377
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Carlos Jimenez Ruiz 2020-09-14 14:41:14 +00:00
commit 826b4a6f4b
3 changed files with 20 additions and 10 deletions

View File

@ -197,6 +197,7 @@ module.exports = Self => {
t.routeFk, t.routeFk,
t.warehouseFk, t.warehouseFk,
t.clientFk, t.clientFk,
io.id AS invoiceOutId,
a.provinceFk, a.provinceFk,
p.name AS province, p.name AS province,
w.name AS warehouse, w.name AS warehouse,
@ -216,6 +217,7 @@ module.exports = Self => {
z.id AS zoneFk, z.id AS zoneFk,
CAST(z.hour AS CHAR) AS hour CAST(z.hour AS CHAR) AS hour
FROM ticket t FROM ticket t
LEFT JOIN invoiceOut io ON t.refFk = io.ref
LEFT JOIN zone z ON z.id = t.zoneFk LEFT JOIN zone z ON z.id = t.zoneFk
LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN address a ON a.id = t.addressFk
LEFT JOIN province p ON p.id = a.provinceFk LEFT JOIN province p ON p.id = a.provinceFk

View File

@ -67,14 +67,12 @@ describe('ticket filter()', () => {
const ctx = {req: {accessToken: {userId: 9}}, args: {pending: true}}; const ctx = {req: {accessToken: {userId: 9}}, args: {pending: true}};
const filter = {}; const filter = {};
const result = await app.models.Ticket.filter(ctx, filter); const result = await app.models.Ticket.filter(ctx, filter);
const firstRow = result[0];
const secondRow = result[1]; const length = result.length;
const thirdRow = result[2]; const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
expect(result.length).toEqual(7); expect(result.length).toEqual(7);
expect(firstRow.state).toEqual('Libre'); expect(anyResult.state).toMatch(/(Libre|Arreglar)/);
expect(secondRow.state).toEqual('Libre');
expect(thirdRow.state).toEqual('Libre');
}); });
it('should return the tickets that are not pending', async() => { it('should return the tickets that are not pending', async() => {

View File

@ -23,7 +23,6 @@
<vn-th field="stateFk" >State</vn-th> <vn-th field="stateFk" >State</vn-th>
<vn-th field="zoneFk">Zone</vn-th> <vn-th field="zoneFk">Zone</vn-th>
<vn-th field="warehouseFk">Warehouse</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 field="hour" shrink>Closure</vn-th>
<vn-th number>Total</vn-th> <vn-th number>Total</vn-th>
<vn-th></vn-th> <vn-th></vn-th>
@ -89,8 +88,17 @@
</span> </span>
</vn-td> </vn-td>
<vn-td class="expendable">{{::ticket.province}}</vn-td> <vn-td class="expendable">{{::ticket.province}}</vn-td>
<vn-td> <vn-td class="expendable">
<span class="chip {{$ctrl.stateColor(ticket)}}"> <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}} {{ticket.state}}
</span> </span>
</vn-td> </vn-td>
@ -103,7 +111,6 @@
</span> </span>
</vn-td> </vn-td>
<vn-td>{{::ticket.warehouse}}</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 shrink>{{::ticket.zoneLanding | date: 'HH:mm'}}</vn-td>
<vn-td number> <vn-td number>
<span class="chip {{$ctrl.totalPriceColor(ticket)}}"> <span class="chip {{$ctrl.totalPriceColor(ticket)}}">
@ -169,6 +176,9 @@
<vn-client-balance-create <vn-client-balance-create
vn-id="balanceCreateDialog"> vn-id="balanceCreateDialog">
</vn-client-balance-create> </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" <vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
expr-builder="$ctrl.exprBuilder(param, value)"> expr-builder="$ctrl.exprBuilder(param, value)">
<slot-menu> <slot-menu>