Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
3cdb6c438b
|
@ -25,7 +25,7 @@ BEGIN
|
||||||
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
||||||
|
|
||||||
DECLARE vCursor CURSOR FOR
|
DECLARE vCursor CURSOR FOR
|
||||||
SELECT it.taxableBase,
|
SELECT SUM(it.taxableBase),
|
||||||
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
||||||
t.PorcentajeIva,
|
t.PorcentajeIva,
|
||||||
it.transactionTypeSageFk,
|
it.transactionTypeSageFk,
|
||||||
|
@ -204,17 +204,17 @@ BEGIN
|
||||||
FROM vn.invoiceInCorrection
|
FROM vn.invoiceInCorrection
|
||||||
WHERE correctingFk = vInvoiceInFk;
|
WHERE correctingFk = vInvoiceInFk;
|
||||||
|
|
||||||
IF vInvoiceInOriginalFk THEN
|
IF vInvoiceInOriginalFk THEN
|
||||||
|
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
JOIN vn.invoiceInRefund iir ON iir.invoiceInRefundFk = vInvoiceInFk
|
||||||
JOIN (SELECT issued,
|
JOIN (SELECT issued,
|
||||||
SUM(sub.taxableBase) taxableBase,
|
SUM(sub.taxableBase) taxableBase,
|
||||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||||
FROM(SELECT issued,
|
FROM(SELECT issued,
|
||||||
SUM(iit.taxableBase) taxableBase,
|
SUM(iit.taxableBase) taxableBase,
|
||||||
ti.PorcentajeIva
|
ti.PorcentajeIva
|
||||||
FROM vn.invoiceIn i
|
FROM vn.invoiceIn i
|
||||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||||
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
JOIN sage.TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||||
WHERE i.id = vInvoiceInOriginalFk
|
WHERE i.id = vInvoiceInOriginalFk
|
||||||
|
@ -222,7 +222,7 @@ BEGIN
|
||||||
)invoiceInOriginal
|
)invoiceInOriginal
|
||||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||||
SET mci.TipoRectificativa = iir.refundCategoryFk,
|
SET mci.TipoRectificativa = iir.refundCategoryFk,
|
||||||
mci.ClaseAbonoRectificativas = iir.refundType,
|
mci.ClaseAbonoRectificativas = iir.refundType,
|
||||||
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
||||||
mci.FechaOperacion = invoiceInOriginal.issued,
|
mci.FechaOperacion = invoiceInOriginal.issued,
|
||||||
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
||||||
|
@ -232,4 +232,4 @@ BEGIN
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -46,7 +46,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved';
|
AND cs.code = 'resolved';
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved'
|
AND cs.code = 'resolved'
|
||||||
AND c.isChargedToMana;
|
AND c.isChargedToMana;
|
||||||
|
@ -82,7 +82,7 @@ BEGIN
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
SET ce.isGreuge = TRUE
|
SET ce.isGreuge = TRUE
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND NOT ce.isGreuge
|
AND NOT ce.isGreuge
|
||||||
AND cs.code = 'resolved';
|
AND cs.code = 'resolved';
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ BEGIN
|
||||||
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
JOIN claimDestination cd ON cd.id = ce.claimDestinationFk
|
||||||
JOIN claim c ON c.id = ce.claimFk
|
JOIN claim c ON c.id = ce.claimFk
|
||||||
JOIN claimState cs ON cs.id = c.claimStateFk
|
JOIN claimState cs ON cs.id = c.claimStateFk
|
||||||
WHERE cd.description NOT IN ('Bueno', 'Corregido')
|
WHERE cd.code NOT IN ('good', 'corrected', 'supplierClaim')
|
||||||
AND cs.code = 'resolved'
|
AND cs.code = 'resolved'
|
||||||
AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR
|
AND c.ticketCreated >= util.VN_CURDATE() - INTERVAL 1 YEAR
|
||||||
GROUP BY c.clientFk
|
GROUP BY c.clientFk
|
||||||
|
|
|
@ -10,8 +10,8 @@ BEGIN
|
||||||
* @param vIsRaid idRaid value
|
* @param vIsRaid idRaid value
|
||||||
* @param vDaysInForward daysInForward value
|
* @param vDaysInForward daysInForward value
|
||||||
*/
|
*/
|
||||||
IF (NOT vIsRaid AND vDaysInForward IS NOT NULL) OR (vIsRaid AND vDaysInForward IS NULL) THEN
|
IF NOT vIsRaid AND vDaysInForward THEN
|
||||||
CALL util.throw('The raid information is not correct');
|
CALL util.throw('If daysInForward has a value, the raid cannot be unchecked');
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -8,22 +8,15 @@ BEGIN
|
||||||
DECLARE vDone BOOL DEFAULT FALSE;
|
DECLARE vDone BOOL DEFAULT FALSE;
|
||||||
DECLARE vBuyerEmail VARCHAR(40);
|
DECLARE vBuyerEmail VARCHAR(40);
|
||||||
DECLARE vTravelLink TEXT;
|
DECLARE vTravelLink TEXT;
|
||||||
DECLARE vMailBody TEXT DEFAULT '';
|
DECLARE vMailBody TEXT;
|
||||||
|
DECLARE vDaysBetweenDates INT;
|
||||||
|
DECLARE vSubject VARCHAR(30);
|
||||||
|
|
||||||
DECLARE vCur CURSOR FOR
|
DECLARE vTravels CURSOR FOR
|
||||||
SELECT GROUP_CONCAT(DISTINCT
|
SELECT GROUP_CONCAT(DISTINCT travelLink ORDER BY id SEPARATOR '\n\r'),
|
||||||
CONCAT('https://salix.verdnatura.es/#!/travel/',
|
buyerEmail
|
||||||
ttm.travelFk,
|
FROM tTravelToMove
|
||||||
'/summary ')
|
GROUP BY buyerEmail;
|
||||||
ORDER BY ttm.travelFk SEPARATOR '\n\r') travelLink,
|
|
||||||
CONCAT(u.name, '@verdnatura.es') buyerEmail
|
|
||||||
FROM tTravelToMove ttm
|
|
||||||
JOIN entry e ON e.travelFk = ttm.travelFk
|
|
||||||
JOIN buy b ON b.entryFk = e.id
|
|
||||||
JOIN item i ON i.id = b.itemFk
|
|
||||||
JOIN itemType it ON it.id = i.typeFk
|
|
||||||
JOIN account.user u ON u.id = it.workerFk
|
|
||||||
GROUP BY u.name;
|
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
@ -34,35 +27,50 @@ BEGIN
|
||||||
END;
|
END;
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tTravelToMove
|
CREATE OR REPLACE TEMPORARY TABLE tTravelToMove
|
||||||
SELECT id travelFk,
|
WITH travels AS (
|
||||||
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded
|
SELECT id,
|
||||||
FROM travel
|
CONCAT('https://salix.verdnatura.es/#!/travel/', id,'/summary') travelLink,
|
||||||
|
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded,
|
||||||
|
util.VN_CURDATE() - INTERVAL DATEDIFF(landed, shipped) + daysInForward DAY newShipped
|
||||||
|
FROM vn.travel
|
||||||
WHERE isRaid
|
WHERE isRaid
|
||||||
AND daysInForward;
|
AND daysInForward
|
||||||
|
)SELECT t.id,
|
||||||
|
t.travelLink,
|
||||||
|
t.newLanded,
|
||||||
|
t.newShipped,
|
||||||
|
CONCAT(u.name, '@verdnatura.es') buyerEmail
|
||||||
|
FROM travels t
|
||||||
|
STRAIGHT_JOIN vn.entry e ON e.travelFk = t.id
|
||||||
|
JOIN vn.buy b ON b.entryFk = e.id
|
||||||
|
JOIN vn.item i ON i.id = b.itemFk
|
||||||
|
JOIN vn.itemType it ON it.id = i.typeFk
|
||||||
|
JOIN account.user u ON u.id = it.workerFk
|
||||||
|
GROUP BY t.id;
|
||||||
|
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
||||||
UPDATE travel tr
|
UPDATE travel tr
|
||||||
JOIN tTravelToMove ttm ON ttm.travelFk = tr.id
|
JOIN tTravelToMove ttm ON ttm.id = tr.id
|
||||||
SET tr.landed = ttm.newLanded;
|
SET tr.landed = ttm.newLanded,
|
||||||
|
tr.shipped = ttm.newShipped;
|
||||||
|
|
||||||
OPEN vCur;
|
OPEN vTravels;
|
||||||
|
|
||||||
l: LOOP
|
l: LOOP
|
||||||
SET vDone = FALSE;
|
SET vDone = FALSE;
|
||||||
FETCH vCur INTO vTravelLink, vBuyerEmail;
|
FETCH vTravels INTO vTravelLink, vBuyerEmail;
|
||||||
|
|
||||||
IF vDone THEN
|
IF vDone THEN
|
||||||
LEAVE l;
|
LEAVE l;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
CALL `vn`.`mail_insert`(
|
SET vSubject = 'Cambio de fecha en Redadas',
|
||||||
vBuyerEmail,
|
vMailBody = CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink);
|
||||||
'noreply@verdnatura.es',
|
|
||||||
'Cambio de fecha en Redadas',
|
CALL mail_insert(vBuyerEmail, 'noreply@verdnatura.es', vSubject, vMailBody);
|
||||||
CONCAT('Se ha movido los siguientes travels: \n\r ', vTravelLink));
|
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE vCur;
|
CLOSE vTravels;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
DROP TEMPORARY TABLE tTravelToMove;
|
DROP TEMPORARY TABLE tTravelToMove;
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -20,6 +20,10 @@ BEGIN
|
||||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
IF NOT (NEW.isRaid <=> OLD.isRaid) OR NOT (NEW.daysInForward <=> OLD.daysInForward) THEN
|
||||||
|
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
||||||
|
END IF;
|
||||||
|
|
||||||
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
||||||
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||||
FROM travel t
|
FROM travel t
|
||||||
|
|
|
@ -82,7 +82,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const message = $t('Changed sale quantity', {
|
const message = $t('Changed sale quantity', {
|
||||||
ticketId: sale.ticket().id,
|
ticketId: sale.ticket().id,
|
||||||
changes: change,
|
changes: JSON.stringify(change),
|
||||||
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
|
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,11 @@ module.exports = Self => {
|
||||||
arg: 'myTeam',
|
arg: 'myTeam',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: `Team partners`
|
description: `Team partners`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'daysOnward',
|
||||||
|
type: 'number',
|
||||||
|
description: 'The days onward'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -104,6 +109,9 @@ module.exports = Self => {
|
||||||
teamMembersId.push(userId);
|
teamMembersId.push(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const today = Date.vnNew();
|
||||||
|
const future = Date.vnNew();
|
||||||
|
|
||||||
let where = buildFilter(ctx.args, (param, value) => {
|
let where = buildFilter(ctx.args, (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'search':
|
case 'search':
|
||||||
|
@ -140,9 +148,13 @@ module.exports = Self => {
|
||||||
return {'tr.requesterFk': {inq: teamMembersId}};
|
return {'tr.requesterFk': {inq: teamMembersId}};
|
||||||
else
|
else
|
||||||
return {'tr.requesterFk': {nin: teamMembersId}};
|
return {'tr.requesterFk': {nin: teamMembersId}};
|
||||||
|
case 'daysOnward':
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
|
future.setDate(today.getDate() + value);
|
||||||
|
future.setHours(23, 59, 59, 999);
|
||||||
|
return {'t.shipped': {between: [today, future]}};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!where)
|
if (!where)
|
||||||
where = {};
|
where = {};
|
||||||
where['tw.ticketFk'] = null;
|
where['tw.ticketFk'] = null;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
"type" : "number"
|
"type" : "number"
|
||||||
},
|
},
|
||||||
"isDependend": {
|
"isDependend": {
|
||||||
"type" : "number"
|
"type" : "boolean"
|
||||||
},
|
},
|
||||||
"familySituation": {
|
"familySituation": {
|
||||||
"type" : "number"
|
"type" : "number"
|
||||||
|
@ -35,15 +35,17 @@
|
||||||
"type" : "number"
|
"type" : "number"
|
||||||
},
|
},
|
||||||
"hasHousingPaymentBefore": {
|
"hasHousingPaymentBefore": {
|
||||||
"type" : "number"
|
"type" : "boolean"
|
||||||
},
|
},
|
||||||
"hasHousingPaymentAfter": {
|
"hasHousingPaymentAfter": {
|
||||||
"type" : "number"
|
"type" : "boolean"
|
||||||
},
|
},
|
||||||
"updated": {
|
"updated": {
|
||||||
"type" : "date"
|
"type" : "date"
|
||||||
|
},
|
||||||
|
"hasExtendedWorking": {
|
||||||
|
"type" : "boolean"
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
"disabilityGrade": {
|
"disabilityGrade": {
|
||||||
|
|
Loading…
Reference in New Issue