Revert ItemMigration and enbale in Salix (cd7ed6987a
) #3236
|
@ -29,10 +29,8 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.getSales = async(ctx, collectionOrTicketFk, print, source, options) => {
|
||||
const models = Self.app.models;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
const myOptions = {userId};
|
||||
const $t = ctx.req.__;
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
@ -59,22 +57,6 @@ module.exports = Self => {
|
|||
|
||||
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
|
||||
|
||||
for (let ticket of tickets) {
|
||||
if (ticket.observaciones) {
|
||||
let observations = ticket.observaciones.split(' ');
|
||||
|
||||
for (let observation of observations) {
|
||||
const salesPerson = ticket.salesPersonFk;
|
||||
if (observation.startsWith('#') || observation.startsWith('@')) {
|
||||
await models.Chat.send(ctx,
|
||||
observation,
|
||||
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return getCollection(id, tickets, sales, placements, myOptions);
|
||||
};
|
||||
|
||||
|
|
|
@ -1505,18 +1505,18 @@ INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk
|
|||
(9, '99610289193', 302, 2972, util.VN_CURDATE(), 3871, 442, 1),
|
||||
(10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 442, 1);
|
||||
|
||||
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`, `daysInForward`)
|
||||
VALUES (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1, NULL),
|
||||
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150.00, 2000, 'second travel', 2, 2, 2, NULL),
|
||||
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3, NULL),
|
||||
(4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2, 4, NULL),
|
||||
(5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1, 5, NULL),
|
||||
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6, NULL),
|
||||
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1, 7, 2),
|
||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10, NULL),
|
||||
(10, DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), 5, 1, 1, 50.00, 500, 'nineth travel', 1, 2, 10, 2),
|
||||
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, NULL),
|
||||
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, NULL);
|
||||
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`, `isRaid`, `daysInForward`)
|
||||
VALUES (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1, FALSE, NULL),
|
||||
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150.00, 2000, 'second travel', 2, 2, 2, FALSE, NULL),
|
||||
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3, FALSE, NULL),
|
||||
(4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2, 4, FALSE, NULL),
|
||||
(5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1, 5, FALSE, NULL),
|
||||
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6, FALSE, NULL),
|
||||
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1, 7, TRUE, 2),
|
||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10, FALSE, NULL),
|
||||
(10, DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), 5, 1, 1, 50.00, 500, 'nineth travel', 1, 2, 10, TRUE, 2),
|
||||
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL),
|
||||
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL);
|
||||
|
||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`)
|
||||
VALUES
|
||||
|
|
|
@ -53,7 +53,7 @@ proc: BEGIN
|
|||
WHERE t.landed BETWEEN vInventoryDate AND vStartDate
|
||||
AND t.warehouseInFk = vWarehouse
|
||||
AND s.name != 'INVENTARIO'
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
GROUP BY b.itemFk
|
||||
) c
|
||||
JOIN vn.item i ON i.id = c.itemFk
|
||||
|
|
|
@ -14,7 +14,7 @@ BEGIN
|
|||
b.stickers = NEW.NumberOfUnits
|
||||
WHERE i.supplyResponseFk = NEW.ID
|
||||
AND am.name = 'LOGIFLORA'
|
||||
AND tr.daysInForward
|
||||
AND tr.isRaid
|
||||
AND tr.landed >= util.VN_CURDATE();
|
||||
|
||||
END$$
|
||||
|
|
|
@ -59,7 +59,7 @@ BEGIN
|
|||
JOIN vn.travel t ON t.id = e.travelFk
|
||||
WHERE t.landed BETWEEN vDateInv AND vDate
|
||||
AND t.warehouseInFk = vWarehouse
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
UNION ALL
|
||||
SELECT b.itemFk, -b.quantity
|
||||
FROM vn.buy b
|
||||
|
@ -67,7 +67,7 @@ BEGIN
|
|||
JOIN vn.travel t ON t.id = e.travelFk
|
||||
WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE()
|
||||
AND t.warehouseOutFk = vWarehouse
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
AND t.isDelivered
|
||||
UNION ALL
|
||||
SELECT m.itemFk, -m.quantity
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
e.id entryFk,
|
||||
t.id travelFk,
|
||||
b.itemFk,
|
||||
t.daysInForward,
|
||||
t.isRaid,
|
||||
ADDTIME(t.shipped,
|
||||
IFNULL(t.shipmentHour, '00:00:00')) shipped,
|
||||
t.warehouseOutFk,
|
||||
|
@ -50,7 +50,7 @@ BEGIN
|
|||
itemFk,
|
||||
TIMESTAMPADD(DAY, life, @dated),
|
||||
quantity,
|
||||
IF(isIn, isReceived, isDelivered) AND NOT daysInForward
|
||||
IF(isIn, isReceived, isDelivered) AND NOT isRaid
|
||||
FROM tValues
|
||||
WHERE isIn OR !lessThanInventory;
|
||||
|
||||
|
@ -65,7 +65,7 @@ BEGIN
|
|||
itemFk,
|
||||
created,
|
||||
quantity,
|
||||
IF(isIn, isDelivered, isReceived) AND NOT daysInForward
|
||||
IF(isIn, isDelivered, isReceived) AND NOT isRaid
|
||||
FROM tValues
|
||||
WHERE !isIn OR !lessThanInventory;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ BEGIN
|
|||
AND vWarehouseFk IN (tr.warehouseInFk, 0)
|
||||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
UNION ALL
|
||||
SELECT tr.shipped,
|
||||
NULL,
|
||||
|
@ -58,7 +58,7 @@ BEGIN
|
|||
AND s.id <> (SELECT supplierFk FROM inventoryConfig)
|
||||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
UNION ALL
|
||||
SELECT t.shipped,
|
||||
NULL,
|
||||
|
|
|
@ -42,7 +42,7 @@ proc: BEGIN
|
|||
WHERE t.landed BETWEEN vDatedInventory AND vDatedFrom
|
||||
AND t.warehouseInFk = vWarehouseLanding
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
GROUP BY c.itemFk;
|
||||
|
||||
-- Tabla con el ultimo dia de last_buy para cada producto
|
||||
|
@ -57,7 +57,7 @@ proc: BEGIN
|
|||
JOIN travel tr ON tr.id = e.travelFk
|
||||
LEFT JOIN tItemRange i ON t.itemFk = i.itemFk
|
||||
WHERE t.warehouseFk = vWarehouseShipment
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
ON DUPLICATE KEY UPDATE tItemRange.dated = GREATEST(tItemRange.dated,
|
||||
tr.landed);
|
||||
|
||||
|
@ -94,7 +94,7 @@ proc: BEGIN
|
|||
JOIN tItemRangeLive ir ON ir.itemFk = b.itemFk
|
||||
WHERE NOT e.isExcludedFromAvailable
|
||||
AND b.quantity <> 0
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
AND t.warehouseInFk = vWarehouseLanding
|
||||
AND t.landed >= vDatedFrom
|
||||
AND (ir.dated IS NULL OR t.landed <= ir.dated)
|
||||
|
|
|
@ -166,7 +166,7 @@ BEGIN
|
|||
LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id
|
||||
LEFT JOIN buy b3 ON b3.id = bufi.buyFk
|
||||
WHERE ic.display
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
AND (ti.visible OR ti.available)
|
||||
ORDER BY i.typeFk, i.name, i.id, i.size, i.category, o.name;
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ BEGIN
|
|||
JOIN travel tr ON tr.id = e.travelFk
|
||||
WHERE tr.warehouseInFk = vWarehouseFk
|
||||
AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
GROUP BY b.itemFk;
|
||||
|
||||
-- Transfers
|
||||
|
@ -150,7 +150,7 @@ BEGIN
|
|||
JOIN travel tr ON tr.id = e.travelFk
|
||||
WHERE tr.warehouseOutFk = vWarehouseFk
|
||||
AND tr.shipped BETWEEN vDateLastInventory AND vDateYesterday
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
GROUP BY b.itemFk
|
||||
) sub
|
||||
ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut;
|
||||
|
|
|
@ -48,7 +48,7 @@ BEGIN
|
|||
iss.itemShelvingFk,
|
||||
SUM(IFNULL(iss.quantity,0)),
|
||||
IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED'),
|
||||
ish.shelvingFk
|
||||
sh.code
|
||||
INTO vItemFk,
|
||||
vSaleFk,
|
||||
vItemShelvingFk,
|
||||
|
@ -58,7 +58,8 @@ BEGIN
|
|||
FROM itemShelvingSale iss
|
||||
JOIN sale s ON s.id = iss.saleFk
|
||||
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = iss.saleFk
|
||||
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = iss.saleFk
|
||||
LEFT JOIN shelving sh ON sh.id = ish.shelvingFk
|
||||
WHERE iss.id = vItemShelvingSaleFk
|
||||
AND NOT iss.isPicked;
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ BEGIN
|
|||
ish.isChecked,
|
||||
ic.url,
|
||||
ish.available,
|
||||
ish.buyFk
|
||||
ish.buyFk,
|
||||
ish.shelvingFk
|
||||
FROM itemShelving ish
|
||||
JOIN item i ON i.id = ish.itemFk
|
||||
JOIN shelving s ON s.id = ish.shelvingFk
|
||||
|
|
|
@ -59,7 +59,7 @@ BEGIN
|
|||
AND (s.id <> vSupplierInventoryFk OR vDated IS NULL)
|
||||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
),
|
||||
entriesOut AS (
|
||||
SELECT 'entry',
|
||||
|
@ -95,7 +95,7 @@ BEGIN
|
|||
AND b.itemFk = vItemFk
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT w.isFeedStock
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
),
|
||||
sales AS (
|
||||
WITH itemSales AS (
|
||||
|
|
|
@ -63,7 +63,7 @@ BEGIN
|
|||
AND NOT e.isExcludedFromAvailable
|
||||
AND b.quantity <> 0
|
||||
AND (vItemFk IS NULL OR b.itemFk = vItemFk)
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
UNION ALL
|
||||
SELECT r.itemFk,
|
||||
r.shipment,
|
||||
|
|
|
@ -30,7 +30,7 @@ BEGIN
|
|||
AND NOT s.name = 'INVENTARIO'
|
||||
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
|
||||
AND w.isComparative
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
GROUP BY i.id;
|
||||
|
||||
UPDATE tmp.itemInventory y
|
||||
|
|
|
@ -109,7 +109,7 @@ BEGIN
|
|||
JOIN warehouse w ON w.id = tr.warehouseInFk
|
||||
WHERE tr.landed BETWEEN vInventoried AND vDateDayEnd
|
||||
AND IF(tr.landed = util.VN_CURDATE(), tr.isReceived, TRUE)
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
AND w.valuatedInventory
|
||||
AND t.isInventory
|
||||
AND e.supplierFk <> vInventorySupplierFk
|
||||
|
@ -131,7 +131,7 @@ BEGIN
|
|||
JOIN itemCategory ic ON ic.id = t.categoryFk
|
||||
JOIN warehouse w ON w.id = tr.warehouseOutFk
|
||||
WHERE tr.shipped BETWEEN vInventoried AND vDateDayEnd
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
AND w.valuatedInventory
|
||||
AND t.isInventory
|
||||
AND (t.id = vItemTypeFk OR vItemTypeFk IS NULL)
|
||||
|
@ -196,7 +196,7 @@ BEGIN
|
|||
JOIN warehouse wIn ON wIn.id = tr.warehouseInFk
|
||||
JOIN warehouse wOut ON wOut.id = tr.warehouseOutFk
|
||||
WHERE vDated >= tr.shipped AND vDated < tr.landed
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
AND wIn.valuatedInventory
|
||||
AND t.isInventory
|
||||
AND e.isConfirmed
|
||||
|
|
|
@ -60,7 +60,7 @@ proc: BEGIN
|
|||
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
|
||||
AND w.isComparative
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
UNION ALL
|
||||
SELECT b.itemFk, - b.quantity
|
||||
FROM buy b
|
||||
|
@ -71,7 +71,7 @@ proc: BEGIN
|
|||
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
|
||||
AND w.isComparative
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
) sub
|
||||
GROUP BY itemFk;
|
||||
|
||||
|
@ -121,7 +121,7 @@ proc: BEGIN
|
|||
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
|
||||
AND w.isComparative
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
UNION ALL
|
||||
SELECT b.itemFk, t.shipped, - b.quantity
|
||||
FROM buy b
|
||||
|
@ -132,7 +132,7 @@ proc: BEGIN
|
|||
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
|
||||
AND w.isComparative
|
||||
AND NOT e.isExcludedFromAvailable
|
||||
AND NOT t.daysInForward
|
||||
AND NOT t.isRaid
|
||||
) sub
|
||||
GROUP BY sub.itemFk, sub.dated;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ BEGIN
|
|||
JOIN vn.entry e ON e.travelFk = tr.id
|
||||
JOIN vn.buy b ON b.entryFk = e.id
|
||||
WHERE tr.landed BETWEEN vFromDated AND vToDated
|
||||
AND NOT tr.daysInForward
|
||||
AND NOT tr.isRaid
|
||||
AND tr.warehouseInFk = vWarehouseFk
|
||||
GROUP BY tr.landed , a.name ;
|
||||
END$$
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkRaid`(
|
||||
vIsRaid BOOL,
|
||||
vDaysInForward INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Check if the values of isRaid and daysInforward are correct
|
||||
*
|
||||
* @param vIsRaid idRaid value
|
||||
* @param vDaysInForward daysInForward value
|
||||
*/
|
||||
IF (NOT vIsRaid AND vDaysInForward IS NOT NULL) OR (vIsRaid AND vDaysInForward IS NULL) THEN
|
||||
CALL util.throw('The raid information is not correct');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -37,7 +37,8 @@ BEGIN
|
|||
SELECT id travelFk,
|
||||
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded
|
||||
FROM travel
|
||||
WHERE daysInForward;
|
||||
WHERE isRaid
|
||||
AND daysInForward;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`entry_beforeUpdate`
|
|||
BEFORE UPDATE ON `entry`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE vDaysInForward INT;
|
||||
DECLARE vIsRaid BOOL;
|
||||
DECLARE vPrintedCount INT;
|
||||
DECLARE vHasDistinctWarehouses BOOL;
|
||||
DECLARE vTotalBuy INT;
|
||||
|
@ -38,7 +38,7 @@ BEGIN
|
|||
CALL travel_throwAwb(NEW.travelFk);
|
||||
END IF;
|
||||
|
||||
SELECT daysInForward INTO vDaysInForward
|
||||
SELECT isRaid INTO vIsRaid
|
||||
FROM travel t
|
||||
JOIN entry e ON e.travelFk = t.id
|
||||
WHERE entryFk = NEW.id;
|
||||
|
@ -50,7 +50,7 @@ BEGIN
|
|||
WHERE o.id = OLD.travelFk
|
||||
AND n.id = NEW.travelFk;
|
||||
|
||||
IF vDaysInForward AND vHasDistinctWarehouses THEN
|
||||
IF vIsRaid AND vHasDistinctWarehouses THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses';
|
||||
END IF;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`town_beforeUpdate`
|
||||
BEFORE UPDATE ON `town`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
-- IF !(OLD.geoFk <=> NEW.geoFk) THEN
|
||||
-- CALL zoneGeo_throwNotEditable;
|
||||
-- END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -9,6 +9,10 @@ BEGIN
|
|||
|
||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
|
||||
IF NEW.isRaid IS NOT NULL OR NEW.daysInForward IS NOT NULL THEN
|
||||
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
||||
END IF;
|
||||
|
||||
IF NEW.awbFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.id);
|
||||
END IF;
|
||||
|
|
|
@ -20,6 +20,10 @@ BEGIN
|
|||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
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
|
||||
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||
FROM travel t
|
||||
|
|
|
@ -6,7 +6,7 @@ AS SELECT `t`.`warehouseInFk` AS `warehouseInFk`,
|
|||
`b`.`itemFk` AS `itemFk`,
|
||||
`b`.`quantity` AS `quantity`,
|
||||
`t`.`isReceived` AS `isReceived`,
|
||||
`t`.`daysInForward` AS `isVirtualStock`,
|
||||
`t`.`isRaid` AS `isVirtualStock`,
|
||||
`e`.`id` AS `entryFk`
|
||||
FROM (
|
||||
(
|
||||
|
|
|
@ -15,5 +15,5 @@ FROM (
|
|||
JOIN `vn`.`travel` `t` ON(`e`.`travelFk` = `t`.`id`)
|
||||
)
|
||||
WHERE `e`.`isExcludedFromAvailable` = 0
|
||||
AND NOT `t`.`daysInForward`
|
||||
AND NOT `t`.`isRaid`
|
||||
AND `b`.`quantity` <> 0
|
||||
|
|
|
@ -31,5 +31,5 @@ FROM (
|
|||
LEFT JOIN `edi`.`ekt` `ek` ON(`ek`.`id` = `b`.`ektFk`)
|
||||
)
|
||||
WHERE `tr`.`landed` BETWEEN `util`.`yesterday`() AND `util`.`tomorrow`()
|
||||
AND NOT `tr`.`daysInForward`
|
||||
AND NOT `tr`.`isRaid`
|
||||
AND `b`.`stickers` > 0
|
||||
|
|
|
@ -8,6 +8,7 @@ AS SELECT `e`.`gestDocFk` AS `gestdoc_id`,
|
|||
`e`.`isExcludedFromAvailable` AS `Inventario`,
|
||||
`e`.`isConfirmed` AS `Confirmada`,
|
||||
`e`.`isOrdered` AS `Pedida`,
|
||||
`tr`.`isRaid` AS `isRaid`,
|
||||
`tr`.`daysInForward` AS `daysInForward`,
|
||||
`e`.`evaNotes` AS `notas`,
|
||||
`e`.`supplierFk` AS `Id_Proveedor`,
|
||||
|
|
|
@ -18,5 +18,6 @@ AS SELECT `t`.`id` AS `id`,
|
|||
`t`.`totalEntries` AS `totalEntries`,
|
||||
`t`.`appointment` AS `appointment`,
|
||||
`t`.`awbFk` AS `awbFk`,
|
||||
`t`.`isRaid` AS `isRaid`,
|
||||
`t`.`daysInForward` AS `daysInForward`
|
||||
FROM `vn`.`travel` `t`
|
||||
|
|
|
@ -86,4 +86,4 @@ FROM (
|
|||
)
|
||||
WHERE NOT `W_IN`.`isFeedStock`
|
||||
AND NOT `E`.`Inventario`
|
||||
AND NOT `TR`.`daysInForward`
|
||||
AND NOT `TR`.`isRaid`
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
-- Place your SQL code here
|
||||
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
|
||||
VALUES ('https://verdnatura.saysimple.io/start-conversation', 1320);
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE vn.travel ADD IF NOT EXISTS isRaid tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Redada';
|
||||
|
||||
ALTER TABLE vn.travel MODIFY COLUMN daysInForward int(10) unsigned DEFAULT NULL
|
||||
COMMENT 'Cuando es una redada, indica el número de días que se añadirán a la fecha de hoy para establecer el landed. NULL si no es una redada';
|
|
@ -223,7 +223,6 @@
|
|||
"Shelving not valid": "Shelving not valid",
|
||||
"printerNotExists": "The printer does not exist",
|
||||
"There are not picking tickets": "There are not picking tickets",
|
||||
"ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)",
|
||||
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves",
|
||||
"They're not your subordinate": "They're not your subordinate",
|
||||
"InvoiceIn is already booked": "InvoiceIn is already booked",
|
||||
|
@ -245,6 +244,7 @@
|
|||
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
|
||||
"Invalid or expired verification code": "Invalid or expired verification code",
|
||||
"Payment method is required": "Payment method is required",
|
||||
"The raid information is not correct": "The raid information is not correct",
|
||||
"Sales already moved": "Sales already moved"
|
||||
|
||||
}
|
||||
|
|
|
@ -359,7 +359,6 @@
|
|||
"This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia",
|
||||
"Select ticket or client": "Elija un ticket o un client",
|
||||
"It was not able to create the invoice": "No se pudo crear la factura",
|
||||
"ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)",
|
||||
"Incoterms and Customs agent are required for a non UEE member": "Se requieren Incoterms y agente de aduanas para un no miembro de la UEE",
|
||||
"You can not use the same password": "No puedes usar la misma contraseña",
|
||||
"This PDA is already assigned to another user": "Este PDA ya está asignado a otro usuario",
|
||||
|
@ -388,5 +387,6 @@
|
|||
"There is no company associated with that warehouse": "No hay ninguna empresa asociada a ese almacén",
|
||||
"ticketLostExpedition": "El ticket [{{ticketId}}]({{{ticketUrl}}}) tiene la siguiente expedición perdida:{{ expeditionId }}",
|
||||
"The web user's email already exists": "El correo del usuario web ya existe",
|
||||
"Sales already moved": "Ya han sido transferidas"
|
||||
"Sales already moved": "Ya han sido transferidas",
|
||||
"The raid information is not correct": "La información de la redada no es correcta"
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ columns:
|
|||
notes: notes
|
||||
isConfirmed: confirmed
|
||||
isVirtual: virtual
|
||||
isRaid: raid
|
||||
commission: commission
|
||||
isOrdered: price3
|
||||
created: created
|
||||
|
|
|
@ -9,6 +9,7 @@ columns:
|
|||
notes: notas
|
||||
isConfirmed: confirmado
|
||||
isVirtual: virtual
|
||||
isRaid: redada
|
||||
commission: comisión
|
||||
isOrdered: pedida
|
||||
created: creado
|
||||
|
|
|
@ -194,6 +194,7 @@ module.exports = Self => {
|
|||
e.evaNotes observation,
|
||||
e.isConfirmed,
|
||||
e.isOrdered,
|
||||
t.isRaid,
|
||||
t.daysInForward,
|
||||
e.commission,
|
||||
e.created,
|
||||
|
|
|
@ -49,8 +49,8 @@ module.exports = Self => {
|
|||
'isReceived',
|
||||
'isDelivered',
|
||||
'ref',
|
||||
'daysInForward',
|
||||
],
|
||||
'isRaid',
|
||||
'daysInForward'],
|
||||
include: [
|
||||
{
|
||||
relation: 'agency',
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<vn-icon
|
||||
vn-tooltip="Is virtual entry"
|
||||
icon="icon-net"
|
||||
ng-if="$ctrl.entryData.travel.daysInForward">
|
||||
ng-if="$ctrl.entryData.travel.isRaid">
|
||||
</vn-icon>
|
||||
</div>
|
||||
<div class="quicklinks">
|
||||
|
|
|
@ -86,7 +86,7 @@ auto-load="true">
|
|||
</vn-check>
|
||||
<vn-check
|
||||
label="Raid"
|
||||
ng-model="$ctrl.entryData.travel.daysInForward"
|
||||
ng-model="$ctrl.entryData.travel.isRaid"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
<vn-check
|
||||
|
|
|
@ -155,6 +155,7 @@ module.exports = Self => {
|
|||
t.cargoSupplierFk,
|
||||
t.totalEntries,
|
||||
t.daysInForward,
|
||||
t.isRaid,
|
||||
am.name agencyModeName,
|
||||
win.name warehouseInName,
|
||||
wout.name warehouseOutName,
|
||||
|
|
|
@ -51,6 +51,9 @@
|
|||
"landingHour": {
|
||||
"type": "string"
|
||||
},
|
||||
"isRaid": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"daysInForward": {
|
||||
"type": "number"
|
||||
}
|
||||
|
|
|
@ -40,8 +40,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const filter = {
|
||||
where: {
|
||||
zoneFk: id,
|
||||
shipped: {gte: today}
|
||||
zoneFk: id
|
||||
},
|
||||
include: {
|
||||
relation: 'ticketState',
|
||||
|
|
Loading…
Reference in New Issue