This commit is contained in:
Juan Ferrer 2019-02-01 11:06:39 +01:00
commit 3f08ab1b22
58 changed files with 469 additions and 237 deletions

View File

@ -349,7 +349,7 @@ export default {
firstSaleColour: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(1)`, firstSaleColour: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(1)`,
firstSaleLength: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(3)`, firstSaleLength: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(3)`,
firstSaleCheckbox: `vn-ticket-sale vn-tr:nth-child(1) vn-check[field="sale.checked"] label`, firstSaleCheckbox: `vn-ticket-sale vn-tr:nth-child(1) vn-check[field="sale.checked"] label`,
secondSaleClaimId: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > a > vn-icon', secondSaleClaimIcon: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > a > vn-icon',
secondSaleColour: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(5) section:nth-child(5)`, secondSaleColour: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(5) section:nth-child(5)`,
secondSalePrice: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(7)`, secondSalePrice: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(7)`,
secondSaleDiscount: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(8)`, secondSaleDiscount: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(8)`,
@ -402,9 +402,7 @@ export default {
addRequestButton: `vn-ticket-request-index > a > vn-float-button > button`, addRequestButton: `vn-ticket-request-index > a > vn-float-button > button`,
request: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr', request: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr',
descriptionInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-textfield > div > div > div.infix > input`, descriptionInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-textfield > div > div > div.infix > input`,
atenderSelect: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-autocomplete > div > div > input`, atenderAutocomplete: `vn-ticket-request-create vn-autocomplete[field="$ctrl.ticketRequest.atenderFk"]`,
atenderSelectFirstOption: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(1)`,
atenderSelectSecondOption: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(1) > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(2)`,
quantityInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-textfield:nth-child(1) > div > div > div.infix > input`, quantityInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-textfield:nth-child(1) > div > div > div.infix > input`,
priceInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-textfield:nth-child(2) > div > div > div.infix > input`, priceInput: `vn-ticket-request-create > form > div > vn-card > div > vn-horizontal:nth-child(2) > vn-textfield:nth-child(2) > div > div > div.infix > input`,
firstRemoveRequestButton: `vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)`, firstRemoveRequestButton: `vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)`,

View File

@ -18,7 +18,7 @@ describe('Claim development', () => {
.autocompleteSearch(selectors.claimDevelopment.secondClaimReasonAutocomplete, 'Baja calidad') .autocompleteSearch(selectors.claimDevelopment.secondClaimReasonAutocomplete, 'Baja calidad')
.autocompleteSearch(selectors.claimDevelopment.secondClaimResultAutocomplete, 'Deshidratacion') .autocompleteSearch(selectors.claimDevelopment.secondClaimResultAutocomplete, 'Deshidratacion')
.autocompleteSearch(selectors.claimDevelopment.secondClaimResponsibleAutocomplete, 'Calidad general') .autocompleteSearch(selectors.claimDevelopment.secondClaimResponsibleAutocomplete, 'Calidad general')
.autocompleteSearch(selectors.claimDevelopment.secondClaimWorkerAutocomplete, 'delivery') .autocompleteSearch(selectors.claimDevelopment.secondClaimWorkerAutocomplete, 'deliveryNick')
.autocompleteSearch(selectors.claimDevelopment.secondClaimRedeliveryAutocomplete, 'Reparto') .autocompleteSearch(selectors.claimDevelopment.secondClaimRedeliveryAutocomplete, 'Reparto')
.waitToClick(selectors.claimDevelopment.saveDevelopmentButton) .waitToClick(selectors.claimDevelopment.saveDevelopmentButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -31,7 +31,7 @@ describe('Claim development', () => {
.autocompleteSearch(selectors.claimDevelopment.firstClaimReasonAutocomplete, 'Calor') .autocompleteSearch(selectors.claimDevelopment.firstClaimReasonAutocomplete, 'Calor')
.autocompleteSearch(selectors.claimDevelopment.firstClaimResultAutocomplete, 'Cocido') .autocompleteSearch(selectors.claimDevelopment.firstClaimResultAutocomplete, 'Cocido')
.autocompleteSearch(selectors.claimDevelopment.firstClaimResponsibleAutocomplete, 'Calidad general') .autocompleteSearch(selectors.claimDevelopment.firstClaimResponsibleAutocomplete, 'Calidad general')
.autocompleteSearch(selectors.claimDevelopment.firstClaimWorkerAutocomplete, 'adminAssistant') .autocompleteSearch(selectors.claimDevelopment.firstClaimWorkerAutocomplete, 'adminAssistantNick')
.autocompleteSearch(selectors.claimDevelopment.firstClaimRedeliveryAutocomplete, 'Cliente') .autocompleteSearch(selectors.claimDevelopment.firstClaimRedeliveryAutocomplete, 'Cliente')
.waitToClick(selectors.claimDevelopment.saveDevelopmentButton) .waitToClick(selectors.claimDevelopment.saveDevelopmentButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -59,7 +59,7 @@ describe('Claim development', () => {
expect(reason).toEqual('Calor'); expect(reason).toEqual('Calor');
expect(result).toEqual('Cocido'); expect(result).toEqual('Cocido');
expect(responsible).toEqual('Calidad general'); expect(responsible).toEqual('Calidad general');
expect(worker).toEqual('adminAssistant adminAssistant'); expect(worker).toEqual('adminAssistantNick');
expect(redelivery).toEqual('Cliente'); expect(redelivery).toEqual('Cliente');
}); });
@ -82,7 +82,7 @@ describe('Claim development', () => {
expect(reason).toEqual('Baja calidad'); expect(reason).toEqual('Baja calidad');
expect(result).toEqual('Deshidratacion'); expect(result).toEqual('Deshidratacion');
expect(responsible).toEqual('Calidad general'); expect(responsible).toEqual('Calidad general');
expect(worker).toEqual('delivery delivery'); expect(worker).toEqual('deliveryNick');
expect(redelivery).toEqual('Reparto'); expect(redelivery).toEqual('Reparto');
}); });
@ -115,7 +115,7 @@ describe('Claim development', () => {
expect(reason).toEqual('Prisas'); expect(reason).toEqual('Prisas');
expect(result).toEqual('Otros daños'); expect(result).toEqual('Otros daños');
expect(responsible).toEqual('Compradores'); expect(responsible).toEqual('Compradores');
expect(worker).toEqual('manager manager'); expect(worker).toEqual('managerNick');
expect(redelivery).toEqual('Cliente'); expect(redelivery).toEqual('Cliente');
}); });
}); });

