7226-testToMaster_2416 #2320
|
@ -233,8 +233,6 @@ BEGIN
|
||||||
|
|
||||||
UPDATE config SET inventoried = vInventoryDate;
|
UPDATE config SET inventoried = vInventoryDate;
|
||||||
|
|
||||||
SET @isModeInventory := FALSE;
|
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tEntryToDelete
|
CREATE OR REPLACE TEMPORARY TABLE tEntryToDelete
|
||||||
(INDEX(entryId)) ENGINE = MEMORY
|
(INDEX(entryId)) ENGINE = MEMORY
|
||||||
SELECT e.id entryId,
|
SELECT e.id entryId,
|
||||||
|
@ -262,6 +260,8 @@ BEGIN
|
||||||
FROM travel t
|
FROM travel t
|
||||||
JOIN tEntryToDelete tmp ON tmp.travelId = t.id;
|
JOIN tEntryToDelete tmp ON tmp.travelId = t.id;
|
||||||
|
|
||||||
|
SET @isModeInventory := FALSE;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE IF EXISTS tEntryToDelete;
|
DROP TEMPORARY TABLE IF EXISTS tEntryToDelete;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
|
@ -29,7 +29,6 @@ BEGIN
|
||||||
JOIN province p ON p.id = a.provinceFk
|
JOIN province p ON p.id = a.provinceFk
|
||||||
JOIN country co ON co.id = p.countryFk
|
JOIN country co ON co.id = p.countryFk
|
||||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||||
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
|
||||||
JOIN warehouse w ON w.id = t.warehouseFk
|
JOIN warehouse w ON w.id = t.warehouseFk
|
||||||
JOIN company com ON com.id = t.companyFk
|
JOIN company com ON com.id = t.companyFk
|
||||||
JOIN client c2 ON c2.id = com.clientFk
|
JOIN client c2 ON c2.id = com.clientFk
|
||||||
|
@ -38,12 +37,10 @@ BEGIN
|
||||||
LEFT JOIN route r ON r.id = t.routeFk
|
LEFT JOIN route r ON r.id = t.routeFk
|
||||||
LEFT JOIN worker wo ON wo.id = r.workerFk
|
LEFT JOIN worker wo ON wo.id = r.workerFk
|
||||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||||
WHERE t.shipped BETWEEN util.yesterday() AND util.dayEnd(util.VN_CURDATE())
|
WHERE al.code IN ('PACKED', 'DELIVERED')
|
||||||
AND al.code IN ('PACKED', 'DELIVERED')
|
|
||||||
AND co.code <> 'ES'
|
AND co.code <> 'ES'
|
||||||
AND am.name <> 'ABONO'
|
AND am.name <> 'ABONO'
|
||||||
AND w.code = 'ALG'
|
AND w.code = 'ALG'
|
||||||
AND dm.code = 'DELIVERY'
|
|
||||||
AND t.id = vSelf
|
AND t.id = vSelf
|
||||||
GROUP BY t.id;
|
GROUP BY t.id;
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,6 @@ module.exports = Self => {
|
||||||
JOIN province p ON p.id = a.provinceFk
|
JOIN province p ON p.id = a.provinceFk
|
||||||
JOIN country co ON co.id = p.countryFk
|
JOIN country co ON co.id = p.countryFk
|
||||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||||
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
|
||||||
JOIN warehouse w ON w.id = t.warehouseFk
|
JOIN warehouse w ON w.id = t.warehouseFk
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT td.ticketFk, d.id
|
SELECT td.ticketFk, d.id
|
||||||
|
@ -128,7 +127,6 @@ module.exports = Self => {
|
||||||
WHERE co.code <> 'ES'
|
WHERE co.code <> 'ES'
|
||||||
AND am.name <> 'ABONO'
|
AND am.name <> 'ABONO'
|
||||||
AND w.code = 'ALG'
|
AND w.code = 'ALG'
|
||||||
AND dm.code = 'DELIVERY'
|
|
||||||
AND t.cmrFk
|
AND t.cmrFk
|
||||||
) sub
|
) sub
|
||||||
`);
|
`);
|
||||||
|
|
|
@ -152,7 +152,10 @@ module.exports = async function(ctx, Self, tickets, reqArgs = {}) {
|
||||||
VALUES ('invoicingTicketError', ?)
|
VALUES ('invoicingTicketError', ?)
|
||||||
`, [ticket.id + ' - ' + error]);
|
`, [ticket.id + ' - ' + error]);
|
||||||
// Domain not found
|
// Domain not found
|
||||||
if (error.responseCode == 450) return invalidEmail(ticket);
|
if (error.responseCode == 450) {
|
||||||
|
await invalidEmail(ticket);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Save tickets on a list of failed ids
|
// Save tickets on a list of failed ids
|
||||||
failedtickets.push({
|
failedtickets.push({
|
||||||
|
|
Loading…
Reference in New Issue