Bug #783 al abrir una reclamacion navegar a ella, no abrir nueva pestaña
This commit is contained in:
parent
e06798cf90
commit
d85a4da1ab
|
@ -70,6 +70,14 @@
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td>
|
<vn-td>
|
||||||
|
<a ui-sref="claim.card.basicData({id: sale.claim.claimFk})">
|
||||||
|
<vn-icon
|
||||||
|
ng-show="sale.claim.claimFk"
|
||||||
|
orange
|
||||||
|
icon="icon-claims"
|
||||||
|
vn-tooltip="{{::$ctrl.$translate.instant('Claim')}}: {{::sale.claim.claimFk}}">
|
||||||
|
</vn-icon>
|
||||||
|
</a>
|
||||||
<vn-icon
|
<vn-icon
|
||||||
ng-show="sale.visible || sale.available"
|
ng-show="sale.visible || sale.available"
|
||||||
orange
|
orange
|
||||||
|
|
|
@ -24,5 +24,6 @@ Friday: Viernes
|
||||||
Saturday: Sábado
|
Saturday: Sábado
|
||||||
Sunday: Domingo
|
Sunday: Domingo
|
||||||
Add claim: Crear reclamación
|
Add claim: Crear reclamación
|
||||||
|
Claim: Reclamación
|
||||||
Transfer lines: Transferir líneas
|
Transfer lines: Transferir líneas
|
||||||
Change ticket state to 'Ok': Cambiar estado del ticket a 'Ok'
|
Change ticket state to 'Ok': Cambiar estado del ticket a 'Ok'
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
"posttest": "npm run lint && nsp check"
|
"posttest": "npm run lint && nsp check"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vn-loopback": "file:../loopback",
|
"vn-loopback": "file:../loopback"
|
||||||
"object-diff": "0.0.4",
|
|
||||||
"object.pick": "^1.3.0"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
{
|
{
|
||||||
"Claim": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"ClaimState": {
|
"ClaimState": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"ClaimBeginning": {
|
|
||||||
"dataSource": "vn"
|
|
||||||
},
|
|
||||||
"ClaimReason": {
|
"ClaimReason": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const UserError = require('vn-loopback/common/helpers').UserError;
|
const UserError = require('../../../common/helpers').UserError;
|
||||||
var pick = require('object.pick');
|
let pick = require('object.pick');
|
||||||
var diff = require('object-diff');
|
let diff = require('object-diff');
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethodCtx('updateClaim', {
|
Self.remoteMethodCtx('updateClaim', {
|
|
@ -23,9 +23,12 @@ module.exports = Self => {
|
||||||
let query = `CALL vn.ticketGetVisibleAvailable(?)`;
|
let query = `CALL vn.ticketGetVisibleAvailable(?)`;
|
||||||
let [lines] = await Self.rawSql(query, [ticketFk]);
|
let [lines] = await Self.rawSql(query, [ticketFk]);
|
||||||
let ids = [];
|
let ids = [];
|
||||||
|
let salesIds = [];
|
||||||
|
|
||||||
for (line of lines)
|
for (line of lines) {
|
||||||
ids.push(line.itemFk);
|
ids.push(line.itemFk);
|
||||||
|
salesIds.push(line.id);
|
||||||
|
}
|
||||||
|
|
||||||
let filter = {
|
let filter = {
|
||||||
fields: ['id', 'name', 'tag5', 'value5', 'tag6', 'value6', 'tag7', 'value7', 'tag8', 'value8', 'tag9', 'value9', 'tag10', 'value10'],
|
fields: ['id', 'name', 'tag5', 'value5', 'tag6', 'value6', 'tag7', 'value7', 'tag8', 'value8', 'tag9', 'value9', 'tag10', 'value10'],
|
||||||
|
@ -33,12 +36,24 @@ module.exports = Self => {
|
||||||
};
|
};
|
||||||
let items = await Self.app.models.Item.find(filter);
|
let items = await Self.app.models.Item.find(filter);
|
||||||
|
|
||||||
|
filter = {
|
||||||
|
fields: ['claimFk', 'saleFk'],
|
||||||
|
where: {saleFk: {inq: salesIds}},
|
||||||
|
};
|
||||||
|
let claims = await Self.app.models.ClaimBeginning.find(filter);
|
||||||
|
|
||||||
let map = {};
|
let map = {};
|
||||||
for (item of items)
|
for (item of items)
|
||||||
map[item.id] = item;
|
map[item.id] = item;
|
||||||
|
|
||||||
for (line of lines)
|
let claimMap = {};
|
||||||
|
for (claim of claims)
|
||||||
|
claimMap[claim.saleFk] = claim;
|
||||||
|
|
||||||
|
for (line of lines) {
|
||||||
line.tags = map[line.itemFk];
|
line.tags = map[line.itemFk];
|
||||||
|
line.claim = claimMap[line.id];
|
||||||
|
}
|
||||||
|
|
||||||
return lines;
|
return lines;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,10 +2,10 @@ const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getSales()', () => {
|
describe('ticket getSales()', () => {
|
||||||
it('should return the sales of a ticket', async () => {
|
it('should return the sales of a ticket', async () => {
|
||||||
let sales = await app.models.Ticket.getSales(1);
|
let sales = await app.models.Ticket.getSales(16);
|
||||||
|
|
||||||
expect(sales.length).toBe(4);
|
expect(sales.length).toEqual(4);
|
||||||
expect(sales[0].item).toBeDefined();
|
expect(sales[0].tags).toBeDefined();
|
||||||
expect(sales[0].item.tags).toBeDefined();
|
expect(sales[1].claim).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
"require-yaml": "0.0.1",
|
"require-yaml": "0.0.1",
|
||||||
"serve-favicon": "^2.0.1",
|
"serve-favicon": "^2.0.1",
|
||||||
"strong-error-handler": "^2.1.0",
|
"strong-error-handler": "^2.1.0",
|
||||||
|
"object-diff": "0.0.4",
|
||||||
"object.pick": "^1.3.0"
|
"object.pick": "^1.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
"ACL": {
|
"ACL": {
|
||||||
"dataSource": "salix"
|
"dataSource": "salix"
|
||||||
},
|
},
|
||||||
|
"Claim": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"ClaimBeginning": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
"FieldAcl": {
|
"FieldAcl": {
|
||||||
"dataSource": "salix"
|
"dataSource": "salix"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue