Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2378-imap
This commit is contained in:
commit
829d0c3b3c
|
@ -199,7 +199,7 @@ export default {
|
|||
},
|
||||
dms: {
|
||||
deleteFileButton: 'vn-client-dms-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
|
||||
firstDocWorker: 'vn-client-dms-index vn-td:nth-child(7) > span',
|
||||
firstDocWorker: 'vn-client-dms-index vn-td:nth-child(8) > span',
|
||||
firstDocWorkerDescriptor: '.vn-popover.shown vn-worker-descriptor'
|
||||
},
|
||||
clientContacts: {
|
||||
|
@ -894,6 +894,7 @@ export default {
|
|||
header: 'vn-entry-summary > vn-card > h5',
|
||||
reference: 'vn-entry-summary vn-label-value[label="Reference"]',
|
||||
confirmed: 'vn-entry-summary vn-check[label="Confirmed"]',
|
||||
anyBuyLine: 'vn-entry-summary tr.dark-row'
|
||||
},
|
||||
entryDescriptor: {
|
||||
agency: 'vn-entry-descriptor div.body vn-label-value:nth-child(1) span',
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Entry summary path', () => {
|
|||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('buyer', 'entry');
|
||||
await page.waitToClick('vn-entry-index vn-tbody > a:nth-child(2)');
|
||||
await page.accessToSearchResult('4');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
|
@ -30,7 +30,7 @@ describe('Entry summary path', () => {
|
|||
it('should display some entry details like the reference', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.entrySummary.reference, 'innerText');
|
||||
|
||||
expect(result).toContain('Movement 2');
|
||||
expect(result).toContain('Movement 4');
|
||||
});
|
||||
|
||||
it('should display other entry details like the confirmed', async() => {
|
||||
|
@ -38,4 +38,10 @@ describe('Entry summary path', () => {
|
|||
|
||||
expect(result).toContain('unchecked');
|
||||
});
|
||||
|
||||
it('should display all buys for the entry', async() => {
|
||||
const result = await page.countElement(selectors.entrySummary.anyBuyLine);
|
||||
|
||||
expect(result).toEqual(4);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -106,7 +106,7 @@ module.exports = Self => {
|
|||
let stmt;
|
||||
|
||||
stmt = new ParameterizedSQL(
|
||||
`SELECT cl.id, c.name, cl.clientFk, cl.workerFk, u.nickName, cs.description, cl.created
|
||||
`SELECT cl.id, c.name, cl.clientFk, cl.workerFk, u.name AS userName, cs.description, cl.created
|
||||
FROM claim cl
|
||||
LEFT JOIN client c ON c.id = cl.clientFk
|
||||
LEFT JOIN worker w ON w.id = cl.workerFk
|
||||
|
|
|
@ -12,7 +12,7 @@ class Controller extends ModuleCard {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,20 +32,32 @@
|
|||
value="{{$ctrl.claim.created | date: 'dd/MM/yyyy HH:mm'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Salesperson"
|
||||
value="{{$ctrl.claim.client.salesPersonUser.nickname}}">
|
||||
label="Salesperson">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.claim.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.claim.client.salesPersonUser.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Attended by"
|
||||
value="{{$ctrl.claim.worker.user.nickname}}">
|
||||
label="Attended by">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.claim.worker.userFk)"
|
||||
class="link">
|
||||
{{$ctrl.claim.worker.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Agency"
|
||||
value="{{$ctrl.claim.ticket.agencyMode.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Ticket"
|
||||
value="{{$ctrl.claim.ticketFk}}">
|
||||
label="Ticket">
|
||||
<span
|
||||
ng-click="ticketDescriptor.show($event, $ctrl.claim.ticketFk)"
|
||||
class="link">
|
||||
{{$ctrl.claim.ticketFk}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
</div>
|
||||
<div class="quicklinks">
|
||||
|
@ -79,3 +91,9 @@
|
|||
question="Delete claim"
|
||||
message="Are you sure you want to delete this claim?">
|
||||
</vn-confirm>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
<vn-ticket-descriptor-popover
|
||||
vn-id="ticketDescriptor">
|
||||
</vn-ticket-descriptor-popover>
|
|
@ -34,7 +34,7 @@
|
|||
<span
|
||||
vn-click-stop="workerDescriptor.show($event, claim.workerFk)"
|
||||
class="link" >
|
||||
{{::claim.nickName}}
|
||||
{{::claim.userName}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>
|
||||
|
|
|
@ -48,7 +48,7 @@ module.exports = Self => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,13 @@
|
|||
<vn-tbody>
|
||||
<vn-tr ng-repeat="credit in credits track by credit.id">
|
||||
<vn-td>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||
<vn-td>{{::credit.worker.user.nickname}}</vn-td>
|
||||
<vn-td>
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, credit.worker.userFk)"
|
||||
class="link">
|
||||
{{::credit.worker.user.name}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>{{::credit.amount | currency:'EUR':2}}</vn-td>
|
||||
</vn-tr>
|
||||
</vn-tbody>
|
||||
|
@ -39,3 +45,6 @@
|
|||
vn-bind="+"
|
||||
fixed-bottom-right>
|
||||
</vn-float-button>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -13,7 +13,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,12 @@
|
|||
info="Invoices minus payments plus orders not yet invoiced">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Sales person"
|
||||
value="{{$ctrl.client.salesPerson.user.nickname}}">
|
||||
label="Sales person">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.client.salesPerson.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
</div>
|
||||
<div class="icons">
|
||||
|
@ -90,3 +94,6 @@
|
|||
vn-id="sms"
|
||||
sms="$ctrl.newSMS">
|
||||
</vn-client-sms>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -53,6 +53,12 @@
|
|||
{{::document.dms.description}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
ng-model="document.dms.hasFile"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<span title="{{'Download file' | translate}}" class="link"
|
||||
ng-click="$ctrl.downloadFile(document.dmsFk)">
|
||||
|
@ -62,7 +68,7 @@
|
|||
<vn-td shrink>
|
||||
<span class="link"
|
||||
ng-click="workerDescriptor.show($event, document.dms.workerFk)">
|
||||
{{::document.dms.worker.user.nickname | dashIfEmpty}}
|
||||
{{::document.dms.worker.user.name | dashIfEmpty}}
|
||||
</span></vn-td>
|
||||
<vn-td>
|
||||
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}
|
||||
|
|
|
@ -32,7 +32,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<span
|
||||
ng-click="workerDescriptor.show($event, sample.worker.id)"
|
||||
class="link">
|
||||
{{::sample.worker.user.nickname}}
|
||||
{{::sample.worker.user.name}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{::sample.company.code}}</vn-td>
|
||||
|
|
|
@ -18,7 +18,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,12 @@
|
|||
<vn-label-value label="Email" ellipsize="false"
|
||||
value="{{$ctrl.summary.email}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Sales person"
|
||||
value="{{$ctrl.summary.salesPerson.user.nickname}}">
|
||||
<vn-label-value label="Sales person">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.salesPerson.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Channel"
|
||||
value="{{$ctrl.summary.contactChannel.name}}">
|
||||
|
@ -198,3 +202,6 @@
|
|||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -0,0 +1,74 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('getBuys', {
|
||||
description: 'Returns buys for one entry',
|
||||
accessType: 'READ',
|
||||
accepts: {
|
||||
arg: 'id',
|
||||
type: 'number',
|
||||
required: true,
|
||||
description: 'The entry id',
|
||||
http: {source: 'path'}
|
||||
},
|
||||
returns: {
|
||||
type: ['Object'],
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/:id/getBuys`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.getBuys = async id => {
|
||||
let filter = {
|
||||
where: {entryFk: id},
|
||||
fields: [
|
||||
'id',
|
||||
'itemFk',
|
||||
'stickers',
|
||||
'packing',
|
||||
'grouping',
|
||||
'quantity',
|
||||
'packageFk',
|
||||
'weight',
|
||||
'buyingValue',
|
||||
'price2',
|
||||
'price3'
|
||||
],
|
||||
include: {
|
||||
relation: 'item',
|
||||
scope: {
|
||||
fields: [
|
||||
'id',
|
||||
'typeFk',
|
||||
'name',
|
||||
'size',
|
||||
'minPrice',
|
||||
'tag5',
|
||||
'value5',
|
||||
'tag6',
|
||||
'value6',
|
||||
'tag7',
|
||||
'value7',
|
||||
'tag8',
|
||||
'value8',
|
||||
'tag9',
|
||||
'value9',
|
||||
'tag10',
|
||||
'value10',
|
||||
'groupingMode'
|
||||
],
|
||||
include: {
|
||||
relation: 'itemType',
|
||||
scope: {
|
||||
fields: ['code', 'description']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let buys = await Self.app.models.Buy.find(filter);
|
||||
return buys;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,14 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('entry getBuys()', () => {
|
||||
const entryId = 4;
|
||||
it('should get the buys and items of an entry', async() => {
|
||||
const result = await app.models.Entry.getBuys(entryId);
|
||||
|
||||
const length = result.length;
|
||||
const anyResult = result[Math.floor(Math.random() * Math.floor(length))];
|
||||
|
||||
expect(result.length).toEqual(4);
|
||||
expect(anyResult.item).toBeDefined();
|
||||
});
|
||||
});
|
|
@ -31,6 +31,12 @@
|
|||
"grouping": {
|
||||
"type": "number"
|
||||
},
|
||||
"stickers": {
|
||||
"type": "number"
|
||||
},
|
||||
"packageFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"groupingMode": {
|
||||
"type": "number"
|
||||
},
|
||||
|
@ -56,6 +62,12 @@
|
|||
"model": "Entry",
|
||||
"foreignKey": "entryFk",
|
||||
"required": true
|
||||
},
|
||||
"item": {
|
||||
"type": "belongsTo",
|
||||
"model": "Item",
|
||||
"foreignKey": "itemFk",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/entry/filter')(Self);
|
||||
require('../methods/entry/getEntry')(Self);
|
||||
require('../methods/entry/getBuys')(Self);
|
||||
};
|
||||
|
|
|
@ -19,8 +19,12 @@
|
|||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-label-value label="Agency"
|
||||
value="{{$ctrl.entryData.travel.agency.name}}">
|
||||
<vn-label-value label="Agency">
|
||||
<span
|
||||
ng-click="travelDescriptor.show($event, $ctrl.entry.travel.agencyFk)"
|
||||
class="link">
|
||||
{{$ctrl.entryData.travel.agency.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Shipped"
|
||||
value="{{$ctrl.entryData.travel.shipped | date: 'dd/MM/yyyy'}}">
|
||||
|
@ -65,4 +69,89 @@
|
|||
</vn-vertical>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-auto name="buys">
|
||||
<h4 translate>Buys</h4>
|
||||
<table class="vn-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th translate center field="quantity">Quantity</th>
|
||||
<th translate center field="sticker">Stickers</th>
|
||||
<th translate center field="packageFk">Package</th>
|
||||
<th translate center field="weight">Weight</th>
|
||||
<th translate center field="packing">Packing</th>
|
||||
<th translate center field="grouping">Grouping</th>
|
||||
<th translate center field="buyingValue">Buying value</th>
|
||||
<th translate center field="price3">Import</th>
|
||||
<th translate center expand field="price2">Grouping price</th>
|
||||
<th translate center expand field="price3">Packing price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="line in $ctrl.buys">
|
||||
<tr>
|
||||
<td center title="{{::line.quantity}}">{{::line.quantity}}</td>
|
||||
<td center title="{{::line.stickers | dashIfEmpty}}">{{::line.stickers | dashIfEmpty}}</td>
|
||||
<td center title="{{::line.packageFk | dashIfEmpty}}">{{::line.packageFk | dashIfEmpty}}</td>
|
||||
<td center title="{{::line.weight}}">{{::line.weight}}</td>
|
||||
<td center>
|
||||
<vn-chip translate-attr="line.groupingMode == 2 ? {title: 'Minimun amount'} : {title: 'Packing'}" ng-class="{'message': line.groupingMode == 2}">
|
||||
<span translate>{{::line.packing | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</td>
|
||||
<td center>
|
||||
<vn-chip translate-attr="line.groupingMode == 1 ? {title: 'Minimun amount'} : {title: 'Grouping'}" ng-class="{'message': line.groupingMode == 1}">
|
||||
<span translate>{{::line.grouping | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<td center title="{{::line.buyingValue | currency: 'EUR':2}}">{{::line.buyingValue | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.quantity * line.buyingValue | currency: 'EUR':2}}">{{::line.quantity * line.buyingValue | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.price2 | currency: 'EUR':2}}">{{::line.price2 | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.price3 | currency: 'EUR':2}}">{{::line.price3 | currency: 'EUR':2}}</td>
|
||||
</tr>
|
||||
<tr class="dark-row">
|
||||
<td shrink>
|
||||
<span
|
||||
translate-attr="{title: 'Item type'}">
|
||||
{{::line.item.itemType.code}}
|
||||
</span>
|
||||
</td>
|
||||
<td shrink>
|
||||
<span
|
||||
ng-click="itemDescriptor.show($event, line.item.id)"
|
||||
class="link">
|
||||
{{::line.item.id | zeroFill:6}}
|
||||
</span>
|
||||
</td>
|
||||
<td number shrink>
|
||||
<span
|
||||
translate-attr="{title: 'Item size'}">
|
||||
{{::line.item.size}}
|
||||
</span>
|
||||
</td>
|
||||
<td center>
|
||||
<span
|
||||
translate-attr="{title: 'Minimum price'}">
|
||||
{{::line.item.minPrice | currency: 'EUR':2}}
|
||||
</span>
|
||||
</td>
|
||||
<td expand colspan="6">
|
||||
<vn-fetched-tags
|
||||
expand
|
||||
item="::line.item"
|
||||
name="::line.item.name"
|
||||
sub-name="::line.item.subName">
|
||||
</vn-fetched-tags>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</vn-auto>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-item-descriptor-popover
|
||||
vn-id="itemDescriptor">
|
||||
</vn-item-descriptor-popover>
|
||||
<vn-travel-descriptor-popover
|
||||
vn-id="travelDescriptor">
|
||||
</vn-travel-descriptor-popover>
|
||||
|
||||
|
|
|
@ -10,15 +10,23 @@ class Controller extends Section {
|
|||
set entry(value) {
|
||||
this._entry = value;
|
||||
|
||||
if (value && value.id)
|
||||
if (value && value.id) {
|
||||
this.getEntryData();
|
||||
this.getBuys();
|
||||
}
|
||||
}
|
||||
|
||||
getEntryData() {
|
||||
return this.$http.get(`/api/Entries/${this.entry.id}/getEntry`).then(response => {
|
||||
return this.$http.get(`Entries/${this.entry.id}/getEntry`).then(response => {
|
||||
this.entryData = response.data;
|
||||
});
|
||||
}
|
||||
|
||||
getBuys() {
|
||||
return this.$http.get(`Entries/${this.entry.id}/getBuys`).then(response => {
|
||||
this.buys = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnEntrySummary', {
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('component vnEntrySummary', () => {
|
|||
it('should perform a get and then store data on the controller', () => {
|
||||
controller._entry = {id: 999};
|
||||
|
||||
const query = `/api/Entries/${controller._entry.id}/getEntry`;
|
||||
const query = `Entries/${controller._entry.id}/getEntry`;
|
||||
$httpBackend.expectGET(query).respond('I am the entryData');
|
||||
controller.getEntryData();
|
||||
$httpBackend.flush();
|
||||
|
@ -46,4 +46,20 @@ describe('component vnEntrySummary', () => {
|
|||
expect(controller.entryData).toEqual('I am the entryData');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getBuys()', () => {
|
||||
it('should perform a get asking for the buys of an entry', () => {
|
||||
controller._entry = {id: 999};
|
||||
|
||||
const thatQuery = `Entries/${controller._entry.id}/getEntry`;
|
||||
const query = `Entries/${controller._entry.id}/getBuys`;
|
||||
|
||||
$httpBackend.whenGET(thatQuery).respond('My Entries');
|
||||
$httpBackend.expectGET(query).respond('Some buys');
|
||||
controller.getBuys();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.buys).toEqual('Some buys');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
Inventory: Inventario
|
||||
Virtual: Redada
|
||||
Entry: Entrada
|
||||
Stickers: Etiquetas
|
||||
Item size: Tamaño
|
||||
Item type: Tipo
|
||||
Minimum price: Precio mínimo
|
||||
Buys: Compras
|
||||
|
|
|
@ -3,4 +3,18 @@
|
|||
|
||||
vn-entry-summary .summary {
|
||||
max-width: $width-lg;
|
||||
|
||||
.dark-row {
|
||||
background-color: lighten($color-marginal, 10%);
|
||||
}
|
||||
|
||||
tbody {
|
||||
border: 2px solid $color-marginal;
|
||||
}
|
||||
|
||||
tr {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
$color-font-link-medium: lighten($color-font-link, 20%)
|
|
@ -37,8 +37,12 @@
|
|||
value="{{$ctrl.invoiceOut.amount | currency: 'EUR': 2}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Client"
|
||||
value="{{$ctrl.invoiceOut.client.name}}">
|
||||
label="Client">
|
||||
<span
|
||||
ng-click="clientDescriptor.show($event, $ctrl.invoiceOut.client.id)"
|
||||
class="link">
|
||||
{{$ctrl.invoiceOut.client.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Company"
|
||||
|
@ -75,3 +79,6 @@
|
|||
on-accept="$ctrl.bookInvoiceOut()"
|
||||
question="Are you sure you want to book this invoice?">
|
||||
</vn-confirm>
|
||||
<vn-client-descriptor-popover
|
||||
vn-id="clientDescriptor">
|
||||
</vn-client-descriptor-popover>
|
|
@ -26,7 +26,9 @@ module.exports = Self => {
|
|||
await fs.mkdir(tempPath, {recursive: true});
|
||||
|
||||
const timer = setInterval(async() => {
|
||||
const image = await Self.findOne({where: {error: null}});
|
||||
const image = await Self.findOne({
|
||||
where: {error: null, url: {neq: null}}
|
||||
});
|
||||
|
||||
// Exit loop
|
||||
if (!image) return clearInterval(timer);
|
||||
|
|
|
@ -113,7 +113,7 @@ module.exports = Self => {
|
|||
i.isActive,
|
||||
t.name type,
|
||||
t.workerFk buyerFk,
|
||||
u.nickname userNickname,
|
||||
u.name userName,
|
||||
intr.description AS intrastat,
|
||||
i.stems,
|
||||
ori.code AS origin,
|
||||
|
|
|
@ -37,7 +37,7 @@ module.exports = Self => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = Self => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,12 @@
|
|||
<slot-body>
|
||||
<div class="attributes">
|
||||
<vn-label-value
|
||||
label="Buyer"
|
||||
value="{{$ctrl.item.itemType.worker.user.nickname}}">
|
||||
label="Buyer">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)"
|
||||
class="link">
|
||||
{{$ctrl.item.itemType.worker.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
ng-repeat="tag in $ctrl.item.tags | limitTo:4"
|
||||
|
@ -96,3 +100,6 @@
|
|||
question="Do you want to clone this item?"
|
||||
message="All it's properties will be copied">
|
||||
</vn-confirm>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -70,11 +70,11 @@
|
|||
{{::item.intrastat}}
|
||||
</vn-td>
|
||||
<vn-td shrink>{{::item.origin}}</vn-td>
|
||||
<vn-td shrink title="{{::item.userNickname}}">
|
||||
<vn-td shrink title="{{::item.userName}}">
|
||||
<span
|
||||
class="link"
|
||||
vn-click-stop="workerDescriptor.show($event, item.buyerFk)">
|
||||
{{::item.userNickname}}
|
||||
{{::item.userName}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td shrink>{{::item.density}}</vn-td>
|
||||
|
|
|
@ -36,8 +36,12 @@
|
|||
<vn-label-value label="stems"
|
||||
value="{{$ctrl.summary.item.stems}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Buyer"
|
||||
value="{{$ctrl.summary.item.itemType.worker.user.nickname}}">
|
||||
<vn-label-value label="Buyer">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.item.itemType.worker.userFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.item.itemType.worker.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one name="otherData">
|
||||
|
@ -106,3 +110,6 @@
|
|||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -37,7 +37,7 @@ class Controller extends ModuleCard {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
ng-model="$ctrl.orderField"
|
||||
selection="$ctrl.orderSelection"
|
||||
translate-fields="['name']"
|
||||
order="name"
|
||||
order="priority DESC"
|
||||
show-field="name"
|
||||
value-field="field"
|
||||
label="Order by"
|
||||
|
|
|
@ -14,10 +14,10 @@ class Controller extends Section {
|
|||
{way: 'DESC', name: 'Descendant'},
|
||||
];
|
||||
this.defaultOrderFields = [
|
||||
{field: 'relevancy DESC, name', name: 'Relevancy'},
|
||||
{field: 'showOrder, price', name: 'Color and price'},
|
||||
{field: 'name', name: 'Name'},
|
||||
{field: 'price', name: 'Price'}
|
||||
{field: 'relevancy DESC, name', name: 'Relevancy', priority: 999},
|
||||
{field: 'showOrder, price', name: 'Color and price', priority: 999},
|
||||
{field: 'name', name: 'Name', priority: 999},
|
||||
{field: 'price', name: 'Price', priority: 999}
|
||||
];
|
||||
this.orderFields = [].concat(this.defaultOrderFields);
|
||||
this._orderWay = this.orderWays[0].way;
|
||||
|
@ -312,9 +312,11 @@ class Controller extends Section {
|
|||
tags.push({
|
||||
name: itemTag.name,
|
||||
field: itemTag.tagFk,
|
||||
isTag: true
|
||||
isTag: true,
|
||||
priority: 1
|
||||
});
|
||||
}
|
||||
} else
|
||||
tags[alreadyAdded].priority += 1;
|
||||
});
|
||||
});
|
||||
let newFilterList = [].concat(this.defaultOrderFields);
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Order', () => {
|
|||
jest.spyOn(controller, 'buildTagsFilter');
|
||||
jest.spyOn(controller, 'buildOrderFilter');
|
||||
|
||||
const expectedResult = [{field: 'showOrder, price', name: 'Color and price'}];
|
||||
const expectedResult = [{field: 'showOrder, price', name: 'Color and price', priority: 999}];
|
||||
const items = [{id: 1, name: 'My Item', tags: [
|
||||
{tagFk: 4, name: 'Length'},
|
||||
{tagFk: 5, name: 'Color'}
|
||||
|
|
|
@ -15,8 +15,12 @@
|
|||
value="{{$ctrl.$t($ctrl.order.isConfirmed ? 'Confirmed' : 'Not confirmed')}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Sales person"
|
||||
value="{{$ctrl.order.client.salesPerson.user.nickname}}">
|
||||
label="Sales person">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.order.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.order.client.salesPerson.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Landed"
|
||||
|
@ -65,3 +69,6 @@
|
|||
message="You are going to delete this order"
|
||||
question="continue anyway?">
|
||||
</vn-confirm>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -119,7 +119,7 @@ module.exports = Self => {
|
|||
r.m3,
|
||||
r.description,
|
||||
am.name agencyName,
|
||||
u.nickname AS workerNickname,
|
||||
u.name AS workerUserName,
|
||||
v.numberPlate AS vehiclePlateNumber
|
||||
FROM route r
|
||||
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||
|
@ -128,7 +128,6 @@ module.exports = Self => {
|
|||
LEFT JOIN account.user u ON u.id = w.userFk`
|
||||
);
|
||||
|
||||
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
let itemsIndex = stmts.push(stmt) - 1;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ describe('route summary()', () => {
|
|||
const result = await app.models.Route.summary(1);
|
||||
const worker = result.route.worker().user();
|
||||
|
||||
expect(worker.nickname).toEqual('deliveryNick');
|
||||
expect(worker.name).toEqual('delivery');
|
||||
});
|
||||
|
||||
it(`should return a summary object containing data from the tickets`, async() => {
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = Self => {
|
|||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname']
|
||||
fields: ['id', 'name']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<span
|
||||
class="link"
|
||||
vn-click-stop="workerDescriptor.show($event, route.workerFk)">
|
||||
{{::route.workerNickname}}
|
||||
{{::route.workerUserName}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{::route.agencyName | dashIfEmpty}}</vn-td>
|
||||
|
|
|
@ -14,8 +14,12 @@
|
|||
<vn-label-value label="Vehicle"
|
||||
value="{{$ctrl.summary.route.vehicle.numberPlate}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Driver"
|
||||
value="{{$ctrl.summary.route.worker.user.nickname}}">
|
||||
<vn-label-value label="Driver">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.route.workerFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.route.worker.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Cost"
|
||||
value="{{$ctrl.summary.route.cost | currency: 'EUR':2}}">
|
||||
|
@ -106,3 +110,6 @@
|
|||
<vn-client-descriptor-popover
|
||||
vn-id="clientDescriptor">
|
||||
</vn-client-descriptor-popover>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
|
|
|
@ -245,7 +245,7 @@ module.exports = Self => {
|
|||
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
|
||||
FROM tmp.filter f
|
||||
LEFT JOIN alertLevel al ON al.alertLevel = f.alertLevel
|
||||
WHERE (f.alertLevelCode = 'FREE' OR f.alertLevel IS NULL)
|
||||
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
|
||||
AND f.shipped >= CURDATE()`);
|
||||
stmts.push('CALL ticketGetProblems()');
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ module.exports = Self => {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class Controller extends ModuleCard {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,8 +90,12 @@
|
|||
value="{{$ctrl.ticket.ticketState.state.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Sales person"
|
||||
value="{{$ctrl.ticket.client.salesPerson.user.nickname}}">
|
||||
label="Sales person">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.ticket.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.ticket.client.salesPerson.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Shipped"
|
||||
|
@ -296,3 +300,6 @@
|
|||
<button response="accept" translate>Save</button>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
|
@ -210,7 +210,7 @@ class Controller extends Descriptor {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,12 @@
|
|||
{{::document.dms.description}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
ng-model="document.dms.hasFile"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<span title="{{'Download file' | translate}}" class="link"
|
||||
ng-click="$ctrl.downloadFile(document.dmsFk)">
|
||||
|
@ -60,8 +66,9 @@
|
|||
<vn-td shrink>
|
||||
<span class="link"
|
||||
ng-click="workerDescriptor.show($event, document.dms.workerFk)">
|
||||
{{::document.dms.worker.user.nickname | dashIfEmpty}}
|
||||
</span></vn-td>
|
||||
{{::document.dms.worker.user.name | dashIfEmpty}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>
|
||||
{{::document.dms.created | date:'dd/MM/yyyy HH:mm'}}
|
||||
</vn-td>
|
||||
|
|
|
@ -33,7 +33,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -18,8 +18,12 @@
|
|||
<vn-label-value label="State"
|
||||
value="{{$ctrl.summary.ticketState.state.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Salesperson"
|
||||
value="{{$ctrl.summary.client.salesPerson.user.nickname}}">
|
||||
<vn-label-value label="Salesperson">
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.client.salesPerson.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Agency"
|
||||
value="{{$ctrl.summary.agencyMode.name}}">
|
||||
|
@ -240,3 +244,6 @@
|
|||
<vn-invoice-out-descriptor-popover
|
||||
vn-id="invoice-out-descriptor">
|
||||
</vn-invoice-out-descriptor-popover>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<span
|
||||
class="link"
|
||||
ng-click="workerDescriptor.show($event, tracking.worker.user.id)">
|
||||
{{::tracking.worker.user.nickname | dashIfEmpty}}
|
||||
{{::tracking.worker.user.name | dashIfEmpty}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{::tracking.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||
|
|
|
@ -13,7 +13,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['nickname']
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Reference: Referencia
|
||||
Wh. In: Warehouse entrada
|
||||
Wh. Out: Warehouse salida
|
||||
Wh. In: Almacén entrada
|
||||
Wh. Out: Almacén salida
|
||||
Shipped: F. envío
|
||||
Landed: F. entrega
|
||||
Total entries: Entradas totales
|
|
@ -18,6 +18,7 @@
|
|||
<vn-th field="reference" shrink>Reference</vn-th>
|
||||
<vn-th expand>Description</vn-th>
|
||||
<vn-th field="hasFile" shrink>Original</vn-th>
|
||||
<vn-th shrink>File</vn-th>
|
||||
<vn-th field="created">Created</vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
|
@ -37,6 +38,12 @@
|
|||
{{::document.description}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
ng-model="document.dms.hasFile"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
<span title="{{'Download file' | translate}}" class="link"
|
||||
ng-click="$ctrl.downloadFile(document.dmsFk)">
|
||||
|
|
Loading…
Reference in New Issue