diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 0df460c3d..191431073 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -1210,10 +1210,10 @@ INSERT INTO `vn2008`.`workerTeam`(`id`, `team`, `user`)
INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `atenderFk`, `quantity`, `itemFk`, `price`, `isOk`, `saleFk`, `ticketFk`, `created`)
VALUES
- (1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
- (2, 'Melee weapon combat fist 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
- (3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, 4, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
- (4, 'Melee weapon combat fist 15cm', 18, 35, 15, 2, 1.30, NULL, NULL, 11, CURDATE());
+ (1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
+ (2, 'Melee weapon combat first 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
+ (3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, 4, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
+ (4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, CURDATE());
INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxClassFk`, `ticketFk`)
VALUES
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index d30886476..9d4504ce2 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -80,6 +80,6 @@
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
"This client can't be invoiced": "Este cliente no puede ser facturado",
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
- "That item is not available on that day": "That item is not available on that day",
+ "That item is not available on that day": "El item no esta disponible para esa fecha",
"That item doesn't exists": "That item doesn't exists"
}
\ No newline at end of file
diff --git a/modules/item/front/locale/es.yml b/modules/item/front/locale/es.yml
index 12522459a..56c96c403 100644
--- a/modules/item/front/locale/es.yml
+++ b/modules/item/front/locale/es.yml
@@ -45,6 +45,8 @@ stems: Tallos
Compression: Compresión
Density: Densidad
Search items by id, name or barcode: Buscar articulos por identificador, nombre o codigo de barras
+SalesPerson: Comercial
+Concept: Concepto
# Sections
Items: ArtÃculos
diff --git a/modules/item/front/request-search-panel/index.html b/modules/item/front/request-search-panel/index.html
index ba517d1ca..cb1734442 100644
--- a/modules/item/front/request-search-panel/index.html
+++ b/modules/item/front/request-search-panel/index.html
@@ -50,6 +50,16 @@
model="filter.to">
+
+
+
+
+
+
diff --git a/modules/item/front/request/index.html b/modules/item/front/request/index.html
index 786e71e86..76a95a967 100644
--- a/modules/item/front/request/index.html
+++ b/modules/item/front/request/index.html
@@ -1,6 +1,6 @@
@@ -17,7 +17,7 @@
-
+
@@ -29,9 +29,9 @@
Quantity
Price
Atender
- itemFk
+ Item
Concept
- Quantity
+ Quantity
State
@@ -43,15 +43,36 @@
{{request.ticketFk}}
-
- {{::request.shipped | dateTime: 'dd/MM/yyyy'}}
+
+
+ {{::request.shipped | dateTime: 'dd/MM/yyyy'}}
+
{{::request.warehouse}}
- {{::request.salesPersonNickname}}
- {{::request.description}}
+
+
+ {{::request.salesPersonNickname}}
+
+
+
+
+ {{::request.description}}
+
+
{{::request.quantity}}
- {{::request.price}}
- {{::request.atenderNickname}}
+ {{::request.price | currency: 'EUR':2}}
+
+
+ {{::request.atenderNickname}}
+
+
{{request.itemFk}}
@@ -88,10 +109,15 @@
-
+
+
+
+
diff --git a/modules/item/front/request/index.js b/modules/item/front/request/index.js
index 5e3726d81..e4322cf7f 100644
--- a/modules/item/front/request/index.js
+++ b/modules/item/front/request/index.js
@@ -2,11 +2,11 @@ import ngModule from '../module';
import './style.scss';
export default class Controller {
- constructor($scope, vnApp, $translate, $http, $state, $stateParams) {
+ constructor($, vnApp, $translate, $http, $state, $stateParams) {
this.$state = $state;
this.$stateParams = $stateParams;
this.$http = $http;
- this.$scope = $scope;
+ this.$ = $;
this.vnApp = vnApp;
this._ = $translate;
if (!$stateParams.q)
@@ -39,7 +39,7 @@ export default class Controller {
this.$http.post(endpoint, params).then(() => {
this.vnApp.showSuccess(this._.instant('Data saved!'));
}).catch( e => {
- this.$scope.model.refresh();
+ this.$.model.refresh();
throw e;
});
}
@@ -56,7 +56,7 @@ export default class Controller {
this.$http.patch(endpoint, params).then(() => {
this.vnApp.showSuccess(this._.instant('Data saved!'));
}).catch( e => {
- this.$scope.model.refresh();
+ this.$.model.refresh();
throw e;
});
}
@@ -78,15 +78,15 @@ export default class Controller {
onSearch(params) {
if (params)
- this.$scope.model.applyFilter(null, params);
+ this.$.model.applyFilter(null, params);
else
- this.$scope.model.clear();
+ this.$.model.clear();
}
showDenyReason(event, requestId) {
this.denyRequestId = requestId;
- this.$scope.denyReason.parent = event.target;
- this.$scope.denyReason.show();
+ this.$.denyReason.parent = event.target;
+ this.$.denyReason.show();
}
clear() {
@@ -102,35 +102,38 @@ export default class Controller {
this.$http.post(endpoint, params).then(() => {
this.vnApp.showSuccess(this._.instant('Data saved!'));
- this.$scope.model.refresh();
- this.$scope.denyReason.hide();
+ this.$.model.refresh();
+ this.$.denyReason.hide();
this.denyObservation = null;
});
}
- showClientDescriptor(event, clientFk) {
- this.$scope.clientDescriptor.clientFk = clientFk;
- this.$scope.clientDescriptor.parent = event.target;
- this.$scope.clientDescriptor.show();
+ showTicketDescriptor(event, ticketFk) {
+ this.$.ticketDescriptor.ticketFk = ticketFk;
+ this.$.ticketDescriptor.parent = event.target;
+ this.$.ticketDescriptor.show();
event.preventDefault();
event.stopImmediatePropagation();
}
- showTicketDescriptor(event, ticketFk) {
- this.$scope.ticketDescriptor.ticketFk = ticketFk;
- this.$scope.ticketDescriptor.parent = event.target;
- this.$scope.ticketDescriptor.show();
- event.preventDefault();
- event.stopImmediatePropagation();
+ showItemDescriptor(event, itemFk) {
+ this.$.itemDescriptor.itemFk = itemFk;
+ this.$.itemDescriptor.parent = event.target;
+ this.$.itemDescriptor.show();
+ }
+
+ showWorkerDescriptor(event, userId) {
+ this.$.workerDescriptor.userId = userId;
+ this.$.workerDescriptor.parent = event.target;
+ this.$.workerDescriptor.show();
}
onDescriptorLoad() {
- this.$scope.popover.relocate();
+ this.$.popover.relocate();
}
preventNavigation(event) {
event.preventDefault();
- event.stopImmediatePropagation();
}
}
diff --git a/modules/ticket/back/methods/ticket-request/confirm.js b/modules/ticket/back/methods/ticket-request/confirm.js
index f9888f9e0..79676b9b2 100644
--- a/modules/ticket/back/methods/ticket-request/confirm.js
+++ b/modules/ticket/back/methods/ticket-request/confirm.js
@@ -48,14 +48,13 @@ module.exports = Self => {
let params = [
ctx.args.itemFk,
- request.ticket().warehouseFk,
request.ticket().shipped,
+ request.ticket().warehouseFk,
false
];
-
+ console.log(params);
let [res] = await Self.rawSql(query, params);
let available = res[0].available;
-
if (!available)
throw new UserError(`That item is not available on that day`);
diff --git a/modules/ticket/back/methods/ticket-request/filter.js b/modules/ticket/back/methods/ticket-request/filter.js
index 1d19120ff..a2862c59b 100644
--- a/modules/ticket/back/methods/ticket-request/filter.js
+++ b/modules/ticket/back/methods/ticket-request/filter.js
@@ -43,6 +43,10 @@ module.exports = Self => {
arg: 'to',
type: 'Date',
description: `Date to`
+ }, {
+ arg: 'isOk',
+ type: 'Boolean',
+ description: `Search request by request state`
}
],
returns: {
@@ -111,7 +115,9 @@ module.exports = Self => {
t.clientFk,
w.name AS warehouse,
u.nickname AS salesPersonNickname,
- ua.nickname AS atenderNickname
+ ua.nickname AS atenderNickname,
+ u.id AS salesPersonUserFk,
+ ua.id AS atenderUserFk
FROM ticketRequest tr
LEFT JOIN ticket t ON t.id = tr.ticketFk
LEFT JOIN warehouse w ON w.id = t.warehouseFk