quitado el campo provincia
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0793588ef3
commit
a30a4bf961
|
@ -0,0 +1,115 @@
|
||||||
|
USE `vn`;
|
||||||
|
DROP procedure IF EXISTS `zone_getEvents`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn`$$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getEvents`(
|
||||||
|
vGeoFk INT,
|
||||||
|
vDeliveryMethodFk VARCHAR(255),
|
||||||
|
vAgencyModeFk INT)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Returns available events for the passed province/postcode and agency.
|
||||||
|
*
|
||||||
|
* @param vGeoFk The geo id
|
||||||
|
* @param vAgencyModeFk The agency mode id
|
||||||
|
*/
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.auxZone;
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE tmp.auxZone
|
||||||
|
(id INT(11) PRIMARY KEY)
|
||||||
|
ENGINE = MEMORY;
|
||||||
|
|
||||||
|
IF vDeliveryMethodFk = 'pickUp' THEN
|
||||||
|
INSERT INTO tmp.auxZone
|
||||||
|
SELECT id
|
||||||
|
FROM zone
|
||||||
|
WHERE agencyModeFk = vAgencyModeFk;
|
||||||
|
ELSE
|
||||||
|
CALL zone_getFromGeo(vGeoFk);
|
||||||
|
|
||||||
|
IF vAgencyModeFk IS NOT NULL THEN
|
||||||
|
INSERT INTO tmp.auxZone
|
||||||
|
SELECT t.id
|
||||||
|
FROM tmp.zone t
|
||||||
|
JOIN zone z ON z.id = t.id
|
||||||
|
WHERE z.agencyModeFk = vAgencyModeFk;
|
||||||
|
ELSE
|
||||||
|
INSERT INTO tmp.auxZone
|
||||||
|
SELECT t.id
|
||||||
|
FROM tmp.zone t
|
||||||
|
JOIN zone z ON z.id = t.id
|
||||||
|
JOIN agencyMode am ON am.id = z.agencyModeFk
|
||||||
|
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
||||||
|
WHERE dm.`code` IN ('AGENCY', 'DELIVERY');
|
||||||
|
END IF;
|
||||||
|
DROP TEMPORARY TABLE tmp.zone;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT e.zoneFk, e.`type`, e.dated, e.`started`, e.`ended`, e.weekDays
|
||||||
|
FROM tmp.auxZone t
|
||||||
|
JOIN zoneEvent e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
|
SELECT e.zoneFk, e.dated
|
||||||
|
FROM tmp.auxZone t
|
||||||
|
JOIN zoneExclusion e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp.auxZone;
|
||||||
|
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
USE `vn`;
|
||||||
|
DROP procedure IF EXISTS `zone_getEvents__`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn`$$
|
||||||
|
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getEvents__`(
|
||||||
|
vProvinceFk INT,
|
||||||
|
vPostCode VARCHAR(255),
|
||||||
|
vAgencyModeFk INT)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Returns available events for the passed province/postcode and agency.
|
||||||
|
*
|
||||||
|
* @param vAgencyModeFk The agency mode id
|
||||||
|
* @param vProvinceFk The province id
|
||||||
|
* @param vPostCode The postcode or %NULL to use the province
|
||||||
|
*/
|
||||||
|
|
||||||
|
DECLARE vGeoFk INT;
|
||||||
|
|
||||||
|
IF vPostCode IS NOT NULL THEN
|
||||||
|
SELECT p.geoFk INTO vGeoFk
|
||||||
|
FROM postCode p
|
||||||
|
JOIN town t ON t.id = p.townFk
|
||||||
|
WHERE p.`code` = vPostCode
|
||||||
|
AND t.provinceFk = vProvinceFk;
|
||||||
|
ELSE
|
||||||
|
SELECT geoFk INTO vGeoFk
|
||||||
|
FROM province
|
||||||
|
WHERE id = vProvinceFk;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CALL zone_getFromGeo(vGeoFk);
|
||||||
|
|
||||||
|
IF vAgencyModeFk IS NOT NULL THEN
|
||||||
|
DELETE t FROM tmp.zone t
|
||||||
|
JOIN zone z ON z.id = t.id
|
||||||
|
WHERE z.agencyModeFk != vAgencyModeFk;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
SELECT e.zoneFk, e.`type`, e.dated, e.`started`, e.`ended`, e.weekDays
|
||||||
|
FROM tmp.zone t
|
||||||
|
JOIN zoneEvent e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
|
SELECT e.zoneFk, e.dated
|
||||||
|
FROM tmp.zone t
|
||||||
|
JOIN zoneExclusion e ON e.zoneFk = t.id;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE tmp.zone;
|
||||||
|
END$$
|
||||||
|
|
||||||
|
DELIMITER ;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
Type: Tipo
|
|
||||||
File management: Gestión documental
|
|
||||||
File: Fichero
|
|
||||||
Hard copy: Copia
|
|
||||||
This file will be deleted: Este fichero va a ser borrado
|
|
||||||
Are you sure?: Estas seguro?
|
Are you sure?: Estas seguro?
|
||||||
File deleted: Fichero eliminado
|
|
||||||
Remove file: Eliminar fichero
|
|
||||||
Download file: Descargar fichero
|
Download file: Descargar fichero
|
||||||
|
File: Fichero
|
||||||
|
File deleted: Fichero eliminado
|
||||||
|
Hard copy: Copia
|
||||||
|
My documentation: Mi documentacion
|
||||||
|
Remove file: Eliminar fichero
|
||||||
|
This file will be deleted: Este fichero va a ser borrado
|
||||||
|
Type: Tipo
|
|
@ -1,20 +1,19 @@
|
||||||
Workers: Trabajadores
|
|
||||||
Last name: Apellidos
|
|
||||||
User data: Datos de usuario
|
|
||||||
Fiscal identifier: NIF
|
|
||||||
Email: E-mail
|
|
||||||
Department: Departamento
|
|
||||||
User id: Id de usuario
|
|
||||||
Role: Rol
|
|
||||||
Extension: Extensión
|
|
||||||
Go to client: Ir al cliente
|
|
||||||
Private Branch Exchange: Centralita
|
|
||||||
View worker: Ver trabajador
|
|
||||||
Worker id: Id trabajador
|
|
||||||
Fiscal Identifier: NIF
|
|
||||||
User name: Usuario
|
|
||||||
Departments: Departamentos
|
|
||||||
Calendar: Calendario
|
Calendar: Calendario
|
||||||
|
Data saved! User must access web: ¡Datos guardados! El usuario deberá acceder con su contraseña a la web para que los cambios surtan efecto.
|
||||||
|
Department: Departamento
|
||||||
|
Departments: Departamentos
|
||||||
|
Email: E-mail
|
||||||
|
Extension: Extensión
|
||||||
|
Fiscal identifier: NIF
|
||||||
|
Go to client: Ir al cliente
|
||||||
|
Last name: Apellidos
|
||||||
|
Private Branch Exchange: Centralita
|
||||||
|
Role: Rol
|
||||||
Search workers by id, firstName, lastName or user name: Buscar trabajadores por el identificador, nombre, apellidos o nombre de usuario
|
Search workers by id, firstName, lastName or user name: Buscar trabajadores por el identificador, nombre, apellidos o nombre de usuario
|
||||||
Time control: Control de horario
|
Time control: Control de horario
|
||||||
Data saved! User must access web: ¡Datos guardados! El usuario deberá acceder con su contraseña a la web para que los cambios surtan efecto.
|
User data: Datos de usuario
|
||||||
|
User name: Usuario
|
||||||
|
User id: Id de usuario
|
||||||
|
View worker: Ver trabajador
|
||||||
|
Worker id: Id trabajador
|
||||||
|
Workers: Trabajadores
|
||||||
|
|
|
@ -4,19 +4,20 @@ module.exports = Self => {
|
||||||
description: 'Returns delivery days for a postcode',
|
description: 'Returns delivery days for a postcode',
|
||||||
accepts: [
|
accepts: [
|
||||||
{
|
{
|
||||||
arg: 'provinceFk',
|
arg: 'geoFk',
|
||||||
type: 'Number',
|
type: 'Number',
|
||||||
description: 'The province id',
|
description: 'The geo id'
|
||||||
required: true
|
|
||||||
}, {
|
}, {
|
||||||
arg: 'postCode',
|
arg: 'deliveryMethodFk',
|
||||||
type: 'String',
|
type: 'String',
|
||||||
description: 'The postcode'
|
description: 'The delivery Method code',
|
||||||
|
required: true
|
||||||
}, {
|
}, {
|
||||||
arg: 'agencyModeFk',
|
arg: 'agencyModeFk',
|
||||||
type: 'Number',
|
type: 'Number',
|
||||||
description: 'The agency mode id'
|
description: 'The agency mode id'
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
type: 'Object',
|
type: 'Object',
|
||||||
|
@ -28,10 +29,10 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getEvents = async(provinceFk, postCode, agencyModeFk) => {
|
Self.getEvents = async(geoFk, deliveryMethodFk, agencyModeFk) => {
|
||||||
let [events, exclusions] = await Self.rawSql(
|
let [events, exclusions] = await Self.rawSql(
|
||||||
`CALL zone_getEvents(?, ?, ?)`,
|
`CALL zone_getEvents(?, ?, ?)`,
|
||||||
[provinceFk, postCode, agencyModeFk]
|
[geoFk, deliveryMethodFk, agencyModeFk]
|
||||||
);
|
);
|
||||||
return {events, exclusions};
|
return {events, exclusions};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,28 +6,35 @@
|
||||||
</div>
|
</div>
|
||||||
<vn-side-menu side="right">
|
<vn-side-menu side="right">
|
||||||
<form ng-submit="$ctrl.onSubmit()" class="vn-pa-md">
|
<form ng-submit="$ctrl.onSubmit()" class="vn-pa-md">
|
||||||
<vn-autocomplete
|
<vn-radio
|
||||||
label="Province"
|
label="Pick up"
|
||||||
ng-model="params.provinceFk"
|
val="pickUp"
|
||||||
url="Provinces"
|
ng-model="params.deliveryMethodFk">
|
||||||
fields="['countryFk']"
|
</vn-radio>
|
||||||
include="'country'">
|
<vn-radio
|
||||||
|
label="Delivery"
|
||||||
|
val="delivery"
|
||||||
|
ng-model="params.deliveryMethodFk">
|
||||||
|
</vn-radio>
|
||||||
|
<vn-autocomplete vn-one
|
||||||
|
ng-show="params.deliveryMethodFk === 'delivery'"
|
||||||
|
label="Postcode"
|
||||||
|
ng-model="params.geoFk"
|
||||||
|
url="Postcodes/location"
|
||||||
|
fields="['code','townFk']"
|
||||||
|
order="code, townFk"
|
||||||
|
value-field="geoFk"
|
||||||
|
show-field="code">
|
||||||
<tpl-item>
|
<tpl-item>
|
||||||
<div>{{name}}</div>
|
{{code}} - {{town.name}} ({{town.province.name}},
|
||||||
<div class="text-caption text-secondary">
|
{{town.province.country.country}})
|
||||||
{{country.country}}
|
|
||||||
</div>
|
|
||||||
</tpl-item>
|
</tpl-item>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-textfield
|
|
||||||
vn-one
|
|
||||||
label="Postcode"
|
|
||||||
ng-model="params.postCode">
|
|
||||||
</vn-textfield>
|
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
label="Agency"
|
label="Agency"
|
||||||
ng-model="params.agencyModeFk"
|
ng-model="params.agencyModeFk"
|
||||||
url="AgencyModes/isActive">
|
url="AgencyModes/isActive"
|
||||||
|
where="$ctrl.agencyFilter">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-submit label="Query" class="vn-mt-sm"></vn-submit>
|
<vn-submit label="Query" class="vn-mt-sm"></vn-submit>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import './style.scss';
|
||||||
class Controller extends Section {
|
class Controller extends Section {
|
||||||
$onInit() {
|
$onInit() {
|
||||||
this.$.params = {};
|
this.$.params = {};
|
||||||
|
this.$.params.deliveryMethodFk = 'delivery';
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
@ -18,6 +19,24 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get deliveryMethodFk() {
|
||||||
|
return this._deliveryMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
set deliveryMethodFk(value) {
|
||||||
|
this._deliveryMethod = value;
|
||||||
|
let filter;
|
||||||
|
if (value === 'pickUp')
|
||||||
|
filter = {where: {code: 'PICKUP'}};
|
||||||
|
else
|
||||||
|
filter = {where: {code: {neq: 'PICKUP'}}};
|
||||||
|
let json = encodeURIComponent(JSON.stringify(filter));
|
||||||
|
this.$http.get(`DeliveryMethods?filter=${json}`).then(json => {
|
||||||
|
let deliveryMethods = json.data.map(deliveryMethod => deliveryMethod.id);
|
||||||
|
this.agencyFilter = {deliveryMethodFk: {inq: deliveryMethods}};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onSelection($event, $events) {
|
onSelection($event, $events) {
|
||||||
if (!$events.length) return;
|
if (!$events.length) return;
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,31 @@
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
|
Are you sure you want to delete this zone?: ¿Seguro de que quieres eliminar esta zona?
|
||||||
|
Clone: Clonar
|
||||||
|
Exceptions: Excepciones
|
||||||
|
Closing: Cierre
|
||||||
|
Delivery days: Días de entrega
|
||||||
|
Delivery: Entrega
|
||||||
|
Everyday: Todos los días
|
||||||
|
Exclusions: Exclusiones
|
||||||
|
From: Desde
|
||||||
|
Hour: Hora
|
||||||
|
Indefinitely: Indefinido
|
||||||
|
Inflation: Inflación
|
||||||
|
Locations: Localizaciones
|
||||||
|
Maximum m³: M³ máximo
|
||||||
|
New zone: Nueva zona
|
||||||
|
One day: Un día
|
||||||
|
Pick up: Recogida
|
||||||
|
Postcode: Código postal
|
||||||
|
Price: Precio
|
||||||
|
Query: Consultar
|
||||||
|
Province: Provincia
|
||||||
|
Range of dates: Rango de fechas
|
||||||
|
Search zone by id or name: Buscar zonas por identificador o nombre
|
||||||
|
This zone will be removed: La zona será eliminada
|
||||||
|
To: Hasta
|
||||||
|
Volumetric: Volumétrico
|
||||||
|
Warehouse: Almacén
|
||||||
Warehouses: Almacenes
|
Warehouses: Almacenes
|
||||||
Week days: Días de la semana
|
Week days: Días de la semana
|
||||||
Exceptions: Excepciones
|
|
||||||
Exclusions: Exclusiones
|
|
||||||
Warehouse: Almacén
|
|
||||||
Hour: Hora
|
|
||||||
Price: Precio
|
|
||||||
Locations: Localizaciones
|
|
||||||
This zone will be removed: La zona será eliminada
|
|
||||||
Are you sure you want to delete this zone?: ¿Seguro de que quieres eliminar esta zona?
|
|
||||||
Zones: Zonas
|
Zones: Zonas
|
||||||
New zone: Nueva zona
|
|
||||||
Volumetric: Volumétrico
|
|
||||||
Clone: Clonar
|
|
||||||
Search zone by id or name: Buscar zonas por identificador o nombre
|
|
||||||
From: Desde
|
|
||||||
To: Hasta
|
|
||||||
Closing: Cierre
|
|
||||||
One day: Un día
|
|
||||||
Range of dates: Rango de fechas
|
|
||||||
Indefinitely: Indefinido
|
|
||||||
Everyday: Todos los días
|
|
||||||
Delivery days: Días de entrega
|
|
||||||
Province: Provincia
|
|
||||||
Postcode: Código postal
|
|
||||||
Inflation: Inflación
|
|
||||||
Query: Consultar
|
|
||||||
Maximum m³: M³ máximo
|
|
Loading…
Reference in New Issue