View File

@ -114,7 +114,7 @@ describe('Client Edit basicData path', () => {
.write(selectors.clientBasicData.mobileInput, '987654321') .write(selectors.clientBasicData.mobileInput, '987654321')
.clearInput(selectors.clientBasicData.emailInput) .clearInput(selectors.clientBasicData.emailInput)
.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') .write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory') .autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'AccessoryNick')
.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper') .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper')
.waitToClick(selectors.clientBasicData.saveButton) .waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -162,7 +162,7 @@ describe('Client Edit basicData path', () => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value'); .waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value');
expect(result).toEqual('accessory accessory'); expect(result).toEqual('accessoryNick');
}); });
it('should now confirm the channel have been selected', async() => { it('should now confirm the channel have been selected', async() => {

View File

@ -13,7 +13,7 @@ describe('Ticket Edit sale path', () => {
it(`should click on the second claim id to navigate over there`, async() => { it(`should click on the second claim id to navigate over there`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketSales.secondSaleClaimId) .waitToClick(selectors.ticketSales.secondSaleClaimIcon)
.wait(selectors.claimBasicData.claimStateAutocomplete) .wait(selectors.claimBasicData.claimStateAutocomplete)
.parsedUrl(); .parsedUrl();

View File

@ -16,8 +16,7 @@ describe('Ticket purchase request path', () => {
.waitToClick(selectors.ticketRequests.addRequestButton) .waitToClick(selectors.ticketRequests.addRequestButton)
.write(selectors.ticketRequests.descriptionInput, 'New stuff') .write(selectors.ticketRequests.descriptionInput, 'New stuff')
.write(selectors.ticketRequests.quantityInput, 99) .write(selectors.ticketRequests.quantityInput, 99)
.waitToClick(selectors.ticketRequests.atenderSelect) .autocompleteSearch(selectors.ticketRequests.atenderAutocomplete, 'buyerNick')
.waitToClick(selectors.ticketRequests.atenderSelectSecondOption)
.write(selectors.ticketRequests.priceInput, 999) .write(selectors.ticketRequests.priceInput, 999)
.waitToClick(selectors.ticketRequests.saveButton) .waitToClick(selectors.ticketRequests.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();

View File

@ -28,15 +28,39 @@ module.exports = Self => {
let filter = { let filter = {
where: {id: id}, where: {id: id},
include: [ include: [
{relation: 'worker', scope: {fields: ['name', 'firstName']}}, {
{relation: 'claimState', scope: {fields: ['id', 'description']}}, relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
},
{
relation: 'claimState',
scope: {
fields: ['id', 'description']
}
},
{ {
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk', 'name'], fields: ['salesPersonFk', 'name'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
} }

View File

@ -20,13 +20,14 @@
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
disabled="true" disabled="false"
field="$ctrl.claim.workerFk" field="$ctrl.claim.workerFk"
url="/client/api/Workers" url="/api/Clients/activeWorkersWithRole"
fields="['firstName', 'name']" show-field="nickname"
search-function="{firstName: $search}"
value-field="id" value-field="id"
where="{role: 'employee'}"
label="Worker"> label="Worker">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-date-picker <vn-date-picker
vn-one vn-one

View File

@ -6,7 +6,17 @@ class Controller {
this.$state = $state; this.$state = $state;
this.filter = { this.filter = {
include: [ include: [
{relation: 'worker', scope: {fields: ['name', 'firstName']}}, {relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
},
{ {
relation: 'ticket', relation: 'ticket',
scope: { scope: {
@ -16,14 +26,28 @@ class Controller {
} }
} }
}, },
{relation: 'claimState', scope: {fields: ['id', 'description']}}, {
relation: 'claimState',
scope: {
fields: ['id', 'description']
}
},
{ {
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk', 'name'], fields: ['salesPersonFk', 'name'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
} }

View File

@ -29,10 +29,10 @@
value="{{$ctrl.claim.created | dateTime: 'dd/MM/yyyy'}}"> value="{{$ctrl.claim.created | dateTime: 'dd/MM/yyyy'}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Salesperson" <vn-label-value label="Salesperson"
value="{{$ctrl.claim.client.salesPerson.firstName}} {{$ctrl.claim.client.salesPerson.name}}"> value="{{$ctrl.claim.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Attended by" <vn-label-value label="Attended by"
value="{{$ctrl.claim.worker.firstName}} {{$ctrl.claim.worker.name}}"> value="{{$ctrl.claim.worker.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Agency" <vn-label-value label="Agency"
value="{{$ctrl.claim.ticket.agencyMode.name}}"> value="{{$ctrl.claim.ticket.agencyMode.name}}">

View File

@ -71,15 +71,14 @@
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
label="Worker"
field="claimDevelopment.workerFk" field="claimDevelopment.workerFk"
url="/client/api/Clients/activeWorkersWithRole" url="/api/Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}" search-function="{firstName: $search}"
where="{role: 'employee'}"
show-field="firstName"
value-field="id" value-field="id"
where="{role: 'employee'}"
label="Worker"
vn-acl="salesAssistant"> vn-acl="salesAssistant">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one

View File

@ -42,7 +42,7 @@
</span> </span>
</vn-td> </vn-td>
<vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td> <vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::claim.worker.firstName}} {{::claim.worker.name}}</vn-td> <vn-td>{{::claim.worker.user.nickname}}</vn-td>
<vn-td class="{{::claim.claimState.description}}">{{::claim.claimState.description}}</vn-td> <vn-td class="{{::claim.claimState.description}}">{{::claim.claimState.description}}</vn-td>
<vn-td> <vn-td>
<vn-icon-button <vn-icon-button

View File

@ -17,7 +17,13 @@ export default class Controller {
{ {
relation: 'worker', relation: 'worker',
scope: { scope: {
fields: ['firstName', 'name'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
}, },
{ {

View File

@ -9,10 +9,10 @@
value="{{$ctrl.summary.claim.claimState.description}}"> value="{{$ctrl.summary.claim.claimState.description}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Salesperson" <vn-label-value label="Salesperson"
value="{{$ctrl.summary.claim.client.salesPerson.firstName}} {{$ctrl.summary.claim.client.salesPerson.name}}"> value="{{$ctrl.summary.claim.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Attended by" <vn-label-value label="Attended by"
value="{{$ctrl.summary.claim.worker.firstName}} {{$ctrl.summary.claim.worker.name}}"> value="{{$ctrl.summary.claim.worker.user.nickname}}">
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-one> <vn-one>

View File

@ -40,7 +40,7 @@ module.exports = Self => {
return {or: [ return {or: [
{'w.firstName': {like: `%${value}%`}}, {'w.firstName': {like: `%${value}%`}},
{'w.name': {like: `%${value}%`}}, {'w.name': {like: `%${value}%`}},
{'u.name': {like: `%${value}%`}} {'u.nickname': {like: `%${value}%`}}
]}; ]};
case 'id': case 'id':
return {'w.id': value}; return {'w.id': value};
@ -54,7 +54,7 @@ module.exports = Self => {
myFilter = mergeFilters(myFilter, clientFilter); myFilter = mergeFilters(myFilter, clientFilter);
let stmt = new ParameterizedSQL( let stmt = new ParameterizedSQL(
`SELECT DISTINCT w.id, w.firstName, w.name `SELECT DISTINCT w.id, w.firstName, w.name, u.nickname
FROM worker w FROM worker w
JOIN account.user u ON u.id = w.userFk JOIN account.user u ON u.id = w.userFk
JOIN account.roleRole i ON i.role = u.role JOIN account.roleRole i ON i.role = u.role

View File

@ -27,7 +27,13 @@ module.exports = function(Self) {
{ {
relation: 'salesPerson', relation: 'salesPerson',
scope: { scope: {
fields: ['id', 'firstName', 'name'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
}, { }, {
relation: 'contactChannel', relation: 'contactChannel',

View File

@ -35,12 +35,48 @@ module.exports = Self => {
async function getSummary(client, clientId) { async function getSummary(client, clientId) {
let filter = { let filter = {
include: [ include: [
{relation: 'account', scope: {fields: ['name', 'active']}}, {
{relation: 'salesPerson', scope: {fields: ['firstName', 'name']}}, relation: 'account',
{relation: 'country', scope: {fields: ['country']}}, scope: {
{relation: 'province', scope: {fields: ['name']}}, fields: ['name', 'active']
{relation: 'contactChannel', scope: {fields: ['name']}}, }
{relation: 'payMethod', scope: {fields: ['name']}}, },
{
relation: 'salesPerson',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
},
{
relation: 'country',
scope: {
fields: ['country']
}
},
{
relation: 'province',
scope: {
fields: ['name']
}
},
{
relation: 'contactChannel',
scope: {
fields: ['name']
}
},
{
relation: 'payMethod',
scope: {
fields: ['name']
}
},
{ {
relation: 'addresses', relation: 'addresses',
scope: { scope: {

View File

@ -40,12 +40,12 @@ module.exports = Self => {
NULL debit, NULL debit,
r.amountPaid credit, r.amountPaid credit,
r.bankFk, r.bankFk,
firstName, u.nickname userNickname,
name,
r.clientFk, r.clientFk,
FALSE pdf FALSE pdf
FROM vn.receipt r FROM vn.receipt r
LEFT JOIN vn.worker w ON w.id = r.workerFk LEFT JOIN vn.worker w ON w.id = r.workerFk
LEFT JOIN account.user u ON u.id = w.userFk
JOIN vn.company c ON c.id = r.companyFk JOIN vn.company c ON c.id = r.companyFk
WHERE r.clientFk = ? AND r.companyFk = ? WHERE r.clientFk = ? AND r.companyFk = ?
UNION ALL UNION ALL
@ -60,7 +60,6 @@ module.exports = Self => {
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL,
i.clientFk, i.clientFk,
i.pdf i.pdf
FROM vn.invoiceOut i FROM vn.invoiceOut i

View File

@ -42,6 +42,17 @@
} }
}, },
"scope": { "scope": {
"include": "worker" "include": {
"relation": "worker",
"scope": {
"fields": ["userFk"],
"include": {
"relation": "user",
"scope": {
"fields": ["nickname"]
}
}
}
}
} }
} }

View File

@ -42,16 +42,15 @@
<vn-horizontal> <vn-horizontal>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
initial-data="$ctrl.client.salesPerson" disabled="false"
field="$ctrl.client.salesPersonFk" field="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole" url="/client/api/Clients/activeWorkersWithRole"
show-field="firstName" show-field="nickname"
search-function="{firstName: $search}" search-function="{firstName: $search}"
value-field="id" value-field="id"
where="{role: 'employee'}" where="{role: 'employee'}"
label="Salesperson" label="Salesperson"
vn-acl="salesAssistant"> vn-acl="salesAssistant">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete
vn-one vn-one

View File

@ -21,7 +21,7 @@
<vn-tr ng-repeat="credit in credits track by credit.id"> <vn-tr ng-repeat="credit in credits track by credit.id">
<vn-td>{{::credit.amount | number:2}} €</vn-td> <vn-td>{{::credit.amount | number:2}} €</vn-td>
<vn-td>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::credit.worker.firstName}} {{::credit.worker.name}}</vn-td> <vn-td>{{::credit.worker.user.nickname}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>
<vn-empty-rows ng-if="model.data.length === 0" translate> <vn-empty-rows ng-if="model.data.length === 0" translate>

View File

@ -8,7 +8,13 @@ class Controller {
{ {
relation: 'worker', relation: 'worker',
scope: { scope: {
fields: ['firstName', 'name'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
} }
] ]

View File

@ -33,7 +33,7 @@
value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}"> value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Sales person" <vn-label-value label="Sales person"
value="{{$ctrl.client.salesPerson.firstName}} {{$ctrl.client.salesPerson.name}}"> value="{{$ctrl.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
</div> </div>
<div class="icons"> <div class="icons">

View File

@ -1,7 +1,7 @@
<vn-crud-model <vn-crud-model
vn-id="model" vn-id="model"
url="/client/api/clientObservations" url="/client/api/clientObservations"
filter="{order: 'created DESC'}" filter="$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}" link="{clientFk: $ctrl.$stateParams.id}"
data="notes" data="notes"
auto-load="true"> auto-load="true">
@ -15,7 +15,7 @@
border-radius border-radius
margin-small-bottom> margin-small-bottom>
<vn-horizontal margin-small-bottom style="color: #666"> <vn-horizontal margin-small-bottom style="color: #666">
<vn-one>{{::note.worker.firstName}} {{::note.worker.name}}</vn-one> <vn-one>{{::note.worker.user.nickname}}</vn-one>
<vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto> <vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto>
</vn-horizontal> </vn-horizontal>
<vn-horizontal class="text"> <vn-horizontal class="text">

View File

@ -3,6 +3,9 @@ import ngModule from '../../module';
export default class Controller { export default class Controller {
constructor($stateParams) { constructor($stateParams) {
this.$stateParams = $stateParams; this.$stateParams = $stateParams;
this.filter = {
order: 'created DESC',
};
} }
} }

View File

@ -60,7 +60,7 @@
<vn-tr ng-repeat="risk in $ctrl.risks"> <vn-tr ng-repeat="risk in $ctrl.risks">
<vn-td>{{::risk.payed | dateTime:'dd/MM/yyyy'}}</vn-td> <vn-td>{{::risk.payed | dateTime:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::risk.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td>{{::risk.created | dateTime:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::risk.firstName}} {{::risk.name}}</vn-td> <vn-td>{{::risk.userNickname}}</vn-td>
<vn-td> <vn-td>
<span ng-show="risk.ref" translate>BILL</span> {{::risk.ref}} <span ng-show="risk.ref" translate>BILL</span> {{::risk.ref}}
</vn-td> </vn-td>

View File

@ -24,7 +24,7 @@
<vn-tr ng-repeat="sample in samples"> <vn-tr ng-repeat="sample in samples">
<vn-td>{{::sample.created | date:'dd/MM/yyyy HH:mm' }}</vn-td> <vn-td>{{::sample.created | date:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::sample.type.description}}</vn-td> <vn-td>{{::sample.type.description}}</vn-td>
<vn-td>{{::sample.worker.firstName}} {{::sample.worker.name}}</vn-td> <vn-td>{{::sample.worker.user.nickname}}</vn-td>
<vn-td>{{::sample.company.code}}</vn-td> <vn-td>{{::sample.company.code}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>

View File

@ -14,7 +14,13 @@ class Controller {
{ {
relation: 'worker', relation: 'worker',
scope: { scope: {
fields: ['firstName', 'name'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
}, },
{ {

View File

@ -1,5 +1,5 @@
<vn-card class="summary"> <vn-card class="summary">
<h5>{{$ctrl.summary.name}} - {{$ctrl.summary.id}} - {{$ctrl.summary.salesPerson.firstName}} {{$ctrl.summary.salesPerson.name}}</h5> <h5>{{$ctrl.summary.name}} - {{$ctrl.summary.id}} - {{$ctrl.summary.salesPerson.user.nickname}}</h5>
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<h4 translate>Basic data</h4> <h4 translate>Basic data</h4>
@ -22,7 +22,7 @@
value="{{$ctrl.summary.email}}"> value="{{$ctrl.summary.email}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Sales person" <vn-label-value label="Sales person"
value="{{$ctrl.summary.salesPerson.firstName}} {{$ctrl.summary.salesPerson.name}}"> value="{{$ctrl.summary.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Channel" <vn-label-value label="Channel"
value="{{$ctrl.summary.contactChannel.name}}"> value="{{$ctrl.summary.contactChannel.name}}">

View File

@ -33,10 +33,11 @@ module.exports = Self => {
`SELECT i.id, i.image, i.name, i.description, `SELECT i.id, i.image, i.name, i.description,
i.size, i.tag5, i.value5, i.tag6, i.value6, i.size, i.tag5, i.value5, i.tag6, i.value6,
i.tag7, i.value7, i.tag8, i.value8, i.tag7, i.value7, i.tag8, i.value8,
t.name type, w.firstName, w.name worker t.name type, u.nickname userNickname
FROM item i FROM item i
JOIN itemType t ON t.id = i.typeFk JOIN itemType t ON t.id = i.typeFk
JOIN worker w ON w.id = t.workerFk` JOIN worker w ON w.id = t.workerFk
JOIN account.user u ON u.id = w.userFk`
); );
if (tags) { if (tags) {

View File

@ -26,18 +26,26 @@ module.exports = Self => {
let filter = { let filter = {
where: {id: id}, where: {id: id},
include: [ include: [
{relation: 'itemType', {
relation: 'itemType',
scope: { scope: {
fields: ['id', 'name', 'workerFk', 'warehouseFk'], fields: ['id', 'name', 'workerFk', 'warehouseFk'],
include: [{ include: [{
relation: 'worker', relation: 'worker',
scope: { scope: {
fields: ['id', 'name', 'firstName'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
}] }]
} }
}, },
{relation: 'tags', {
relation: 'tags',
scope: { scope: {
fields: ['id', 'value', 'tagFk'], fields: ['id', 'value', 'tagFk'],
include: [{ include: [{

View File

@ -33,7 +33,13 @@ module.exports = Self => {
include: [{ include: [{
relation: 'worker', relation: 'worker',
scope: { scope: {
fields: ['id', 'name', 'firstName'] fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
} }
}] }]
} }

View File

@ -12,7 +12,8 @@ describe('item getLastEntries()', () => {
it('should return three entries for a given item', async() => { it('should return three entries for a given item', async() => {
let date = new Date(); let date = new Date();
date.setMonth(date.getMonth() - 2, 15); date.setMonth(date.getMonth() - 2, 1);
let filter = {where: {itemFk: 1, date: date}}; let filter = {where: {itemFk: 1, date: date}};
let result = await app.models.Item.getLastEntries(filter); let result = await app.models.Item.getLastEntries(filter);

View File

@ -49,7 +49,7 @@
value="{{::$ctrl.item.name}}"> value="{{::$ctrl.item.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Buyer" <vn-label-value label="Buyer"
value="{{$ctrl.item.itemType.worker.firstName}} {{$ctrl.item.itemType.worker.name}}"> value="{{$ctrl.item.itemType.worker.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
ng-repeat="tag in $ctrl.item.tags | limitTo:4" ng-repeat="tag in $ctrl.item.tags | limitTo:4"

View File

@ -18,7 +18,7 @@
value="{{::$ctrl.item.type}}"> value="{{::$ctrl.item.type}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Buyer" <vn-label-value label="Buyer"
value="{{::$ctrl.item.firstName}} {{::$ctrl.item.worker}}"> value="{{::$ctrl.item.userNickname}}">
</vn-label-value> </vn-label-value>
<vn-fetched-tags max-length="4" item="$ctrl.item" class="noTitle"/> <vn-fetched-tags max-length="4" item="$ctrl.item" class="noTitle"/>
</vn-one> </vn-one>
@ -36,4 +36,3 @@
</vn-horizontal> </vn-horizontal>
</vn-horizontal> </vn-horizontal>
</a> </a>

View File

@ -39,7 +39,7 @@
value="{{$ctrl.summary.item.origin.stems}}"> value="{{$ctrl.summary.item.origin.stems}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Buyer" <vn-label-value label="Buyer"
value="{{$ctrl.summary.item.itemType.worker.firstName}} {{$ctrl.summary.item.itemType.worker.name}}"> value="{{$ctrl.summary.item.itemType.worker.user.nickname}}">
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-one name="otherData"> <vn-one name="otherData">

View File

@ -7,16 +7,15 @@ class Controller {
} }
getSummary() { getSummary() {
this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then((response) => { this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data; this.summary = response.data;
}); });
} }
$onChanges() { $onChanges() {
if (this.item && this.item.id) { if (this.item && this.item.id)
this.getSummary(); this.getSummary();
} }
}
} }
Controller.$inject = ['$http']; Controller.$inject = ['$http'];

View File

@ -51,25 +51,43 @@ class Controller extends Component {
let filter = { let filter = {
include: [ include: [
{relation: 'warehouse', scope: {fields: ['name']}}, {
{relation: 'agencyMode', scope: {fields: ['name']}}, relation: 'warehouse',
scope: {
fields: ['name']
}
},
{
relation: 'agencyMode',
scope: {
fields: ['name']
}
},
{ {
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'], fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
}, },
{ {
relation: 'tracking', relation: 'state',
scope: { scope: {
fields: ['stateFk'], fields: ['stateFk'],
include: { include: {
relation: 'state', relation: 'state',
fields: ['name'] fields: ['id', 'name'],
} }
} }
} }

View File

@ -71,25 +71,43 @@ describe('Item', () => {
let filter = { let filter = {
include: [ include: [
{relation: 'warehouse', scope: {fields: ['name']}}, {
{relation: 'agencyMode', scope: {fields: ['name']}}, relation: 'warehouse',
scope: {
fields: ['name']
}
},
{
relation: 'agencyMode',
scope: {
fields: ['name']
}
},
{ {
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'], fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
}, },
{ {
relation: 'tracking', relation: 'state',
scope: { scope: {
fields: ['stateFk'], fields: ['stateFk'],
include: { include: {
relation: 'state', relation: 'state',
fields: ['name'] fields: ['id', 'name'],
} }
} }
} }

View File

@ -30,7 +30,7 @@
value="{{$ctrl.ticket.state.state.name}}"> value="{{$ctrl.ticket.state.state.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Sales person" <vn-label-value label="Sales person"
value="{{$ctrl.ticket.client.salesPerson.firstName}} {{$ctrl.ticket.client.salesPerson.name}}"> value="{{$ctrl.ticket.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Shipped" <vn-label-value label="Shipped"
value="{{$ctrl.ticket.shipped | date: 'dd/MM/yyyy HH:mm' }}"> value="{{$ctrl.ticket.shipped | date: 'dd/MM/yyyy HH:mm' }}">

View File

@ -7,16 +7,36 @@ class Controller {
this.order = {}; this.order = {};
this.filter = { this.filter = {
include: [ include: [
{relation: 'agencyMode', scope: {fields: ['name']}}, {
{relation: 'address', scope: {fields: ['nickname']}}, relation: 'agencyMode', scope: {
{relation: 'rows', scope: {fields: ['id']}}, fields: ['name']
}
},
{
relation: 'address', scope: {
fields: ['nickname']
}
},
{
relation: 'rows', scope: {
fields: ['id']
}
},
{ {
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'], fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
} }

View File

@ -20,7 +20,7 @@
value="{{$ctrl.order.isConfirmed ? $ctrl.translate.instant('Confirmed') : $ctrl.translate.instant('Not confirmed')}}"> value="{{$ctrl.order.isConfirmed ? $ctrl.translate.instant('Confirmed') : $ctrl.translate.instant('Not confirmed')}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Sales person" <vn-label-value label="Sales person"
value="{{$ctrl.order.client.salesPerson.firstName}} {{$ctrl.order.client.salesPerson.name}}"> value="{{$ctrl.order.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Landed" <vn-label-value label="Landed"
value="{{$ctrl.order.landed | date: 'dd/MM/yyyy' }}"> value="{{$ctrl.order.landed | date: 'dd/MM/yyyy' }}">

View File

@ -23,9 +23,11 @@
<vn-tr> <vn-tr>
<vn-th field="id" default-order="DESC">Id</vn-th> <vn-th field="id" default-order="DESC">Id</vn-th>
<vn-th field="clientFk">Client</vn-th> <vn-th field="clientFk">Client</vn-th>
<vn-th field="clientFk">Sales person</vn-th>
<vn-th field="isConfirmed">Confirmed</vn-th> <vn-th field="isConfirmed">Confirmed</vn-th>
<vn-th field="sourceApp">Created from</vn-th> <vn-th field="sourceApp">Created from</vn-th>
<vn-th field="created">Created</vn-th> <vn-th field="created">Created</vn-th>
<vn-th field="created">Landed</vn-th>
<vn-th field="companyFk">Company</vn-th> <vn-th field="companyFk">Company</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -38,6 +40,7 @@
{{::order.client.name}} {{::order.client.name}}
</span> </span>
</vn-td> </vn-td>
<vn-td>{{::order.client.salesPerson.user.nickname}}</vn-td>
<vn-td> <vn-td>
<vn-check <vn-check
field="order.isConfirmed" field="order.isConfirmed"
@ -46,6 +49,7 @@
</vn-td> </vn-td>
<vn-td>{{::order.sourceApp}}</vn-td> <vn-td>{{::order.sourceApp}}</vn-td>
<vn-td>{{::order.created | date:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td>{{::order.created | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::order.landed | date:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::order.company.code}}</vn-td> <vn-td>{{::order.company.code}}</vn-td>
<vn-td> <vn-td>
<vn-icon-button <vn-icon-button

View File

@ -8,7 +8,22 @@ export default class Controller {
include: [ include: [
{ {
relation: 'client', relation: 'client',
fields: ['name'] scope: {
fields: ['name', 'salesPersonFk'],
include: {
relation: 'salesPerson',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
}
}
}, },
{ {
relation: 'company', relation: 'company',

View File

@ -31,12 +31,12 @@ module.exports = Self => {
st.originalQuantity, st.originalQuantity,
st.created, st.created,
st.workerFk, st.workerFk,
w.firstName, u.nickname userNickname,
w.name,
ste.name AS state ste.name AS state
FROM saleTracking st FROM saleTracking st
JOIN sale s ON s.id = st.saleFk JOIN sale s ON s.id = st.saleFk
JOIN worker w ON w.id = st.workerFk JOIN worker w ON w.id = st.workerFk
JOIN account.user u ON u.id = w.userFk
JOIN state ste ON ste.id = st.stateFk`); JOIN state ste ON ste.id = st.stateFk`);
stmt.merge(Self.makeSuffix(filter)); stmt.merge(Self.makeSuffix(filter));

View File

@ -182,7 +182,8 @@ module.exports = Self => {
wk.name AS salesPerson, wk.name AS salesPerson,
ts.stateFk as stateFk, ts.stateFk as stateFk,
ts.alertLevel as alertLevel, ts.alertLevel as alertLevel,
ts.code as alertLevelCode ts.code as alertLevelCode,
u.nickname userNickname
FROM ticket t FROM ticket t
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
@ -191,7 +192,8 @@ module.exports = Self => {
LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN ticketState ts ON ts.ticketFk = t.id
LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN state st ON st.id = ts.stateFk
LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN client c ON c.id = t.clientFk
LEFT JOIN worker wk ON wk.id = c.salesPersonFk`); LEFT JOIN worker wk ON wk.id = c.salesPersonFk
LEFT JOIN account.user u ON u.id = wk.userFk`);
stmt.merge(conn.makeSuffix(filter)); stmt.merge(conn.makeSuffix(filter));
stmts.push(stmt); stmts.push(stmt);

View File

@ -57,7 +57,15 @@ module.exports = Self => {
fields: ['salesPersonFk', 'name'], fields: ['salesPersonFk', 'name'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'] scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
} }
} }
}, },

View File

@ -16,7 +16,15 @@ class Controller {
fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked', 'credit'], fields: ['salesPersonFk', 'name', 'isActive', 'isFreezed', 'isTaxDataChecked', 'credit'],
include: { include: {
relation: 'salesPerson', relation: 'salesPerson',
fields: ['firstName', 'name'], scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
}, },
}, },
}, },

View File

@ -57,7 +57,7 @@
</vn-icon> </vn-icon>
</vn-td> </vn-td>
<vn-td number>{{::ticket.id}}</vn-td> <vn-td number>{{::ticket.id}}</vn-td>
<vn-td>{{::ticket.salesPerson | dashIfEmpty}}</vn-td> <vn-td>{{::ticket.userNickname | dashIfEmpty}}</vn-td>
<vn-td class="{{$ctrl.compareDate(ticket.shipped)}}"> <vn-td class="{{$ctrl.compareDate(ticket.shipped)}}">
{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}} {{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}
</vn-td> </vn-td>

View File

@ -12,14 +12,13 @@
<vn-textfield vn-one label="Description" field="$ctrl.ticketRequest.description" vn-focus></vn-textfield> <vn-textfield vn-one label="Description" field="$ctrl.ticketRequest.description" vn-focus></vn-textfield>
<vn-autocomplete <vn-autocomplete
vn-one vn-one
label="Buyer"
field="$ctrl.ticketRequest.atenderFk" field="$ctrl.ticketRequest.atenderFk"
select-fields="['id', 'firstName']"
url="/client/api/Clients/activeWorkersWithRole" url="/client/api/Clients/activeWorkersWithRole"
where="{role: 'buyer'}" show-field="nickname"
search-function="{firstName: $search}" search-function="{firstName: $search}"
show-field="firstName"> value-field="id"
<tpl-item>{{firstName}} {{name}}</tpl-item> where="{role: 'buyer'}"
label="Buyer">
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>

View File

@ -34,8 +34,8 @@
<vn-td number>{{::request.id}}</vn-td> <vn-td number>{{::request.id}}</vn-td>
<vn-td>{{::request.description}}</vn-td> <vn-td>{{::request.description}}</vn-td>
<vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::request.requester.user.name}}</vn-td> <vn-td>{{::request.requester.user.nickname}}</vn-td>
<vn-td>{{::request.atender.user.name}}</vn-td> <vn-td>{{::request.atender.user.nickname}}</vn-td>
<vn-td number>{{::request.quantity}}</vn-td> <vn-td number>{{::request.quantity}}</vn-td>
<vn-td number>{{::request.price | currency: 'EUR': 2}}</vn-td> <vn-td number>{{::request.price | currency: 'EUR': 2}}</vn-td>
<vn-td number> <vn-td number>

View File

@ -6,21 +6,31 @@ class Controller {
this.$scope = $scope; this.$scope = $scope;
this.filter = { this.filter = {
include: [ include: [
{relation: 'atender', {
relation: 'atender',
scope: { scope: {
include: { include: {
relation: 'user' relation: 'user',
scope: {
fields: ['nickname']
}
} }
} }
}, },
{relation: 'requester', {
relation: 'requester',
scope: { scope: {
include: { include: {
relation: 'user' relation: 'user',
scope: {
fields: ['nickname']
}
} }
} }
}, },
{relation: 'sale'} {
relation: 'sale'
}
] ]
}; };
} }

View File

@ -42,7 +42,7 @@
<vn-td>{{::sale.originalQuantity}}</vn-td> <vn-td>{{::sale.originalQuantity}}</vn-td>
<vn-td title="{{::sale.firstName}} {{::sale.name}}" <vn-td title="{{::sale.firstName}} {{::sale.name}}"
class="ellipsize" style="max-width: 5em"> class="ellipsize" style="max-width: 5em">
{{::sale.firstName}} {{::sale.name}} {{::sale.userNickname}}
</vn-td> </vn-td>
<vn-td>{{::sale.state}}</vn-td> <vn-td>{{::sale.state}}</vn-td>
<vn-td>{{::sale.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td>{{::sale.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td>

View File

@ -6,7 +6,7 @@
value="{{$ctrl.summary.state.state.name}}"> value="{{$ctrl.summary.state.state.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Salesperson" <vn-label-value label="Salesperson"
value="{{$ctrl.summary.client.salesPerson.firstName}} {{$ctrl.summary.client.salesPerson.name}}"> value="{{$ctrl.summary.client.salesPerson.user.nickname}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Agency" <vn-label-value label="Agency"
value="{{$ctrl.summary.agencyMode.name}}"> value="{{$ctrl.summary.agencyMode.name}}">

View File

@ -19,12 +19,11 @@
ng-if="$ctrl.isPickerDesignedState" ng-if="$ctrl.isPickerDesignedState"
field="$ctrl.workerFk" field="$ctrl.workerFk"
url="/client/api/Clients/activeWorkersWithRole" url="/client/api/Clients/activeWorkersWithRole"
show-field="firstName" show-field="nickname"
search-function="{firstName: $search}" search-function="{firstName: $search}"
value-field="id" value-field="id"
where="{role: 'employee'}" where="{role: 'employee'}"
label="Worker"> label="Worker">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>

View File

@ -22,7 +22,7 @@
class="vn-list-item"> class="vn-list-item">
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<h6>{{::worker.firstName}} {{::worker.name}}</h6> <h6>{{::worker.user.nickname}}</h6>
<vn-label-value label="Id" <vn-label-value label="Id"
value="{{::worker.id}}"> value="{{::worker.id}}">
</vn-label-value> </vn-label-value>

View File

@ -8,7 +8,7 @@ export default class Controller {
include: [ include: [
{ {
relation: 'user', relation: 'user',
scope: {fields: ['name', 'email']} scope: {fields: ['nickname', 'email']}
}, { }, {
relation: 'client', relation: 'client',
scope: {fields: ['fi']} scope: {fields: ['fi']}