@@ -169,12 +170,20 @@
class="link">
{{ticket.refFk}}
-
{{ticket.state}}
+
+
+
+ |
-
Filter by selection
-
Exclude selection
-
Remove filter
-
Remove all filters
-
Copy value
diff --git a/modules/route/back/methods/route/specs/clone.spec.js b/modules/route/back/methods/route/specs/clone.spec.js
index 9192854f8..496ae1c89 100644
--- a/modules/route/back/methods/route/specs/clone.spec.js
+++ b/modules/route/back/methods/route/specs/clone.spec.js
@@ -1,6 +1,22 @@
const app = require('vn-loopback/server/server');
+const LoopBackContext = require('loopback-context');
describe('route clone()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
const createdDate = Date.vnNew();
it('should throw an error if the amount of ids pased to the clone function do no match the database', async() => {
const ids = [996, 997, 998, 999];
diff --git a/modules/route/back/methods/route/specs/updateWorkCenter.spec.js b/modules/route/back/methods/route/specs/updateWorkCenter.spec.js
index 5328dc240..baa63f226 100644
--- a/modules/route/back/methods/route/specs/updateWorkCenter.spec.js
+++ b/modules/route/back/methods/route/specs/updateWorkCenter.spec.js
@@ -1,6 +1,20 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('route updateWorkCenter()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
const routeId = 1;
it('should set the commission work center if the worker has workCenter', async() => {
diff --git a/modules/ticket/back/methods/sale/specs/canEdit.spec.js b/modules/ticket/back/methods/sale/specs/canEdit.spec.js
index a6c299321..62f98421a 100644
--- a/modules/ticket/back/methods/sale/specs/canEdit.spec.js
+++ b/modules/ticket/back/methods/sale/specs/canEdit.spec.js
@@ -1,7 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale canEdit()', () => {
const employeeId = 1;
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
describe('sale editTracked', () => {
it('should return true if the role is production regardless of the saleTrackings', async() => {
diff --git a/modules/ticket/back/methods/sale/specs/deleteSales.spec.js b/modules/ticket/back/methods/sale/specs/deleteSales.spec.js
index 82cf916b3..3d3e06e22 100644
--- a/modules/ticket/back/methods/sale/specs/deleteSales.spec.js
+++ b/modules/ticket/back/methods/sale/specs/deleteSales.spec.js
@@ -1,6 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale deleteSales()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
it('should throw an error if the ticket of the given sales is not editable', async() => {
const tx = await models.Sale.beginTransaction({});
diff --git a/modules/ticket/back/methods/sale/specs/reserve.spec.js b/modules/ticket/back/methods/sale/specs/reserve.spec.js
index 7ab79f9c0..259cb8cd5 100644
--- a/modules/ticket/back/methods/sale/specs/reserve.spec.js
+++ b/modules/ticket/back/methods/sale/specs/reserve.spec.js
@@ -1,4 +1,5 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale reserve()', () => {
const ctx = {
@@ -9,6 +10,20 @@ describe('sale reserve()', () => {
}
};
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
it('should throw an error if the ticket can not be modified', async() => {
const tx = await models.Sale.beginTransaction({});
diff --git a/modules/ticket/back/methods/sale/specs/updateConcept.spec.js b/modules/ticket/back/methods/sale/specs/updateConcept.spec.js
index 0e7e9bf0f..1b42e7140 100644
--- a/modules/ticket/back/methods/sale/specs/updateConcept.spec.js
+++ b/modules/ticket/back/methods/sale/specs/updateConcept.spec.js
@@ -1,6 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale updateConcept()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
const ctx = {req: {accessToken: {userId: 9}}};
const saleId = 25;
diff --git a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
index 51cd2403f..133be8de3 100644
--- a/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
+++ b/modules/ticket/back/methods/sale/specs/updatePrice.spec.js
@@ -1,6 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale updatePrice()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 18},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
const ctx = {
req: {
accessToken: {userId: 18},
diff --git a/modules/ticket/back/methods/sale/specs/updateQuantity.spec.js b/modules/ticket/back/methods/sale/specs/updateQuantity.spec.js
index 53a05cd7e..4778f6b6d 100644
--- a/modules/ticket/back/methods/sale/specs/updateQuantity.spec.js
+++ b/modules/ticket/back/methods/sale/specs/updateQuantity.spec.js
@@ -1,6 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale updateQuantity()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
+
const ctx = {
req: {
accessToken: {userId: 9},
diff --git a/modules/ticket/back/methods/ticket/specs/addSale.spec.js b/modules/ticket/back/methods/ticket/specs/addSale.spec.js
index cfd149511..2e568716a 100644
--- a/modules/ticket/back/methods/ticket/specs/addSale.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/addSale.spec.js
@@ -1,7 +1,21 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('ticket addSale()', () => {
const ticketId = 13;
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
it('should create a new sale for the ticket with id 13', async() => {
const tx = await models.Ticket.beginTransaction({});
diff --git a/modules/ticket/back/methods/ticket/specs/merge.spec.js b/modules/ticket/back/methods/ticket/specs/merge.spec.js
index 78eb0c8f3..3254e58a8 100644
--- a/modules/ticket/back/methods/ticket/specs/merge.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/merge.spec.js
@@ -10,11 +10,15 @@ describe('ticket merge()', () => {
workerFk: 1
};
- const activeCtx = {
- accessToken: {userId: 9},
- };
-
- beforeEach(() => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx
});
@@ -35,16 +39,16 @@ describe('ticket merge()', () => {
try {
const options = {transaction: tx};
- const chatNotificationBeforeMerge = await models.Chat.find();
+ const chatNotificationBeforeMerge = await models.Chat.find(null, options);
await models.Ticket.merge(ctx, [tickets], options);
- const createdTicketLog = await models.TicketLog.find({where: {originFk: tickets.originId}}, options);
+ const createdTicketLog = await models.TicketLog.find({where: {originFk: tickets.destinationId}}, options);
const deletedTicket = await models.Ticket.findOne({where: {id: tickets.originId}}, options);
const salesTicketFuture = await models.Sale.find({where: {ticketFk: tickets.destinationId}}, options);
- const chatNotificationAfterMerge = await models.Chat.find();
+ const chatNotificationAfterMerge = await models.Chat.find(null, options);
- expect(createdTicketLog.length).toEqual(2);
+ expect(createdTicketLog.length).toEqual(1);
expect(deletedTicket.isDeleted).toEqual(true);
expect(salesTicketFuture.length).toEqual(2);
expect(chatNotificationBeforeMerge.length).toEqual(chatNotificationAfterMerge.length - 2);
diff --git a/modules/ticket/back/methods/ticket/specs/updateDiscount.spec.js b/modules/ticket/back/methods/ticket/specs/updateDiscount.spec.js
index 1f6712087..41de1fd6e 100644
--- a/modules/ticket/back/methods/ticket/specs/updateDiscount.spec.js
+++ b/modules/ticket/back/methods/ticket/specs/updateDiscount.spec.js
@@ -1,6 +1,20 @@
const models = require('vn-loopback/server/server').models;
+const LoopBackContext = require('loopback-context');
describe('sale updateDiscount()', () => {
+ beforeAll(async() => {
+ const activeCtx = {
+ accessToken: {userId: 9},
+ http: {
+ req: {
+ headers: {origin: 'http://localhost'}
+ }
+ }
+ };
+ spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
+ active: activeCtx
+ });
+ });
const originalSaleId = 8;
it('should throw an error if no sales were selected', async() => {
diff --git a/modules/ticket/front/expedition/locale/es.yml b/modules/ticket/front/expedition/locale/es.yml
index 278dcc8f2..1933bac20 100644
--- a/modules/ticket/front/expedition/locale/es.yml
+++ b/modules/ticket/front/expedition/locale/es.yml
@@ -1,4 +1,4 @@
-Status log: Hitorial de estados
+Status log: Historial de estados
Expedition removed: Expedición eliminada
Move: Mover
New ticket without route: Nuevo ticket sin ruta
diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index 8764417a8..6fc986e8f 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -28,8 +28,9 @@
+ disabled="!$ctrl.hasSelectedSales()"
+ vn-tooltip="Select lines to see the options"
+ ng-click="moreOptions.show($event)">
{
SUM(b.stickers) AS stickers,
s.id AS cargoSupplierFk,
s.nickname AS cargoSupplierNickname,
+ s.name AS supplierName,
CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg,
CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg
FROM travel t
@@ -167,6 +168,7 @@ module.exports = Self => {
SUM(b.stickers) AS stickers,
e.evaNotes,
e.notes,
+ e.invoiceAmount,
CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg,
CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg
FROM tmp.travel tr
diff --git a/modules/travel/front/extra-community/index.html b/modules/travel/front/extra-community/index.html
index 376c81aaf..c888f97da 100644
--- a/modules/travel/front/extra-community/index.html
+++ b/modules/travel/front/extra-community/index.html
@@ -3,7 +3,7 @@
url="Travels/extraCommunityFilter"
user-params="::$ctrl.defaultFilter"
data="travels"
- order="shipped ASC, landed ASC, travelFk, loadPriority, agencyModeFk, evaNotes"
+ order="landed ASC, shipped ASC, travelFk, loadPriority, agencyModeFk, supplierName, evaNotes"
limit="20"
auto-load="true">
@@ -48,6 +48,9 @@
Agency
|
+
+ Amount
+ |
Reference
|
@@ -107,6 +110,7 @@
{{::travel.cargoSupplierNickname}}
|
+ |
{{::travel.agencyModeName}} |
@@ -157,22 +161,15 @@
{{::entry.supplierName}}
|
+ {{::entry.invoiceAmount | currency: 'EUR': 2}} |
|
- {{::entry.ref}} |
+ {{::entry.invoiceNumber}} |
{{::entry.stickers}} |
|
{{::entry.loadedkg}} |
{{::entry.volumeKg}} |
-
-
- {{::entry.notes}}
-
- |
-
-
- {{::entry.evaNotes}}
-
- |
+ |
+ |
|
|
diff --git a/modules/travel/front/extra-community/locale/es.yml b/modules/travel/front/extra-community/locale/es.yml
index dc231226f..ed6179c91 100644
--- a/modules/travel/front/extra-community/locale/es.yml
+++ b/modules/travel/front/extra-community/locale/es.yml
@@ -6,6 +6,6 @@ Phy. KG: KG físico
Vol. KG: KG Vol.
Search by travel id or reference: Buscar por id de travel o referencia
Search by extra community travel: Buscar por envío extra comunitario
-Continent Out: Continente salida
+Continent Out: Cont. salida
W. Shipped: F. envío
-W. Landed: F. llegada
\ No newline at end of file
+W. Landed: F. llegada
diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html
index 27a700083..a768e4a29 100644
--- a/modules/travel/front/index/index.html
+++ b/modules/travel/front/index/index.html
@@ -2,6 +2,15 @@