Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7671_dense_itemFixedPrices
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
commit
57dbdc6f24
|
@ -6,9 +6,10 @@ BEGIN
|
||||||
*
|
*
|
||||||
* @param tmp.buysToCheck(id as INT).
|
* @param tmp.buysToCheck(id as INT).
|
||||||
*/
|
*/
|
||||||
DECLARE hasVolumetricAgency INT;
|
DECLARE vHasVolumetricAgency INT;
|
||||||
|
DECLARE vItemFk INT;
|
||||||
|
|
||||||
SELECT a.hasWeightVolumetric INTO hasVolumetricAgency
|
SELECT a.hasWeightVolumetric, i.id INTO vHasVolumetricAgency, vItemFk
|
||||||
FROM entry e
|
FROM entry e
|
||||||
JOIN travel t ON t.id = e.travelFk
|
JOIN travel t ON t.id = e.travelFk
|
||||||
JOIN agencyMode a ON a.id = t.agencyModeFk
|
JOIN agencyMode a ON a.id = t.agencyModeFk
|
||||||
|
@ -21,8 +22,8 @@ BEGIN
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tmp.buysToCheck;
|
DROP TEMPORARY TABLE tmp.buysToCheck;
|
||||||
|
|
||||||
IF hasVolumetricAgency THEN
|
IF vHasVolumetricAgency THEN
|
||||||
CALL util.throw('Item lacks size/weight in purchase line at agency');
|
CALL util.throw(CONCAT('Missing size/weight in buy line at agency, item: ', vItemFk));
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
|
@ -171,16 +171,6 @@ module.exports = async function(ctx, Self, tickets, reqArgs = {}) {
|
||||||
{userId},
|
{userId},
|
||||||
);
|
);
|
||||||
|
|
||||||
const oldInstance = `{"email": "${ticket.recipient}"}`;
|
|
||||||
const newInstance = `{"email": ""}`;
|
|
||||||
await Self.rawSql(
|
|
||||||
`
|
|
||||||
INSERT INTO clientLog (originFk, userFk, action, changedModel, oldInstance, newInstance)
|
|
||||||
VALUES (?, NULL, 'UPDATE', 'Client', ?, ?)`,
|
|
||||||
[ticket.clientFk, oldInstance, newInstance],
|
|
||||||
{userId},
|
|
||||||
);
|
|
||||||
|
|
||||||
const body = `No se ha podido enviar el albarán <strong>${ticket.id}</strong>
|
const body = `No se ha podido enviar el albarán <strong>${ticket.id}</strong>
|
||||||
al cliente <strong>${ticket.clientFk} - ${ticket.clientName}</strong>
|
al cliente <strong>${ticket.clientFk} - ${ticket.clientName}</strong>
|
||||||
porque la dirección de email <strong>"${ticket.recipient}"</strong> no es correcta
|
porque la dirección de email <strong>"${ticket.recipient}"</strong> no es correcta
|
||||||
|
|
|
@ -143,6 +143,10 @@
|
||||||
],
|
],
|
||||||
"scopes": {
|
"scopes": {
|
||||||
"descriptor": {
|
"descriptor": {
|
||||||
|
"fields": [
|
||||||
|
"id",
|
||||||
|
"phone"
|
||||||
|
],
|
||||||
"include": [
|
"include": [
|
||||||
{
|
{
|
||||||
"relation": "user",
|
"relation": "user",
|
||||||
|
@ -164,15 +168,29 @@
|
||||||
{
|
{
|
||||||
"relation": "department",
|
"relation": "department",
|
||||||
"scope": {
|
"scope": {
|
||||||
|
"fields": [
|
||||||
|
"departmentFk"
|
||||||
|
],
|
||||||
"include": [
|
"include": [
|
||||||
{
|
{
|
||||||
"relation": "department"
|
"relation": "department",
|
||||||
|
"scope": {
|
||||||
|
"fields": [
|
||||||
|
"id",
|
||||||
|
"name"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"relation": "sip"
|
"relation": "sip",
|
||||||
|
"scope": {
|
||||||
|
"fields": [
|
||||||
|
"extension"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,42 +36,8 @@ class Controller extends Descriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadData() {
|
loadData() {
|
||||||
const filter = {
|
return this.getData('Workers/descriptor', {filter: {where: {id: this.id}}})
|
||||||
include: [
|
.then(res => this.entity = res.data[0]);
|
||||||
{
|
|
||||||
relation: 'user',
|
|
||||||
scope: {
|
|
||||||
fields: ['name', 'emailVerified'],
|
|
||||||
include: {
|
|
||||||
relation: 'emailUser',
|
|
||||||
scope: {
|
|
||||||
fields: ['email']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
relation: 'client',
|
|
||||||
scope: {
|
|
||||||
fields: ['fi']
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
relation: 'sip',
|
|
||||||
scope: {
|
|
||||||
fields: ['extension']
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
relation: 'department',
|
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'department'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
return this.getData(`Workers/${this.id}`, {filter})
|
|
||||||
.then(res => this.entity = res.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getPassRequirements() {
|
getPassRequirements() {
|
||||||
|
|
|
@ -14,14 +14,14 @@ describe('vnWorkerDescriptor', () => {
|
||||||
describe('loadData()', () => {
|
describe('loadData()', () => {
|
||||||
it(`should perform a get query to store the worker data into the controller`, () => {
|
it(`should perform a get query to store the worker data into the controller`, () => {
|
||||||
const id = 1;
|
const id = 1;
|
||||||
const response = 'foo';
|
const response = ['foo'];
|
||||||
|
|
||||||
$httpBackend.whenGET('UserConfigs/getUserConfig').respond({});
|
$httpBackend.whenGET('UserConfigs/getUserConfig').respond({});
|
||||||
$httpBackend.expectRoute('GET', `Workers/${id}`).respond(response);
|
$httpBackend.expectRoute('GET', 'Workers/descriptor').respond(response);
|
||||||
controller.id = id;
|
controller.id = id;
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
expect(controller.worker).toEqual(response);
|
expect(controller.worker).toEqual(response[0]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue