Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 1959-client_fiscal_data_check_phone
gitea/salix/1959-client_fiscal_data_check_phone This commit looks good
Details
gitea/salix/1959-client_fiscal_data_check_phone This commit looks good
Details
This commit is contained in:
commit
f86d3a0052
|
@ -1,6 +1,6 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('lastActiveTickets', {
|
Self.remoteMethod('lastActiveTickets', {
|
||||||
description: 'Returns the last three tickets of a client that have the alertLevel at 0 and the shiped day is gt today',
|
description: 'Returns the last three active tickets of a client',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
arg: 'id',
|
arg: 'id',
|
||||||
|
@ -24,16 +24,18 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.lastActiveTickets = async(id, ticketId) => {
|
Self.lastActiveTickets = async(id, ticketId) => {
|
||||||
|
const ticket = await Self.app.models.Ticket.findById(ticketId);
|
||||||
const query = `
|
const query = `
|
||||||
SELECT t.id, t.shipped, a.name AS agencyName, w.name AS warehouseName
|
SELECT t.id, t.shipped, a.name AS agencyName, w.name AS warehouseName
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
JOIN vn.ticketState ts ON t.id = ts.ticketFk
|
JOIN vn.ticketState ts ON t.id = ts.ticketFk
|
||||||
JOIN vn.agencyMode a ON t.agencyModeFk = a.id
|
JOIN vn.agencyMode a ON t.agencyModeFk = a.id
|
||||||
JOIN vn.warehouse w ON t.warehouseFk = w.id
|
JOIN vn.warehouse w ON t.warehouseFk = w.id
|
||||||
WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 AND t.id <> ?
|
WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0
|
||||||
|
AND t.id <> ? AND t.warehouseFk = ?
|
||||||
ORDER BY t.shipped
|
ORDER BY t.shipped
|
||||||
LIMIT 3`;
|
LIMIT 3`;
|
||||||
|
|
||||||
return Self.rawSql(query, [id, ticketId]);
|
return Self.rawSql(query, [id, ticketId, ticket.warehouseFk]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,6 +32,13 @@
|
||||||
, {{::street}}, {{::city}}, {{::province.name}} - {{::agencyMode.name}}
|
, {{::street}}, {{::city}}, {{::province.name}} - {{::agencyMode.name}}
|
||||||
</span>
|
</span>
|
||||||
</tpl-item>
|
</tpl-item>
|
||||||
|
<append>
|
||||||
|
<vn-icon-button
|
||||||
|
ui-sref="client.card.address.edit({id: $ctrl.clientId, addressId: $ctrl.addressId})"
|
||||||
|
icon="edit"
|
||||||
|
vn-tooltip="Edit address">
|
||||||
|
</vn-icon-button>
|
||||||
|
</append>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete vn-one
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
|
|
|
@ -47,12 +47,11 @@ class Controller {
|
||||||
}};
|
}};
|
||||||
this.$http.get('DmsTypes/findOne', {params}).then(res => {
|
this.$http.get('DmsTypes/findOne', {params}).then(res => {
|
||||||
const dmsTypeId = res.data && res.data.id;
|
const dmsTypeId = res.data && res.data.id;
|
||||||
const companyId = this.vnConfig.companyFk;
|
|
||||||
const warehouseId = this.vnConfig.warehouseFk;
|
const warehouseId = this.vnConfig.warehouseFk;
|
||||||
const defaultParams = {
|
const defaultParams = {
|
||||||
reference: this.ticket.id,
|
reference: this.ticket.id,
|
||||||
warehouseId: warehouseId,
|
warehouseId: warehouseId,
|
||||||
companyId: companyId,
|
companyId: this.ticket.companyFk,
|
||||||
dmsTypeId: dmsTypeId,
|
dmsTypeId: dmsTypeId,
|
||||||
description: this.$translate.instant('FileDescription', {
|
description: this.$translate.instant('FileDescription', {
|
||||||
ticketId: this.ticket.id,
|
ticketId: this.ticket.id,
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
"Holiday": {
|
"Holiday": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"HolidayDetail": {
|
"CalendarHolidaysName": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"HolidayType": {
|
"CalendarHolidaysType": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"WorkCenter": {
|
"WorkCenter": {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "HolidayDetail",
|
"name": "CalendarHolidaysName",
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "holidayDetail"
|
"table": "calendarHolidaysName"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "Number"
|
"type": "Number"
|
||||||
},
|
},
|
||||||
"description": {
|
"name": {
|
||||||
"type": "String"
|
"type": "String"
|
||||||
}
|
}
|
||||||
},
|
},
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "HolidayType",
|
"name": "CalendarHolidaysType",
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
"table": "holidayType"
|
"table": "calendarHolidaysType"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
|
@ -22,12 +22,12 @@
|
||||||
"relations": {
|
"relations": {
|
||||||
"detail": {
|
"detail": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "HolidayDetail",
|
"model": "CalendarHolidaysName",
|
||||||
"foreignKey": "holidayDetailFk"
|
"foreignKey": "holidayDetailFk"
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "HolidayType",
|
"model": "CalendarHolidaysType",
|
||||||
"foreignKey": "holidayTypeFk"
|
"foreignKey": "holidayTypeFk"
|
||||||
},
|
},
|
||||||
"workCenter": {
|
"workCenter": {
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</vn-item-section>
|
</vn-item-section>
|
||||||
<vn-item-section side>
|
<vn-item-section side>
|
||||||
|
<vn-icon-button
|
||||||
|
ng-click="$ctrl.goToTimeControl($event, worker.id)"
|
||||||
|
vn-tooltip="Preview"
|
||||||
|
icon="access_time">
|
||||||
|
</vn-icon-button>
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
ng-click="$ctrl.preview($event, worker)"
|
ng-click="$ctrl.preview($event, worker)"
|
||||||
vn-tooltip="Preview"
|
vn-tooltip="Preview"
|
||||||
|
|
|
@ -18,6 +18,7 @@ export default class Controller {
|
||||||
|
|
||||||
preview(event, worker) {
|
preview(event, worker) {
|
||||||
if (event.defaultPrevented) return;
|
if (event.defaultPrevented) return;
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
@ -25,6 +26,14 @@ export default class Controller {
|
||||||
this.$.preview.show();
|
this.$.preview.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
goToTimeControl(event, workerId) {
|
||||||
|
if (event.defaultPrevented) return;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
this.$state.go('worker.card.timeControl', {id: workerId}, {absolute: true});
|
||||||
|
}
|
||||||
onMoreChange(callback) {
|
onMoreChange(callback) {
|
||||||
callback.call(this);
|
callback.call(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue