Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2609-travel_index_addEntry
This commit is contained in:
commit
0e0ce9f3e9
File diff suppressed because one or more lines are too long
|
@ -1085,6 +1085,22 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`)
|
|||
(3, 'Cycas revoluta', 2, NULL),
|
||||
(4, 'Polygonum', NULL, NULL);
|
||||
|
||||
INSERT INTO `vn`.`tag`(`id`, `code`, `name`, `isFree`, `isQuantitatif`, `sourceTable`, `unit`, `ediTypeFk`, `overwrite`)
|
||||
VALUES
|
||||
(1, 'color', 'Color', 0, 0, 'ink', NULL, NULL, 'inkFk'),
|
||||
(2, NULL, 'Forma', 1, 0, NULL, NULL,NULL, NULL),
|
||||
(3, NULL, 'Material', 1, 0, NULL, NULL,NULL, NULL),
|
||||
(4, NULL, 'Longitud', 1, 1, NULL, 'mm', NULL, 'size'),
|
||||
(5, NULL, 'Diámetro', 1, 1, NULL, 'mm',NULL, 'diameter'),
|
||||
(7, NULL, 'Ancho de la base', 1, 1, NULL, 'mm',NULL, NULL),
|
||||
(23, 'stems', 'Tallos', 1, 1, NULL, NULL, NULL, 'stems'),
|
||||
(27, NULL, 'Longitud(cm)', 1, 1, NULL, 'cm', NULL, NULL),
|
||||
(36, NULL, 'Proveedor', 1, 0, NULL, NULL, NULL, NULL),
|
||||
(56, NULL, 'Genero', 1, 0, NULL, NULL, NULL, NULL),
|
||||
(58, NULL, 'Variedad', 1, 0, NULL, NULL, NULL, NULL),
|
||||
(67, 'category', 'Categoria', 1, 0, NULL, NULL, NULL, NULL),
|
||||
(92, NULL, 'Nombre temporal', 1, 0, NULL, NULL, NULL, NULL);
|
||||
|
||||
INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
||||
VALUES
|
||||
(1, 1, 56, 'Ranged weapon', 1),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -43,7 +43,6 @@ TABLES=(
|
|||
cplusSubjectOp
|
||||
cplusTaxBreak
|
||||
pgc
|
||||
tag
|
||||
time
|
||||
claimResponsible
|
||||
claimReason
|
||||
|
|
|
@ -59,7 +59,6 @@ IGNORETABLES=(
|
|||
--ignore-table=vn.mail__
|
||||
--ignore-table=vn.manaSpellers
|
||||
--ignore-table=vn.outgoingInvoiceKk
|
||||
--ignore-table=vn.payment
|
||||
--ignore-table=vn.paymentExchangeInsurance
|
||||
--ignore-table=vn.payrollCenter
|
||||
--ignore-table=vn.plantpassport__
|
||||
|
|
|
@ -24,11 +24,9 @@
|
|||
}
|
||||
.icon-invoiceIn:before {
|
||||
content: "\e960";
|
||||
color: #5f5f5f;
|
||||
}
|
||||
.icon-invoiceOut:before {
|
||||
content: "\e961";
|
||||
color: #5f5f5f;
|
||||
}
|
||||
.icon-supplier:before {
|
||||
content: "\e936";
|
||||
|
@ -107,7 +105,6 @@
|
|||
}
|
||||
.icon-invoices:before {
|
||||
content: "\e91c";
|
||||
color: #5f5f5f;
|
||||
}
|
||||
.icon-pets:before {
|
||||
content: "\e94e";
|
||||
|
|
|
@ -86,5 +86,7 @@
|
|||
"The social name cannot be empty": "The social name cannot be empty",
|
||||
"The nif cannot be empty": "The nif cannot be empty",
|
||||
"A travel with this data already exists": "A travel with this data already exists",
|
||||
"The observation type can't be repeated": "The observation type can't be repeated"
|
||||
"The observation type can't be repeated": "The observation type can't be repeated",
|
||||
"New ticket request has been created with price": "New ticket request has been created '{{description}}' for day <strong>{{shipped}}</strong>, with a quantity of <strong>{{quantity}}</strong> and a price of <strong>{{price}} €</strong>",
|
||||
"New ticket request has been created": "New ticket request has been created '{{description}}' for day <strong>{{shipped}}</strong>, with a quantity of <strong>{{quantity}}</strong>"
|
||||
}
|
|
@ -164,5 +164,7 @@
|
|||
"You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
|
||||
"You can't upload images on the test environment": "No puedes subir imágenes en el entorno de pruebas",
|
||||
"The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta",
|
||||
"Sorts whole route": "Reordena ruta entera"
|
||||
"Sorts whole route": "Reordena ruta entera",
|
||||
"New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día <strong>{{shipped}}</strong>, con una cantidad de <strong>{{quantity}}</strong> y un precio de <strong>{{price}} €</strong>",
|
||||
"New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día <strong>{{shipped}}</strong>, con una cantidad de <strong>{{quantity}}</strong>"
|
||||
}
|
|
@ -24,9 +24,9 @@ exports.translateValues = async(instance, changes) => {
|
|||
|
||||
function formatDate(date) {
|
||||
return new Intl.DateTimeFormat('es', {
|
||||
year: '2-digit',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
|
|
|
@ -38,7 +38,6 @@ module.exports = Self => {
|
|||
const ticket = await models.Ticket.findOne({
|
||||
where: {
|
||||
id: ticketId,
|
||||
zoneFk: route.zoneFk,
|
||||
routeFk: null,
|
||||
landed: {between: [minDate, maxDate]},
|
||||
}
|
||||
|
|
|
@ -8,10 +8,38 @@ module.exports = function(Self) {
|
|||
Self.observe('before save', async function(ctx) {
|
||||
if (ctx.isNewInstance) {
|
||||
const loopBackContext = LoopBackContext.getCurrentContext();
|
||||
let filter = {where: {userFk: loopBackContext.active.accessToken.userId}};
|
||||
let worker = await Self.app.models.Worker.findOne(filter);
|
||||
const filter = {where: {userFk: loopBackContext.active.accessToken.userId}};
|
||||
const models = Self.app.models;
|
||||
const worker = await models.Worker.findOne(filter);
|
||||
|
||||
ctx.instance.requesterFk = worker.id;
|
||||
const instance = ctx.instance;
|
||||
instance.requesterFk = worker.id;
|
||||
|
||||
const httpCtx = {req: loopBackContext.active};
|
||||
const httpRequest = httpCtx.req.http .req;
|
||||
const $t = httpRequest.__;
|
||||
|
||||
const attenderId = instance.attenderFk;
|
||||
if (attenderId) {
|
||||
const ticket = await models.Ticket.findById(instance.ticketFk);
|
||||
let messageText = 'New ticket request has been created';
|
||||
if (instance.price)
|
||||
messageText = 'New ticket request has been created with price';
|
||||
|
||||
const shipped = new Intl.DateTimeFormat('es', {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric'
|
||||
}).format(ticket.shipped);
|
||||
|
||||
const message = $t(messageText, {
|
||||
description: instance.description,
|
||||
shipped: shipped,
|
||||
quantity: instance.quantity,
|
||||
price: instance.price
|
||||
});
|
||||
await models.Chat.sendCheckingPresence(httpCtx, attenderId, message);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue