Compare commits

...

23 Commits

Author SHA1 Message Date
Pablo Natek 5e52b3b596 Merge branch 'dev' into 8138-feat-reduce-credit-on-risk
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-20 06:46:46 +00:00
Carlos Andrés ad345a0b91 Merge pull request 'feat: refs#8087 Redadas en travel' (!3177) from 8087-nuevosCamposTravel into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3177
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-19 16:57:15 +00:00
Alex Moreno 46148d7ba3 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 14:09:58 +01:00
Alex Moreno 033e269a5d Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/pr-dev This commit looks good Details
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 14:09:46 +01:00
Carlos Andrés 63c0747304 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8087-nuevosCamposTravel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-19 13:52:12 +01:00
Carlos Andrés 953bc84a58 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-19 13:49:02 +01:00
Carlos Andrés 6a43d3c752 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-19 13:40:12 +01:00
Jorge Penadés 2335b57e05 Merge pull request '#7323 add remaining fields' (!3220) from 7323-warfix-addRemainingFields into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3220
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-19 12:37:24 +00:00
Jorge Penadés c31fa7e9cf Merge branch 'test' into 7323-warfix-addRemainingFields
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 12:33:01 +00:00
Alex Moreno 60734136c3 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 13:28:53 +01:00
Sergio De la torre f192b92c6a Merge pull request 'feat: refs #8099 refs#8099 addComplmentSalary' (!3219) from 8099-addComplementSalary into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
Reviewed-on: #3219
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-19 12:25:47 +00:00
Robert Ferrús b29053e850 Merge pull request 'feat: refs #8211 route_afterUpdate' (!3218) from 8211-hotFixRoute_afterUpdate into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3218
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2024-11-19 11:05:30 +00:00
Jorge Penadés f89080d373 fix: refs #7323 add remaining fields
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:53:12 +01:00
Sergio De la torre feb11c123e feat: refs #8099 refs#8099 addComplmentSalary
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:45:40 +01:00
Sergio De la torre d21b42a567 feat: refs #8099 refs#8099 addComplmentSalary
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:24:00 +01:00
Robert Ferrús 7b5e474d24 feat: refs #8211 route_afterUpdate
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-19 11:15:57 +01:00
Alex Moreno 6a65ab42ce build: change package version
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 09:12:42 +01:00
Alex Moreno 562d3b0f70 Merge pull request '8144-devToTest_2448' (!3216) from 8144-devToTest_2448 into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3216
Reviewed-by: Carlos Satorres <carlossa@verdnatura.es>
2024-11-19 07:36:02 +00:00
Alex Moreno 413e9e1e9f build: refs #8144 change package version
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 07:59:27 +01:00
Carlos Andrés b8f2e0b906 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-12 16:50:46 +01:00
Carlos Andrés 358ed2513d feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-12 16:26:30 +01:00
Carlos Andrés 69d6e4a104 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8087-nuevosCamposTravel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-12 16:24:05 +01:00
Carlos Andrés cf102699d5 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-11 14:19:11 +01:00
46 changed files with 230 additions and 89 deletions

View File

@ -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), (9, '99610289193', 302, 2972, util.VN_CURDATE(), 3871, 442, 1),
(10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 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`) 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, NULL), 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, 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, 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, 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, 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, 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, 2), (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, NULL), (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, 2), (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, NULL), (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, 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`) INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`)
VALUES VALUES
@ -4008,6 +4008,10 @@ INSERT IGNORE INTO pbx.queueMember
UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA"; UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA";
UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS"; UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS";
INSERT INTO vn.routeAction (id, name, price, isMainlineDelivered) VALUES(1, 'Pintar traje', 50.00, 0);
INSERT INTO vn.routeComplement (id, dated, workerFk, price, routeActionFk) VALUES(1, util.VN_CURDATE(), 9, 50.00, 1);
INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk) INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk)
VALUES (0, 0, 0, 0, NULL, 3, 1, 0, 'ENT', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), VALUES (0, 0, 0, 0, NULL, 3, 1, 0, 'ENT', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(1, 0, 9900, 0, NULL, 1, 0, 0, 'NOK', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), (1, 0, 9900, 0, NULL, 1, 0, 0, 'NOK', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),

View File

@ -53,7 +53,7 @@ proc: BEGIN
WHERE t.landed BETWEEN vInventoryDate AND vStartDate WHERE t.landed BETWEEN vInventoryDate AND vStartDate
AND t.warehouseInFk = vWarehouse AND t.warehouseInFk = vWarehouse
AND s.name != 'INVENTARIO' AND s.name != 'INVENTARIO'
AND NOT t.daysInForward AND NOT t.isRaid
GROUP BY b.itemFk GROUP BY b.itemFk
) c ) c
JOIN vn.item i ON i.id = c.itemFk JOIN vn.item i ON i.id = c.itemFk

View File

@ -14,7 +14,7 @@ BEGIN
b.stickers = NEW.NumberOfUnits b.stickers = NEW.NumberOfUnits
WHERE i.supplyResponseFk = NEW.ID WHERE i.supplyResponseFk = NEW.ID
AND am.name = 'LOGIFLORA' AND am.name = 'LOGIFLORA'
AND tr.daysInForward AND tr.isRaid
AND tr.landed >= util.VN_CURDATE(); AND tr.landed >= util.VN_CURDATE();
END$$ END$$

View File

@ -59,7 +59,7 @@ BEGIN
JOIN vn.travel t ON t.id = e.travelFk JOIN vn.travel t ON t.id = e.travelFk
WHERE t.landed BETWEEN vDateInv AND vDate WHERE t.landed BETWEEN vDateInv AND vDate
AND t.warehouseInFk = vWarehouse AND t.warehouseInFk = vWarehouse
AND NOT t.daysInForward AND NOT t.isRaid
UNION ALL UNION ALL
SELECT b.itemFk, -b.quantity SELECT b.itemFk, -b.quantity
FROM vn.buy b FROM vn.buy b
@ -67,7 +67,7 @@ BEGIN
JOIN vn.travel t ON t.id = e.travelFk JOIN vn.travel t ON t.id = e.travelFk
WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE() WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE()
AND t.warehouseOutFk = vWarehouse AND t.warehouseOutFk = vWarehouse
AND NOT t.daysInForward AND NOT t.isRaid
AND t.isDelivered AND t.isDelivered
UNION ALL UNION ALL
SELECT m.itemFk, -m.quantity SELECT m.itemFk, -m.quantity

View File

@ -6,12 +6,11 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tValues; DROP TEMPORARY TABLE IF EXISTS tValues;
CREATE TEMPORARY TABLE tValues CREATE TEMPORARY TABLE tValues
ENGINE = MEMORY ENGINE = MEMORY
SELECT SELECT b.id buyFk,
b.id buyFk,
e.id entryFk, e.id entryFk,
t.id travelFk, t.id travelFk,
b.itemFk, b.itemFk,
t.daysInForward, t.isRaid,
ADDTIME(t.shipped, ADDTIME(t.shipped,
IFNULL(t.shipmentHour, '00:00:00')) shipped, IFNULL(t.shipmentHour, '00:00:00')) shipped,
t.warehouseOutFk, t.warehouseOutFk,
@ -50,7 +49,7 @@ BEGIN
itemFk, itemFk,
TIMESTAMPADD(DAY, life, @dated), TIMESTAMPADD(DAY, life, @dated),
quantity, quantity,
IF(isIn, isReceived, isDelivered) AND NOT daysInForward IF(isIn, isReceived, isDelivered) AND NOT isRaid
FROM tValues FROM tValues
WHERE isIn OR !lessThanInventory; WHERE isIn OR !lessThanInventory;
@ -65,7 +64,7 @@ BEGIN
itemFk, itemFk,
created, created,
quantity, quantity,
IF(isIn, isDelivered, isReceived) AND NOT daysInForward IF(isIn, isDelivered, isReceived) AND NOT isRaid
FROM tValues FROM tValues
WHERE !isIn OR !lessThanInventory; WHERE !isIn OR !lessThanInventory;

View File

@ -39,7 +39,7 @@ BEGIN
AND vWarehouseFk IN (tr.warehouseInFk, 0) AND vWarehouseFk IN (tr.warehouseInFk, 0)
AND b.itemFk = vItemFk AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward AND NOT tr.isRaid
UNION ALL UNION ALL
SELECT tr.shipped, SELECT tr.shipped,
NULL, NULL,
@ -58,7 +58,7 @@ BEGIN
AND s.id <> (SELECT supplierFk FROM inventoryConfig) AND s.id <> (SELECT supplierFk FROM inventoryConfig)
AND b.itemFk = vItemFk AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward AND NOT tr.isRaid
UNION ALL UNION ALL
SELECT t.shipped, SELECT t.shipped,
NULL, NULL,

View File

@ -42,7 +42,7 @@ proc: BEGIN
WHERE t.landed BETWEEN vDatedInventory AND vDatedFrom WHERE t.landed BETWEEN vDatedInventory AND vDatedFrom
AND t.warehouseInFk = vWarehouseLanding AND t.warehouseInFk = vWarehouseLanding
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward AND NOT t.isRaid
GROUP BY c.itemFk; GROUP BY c.itemFk;
-- Tabla con el ultimo dia de last_buy para cada producto -- 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 JOIN travel tr ON tr.id = e.travelFk
LEFT JOIN tItemRange i ON t.itemFk = i.itemFk LEFT JOIN tItemRange i ON t.itemFk = i.itemFk
WHERE t.warehouseFk = vWarehouseShipment WHERE t.warehouseFk = vWarehouseShipment
AND NOT tr.daysInForward AND NOT tr.isRaid
ON DUPLICATE KEY UPDATE tItemRange.dated = GREATEST(tItemRange.dated, ON DUPLICATE KEY UPDATE tItemRange.dated = GREATEST(tItemRange.dated,
tr.landed); tr.landed);
@ -94,7 +94,7 @@ proc: BEGIN
JOIN tItemRangeLive ir ON ir.itemFk = b.itemFk JOIN tItemRangeLive ir ON ir.itemFk = b.itemFk
WHERE NOT e.isExcludedFromAvailable WHERE NOT e.isExcludedFromAvailable
AND b.quantity <> 0 AND b.quantity <> 0
AND NOT t.daysInForward AND NOT t.isRaid
AND t.warehouseInFk = vWarehouseLanding AND t.warehouseInFk = vWarehouseLanding
AND t.landed >= vDatedFrom AND t.landed >= vDatedFrom
AND (ir.dated IS NULL OR t.landed <= ir.dated) AND (ir.dated IS NULL OR t.landed <= ir.dated)

View File

@ -166,7 +166,7 @@ BEGIN
LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id
LEFT JOIN buy b3 ON b3.id = bufi.buyFk LEFT JOIN buy b3 ON b3.id = bufi.buyFk
WHERE ic.display WHERE ic.display
AND NOT tr.daysInForward AND NOT tr.isRaid
AND (ti.visible OR ti.available) AND (ti.visible OR ti.available)
ORDER BY i.typeFk, i.name, i.id, i.size, i.category, o.name; ORDER BY i.typeFk, i.name, i.id, i.size, i.category, o.name;

View File

@ -137,7 +137,7 @@ BEGIN
JOIN travel tr ON tr.id = e.travelFk JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseInFk = vWarehouseFk WHERE tr.warehouseInFk = vWarehouseFk
AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday
AND NOT tr.daysInForward AND NOT tr.isRaid
GROUP BY b.itemFk; GROUP BY b.itemFk;
-- Transfers -- Transfers
@ -150,7 +150,7 @@ BEGIN
JOIN travel tr ON tr.id = e.travelFk JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseOutFk = vWarehouseFk WHERE tr.warehouseOutFk = vWarehouseFk
AND tr.shipped BETWEEN vDateLastInventory AND vDateYesterday AND tr.shipped BETWEEN vDateLastInventory AND vDateYesterday
AND NOT tr.daysInForward AND NOT tr.isRaid
GROUP BY b.itemFk GROUP BY b.itemFk
) sub ) sub
ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut; ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut;

View File

@ -59,7 +59,7 @@ BEGIN
AND (s.id <> vSupplierInventoryFk OR vDated IS NULL) AND (s.id <> vSupplierInventoryFk OR vDated IS NULL)
AND b.itemFk = vItemFk AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward AND NOT tr.isRaid
), ),
entriesOut AS ( entriesOut AS (
SELECT 'entry', SELECT 'entry',
@ -95,7 +95,7 @@ BEGIN
AND b.itemFk = vItemFk AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT w.isFeedStock AND NOT w.isFeedStock
AND NOT tr.daysInForward AND NOT tr.isRaid
), ),
sales AS ( sales AS (
WITH itemSales AS ( WITH itemSales AS (

View File

@ -63,7 +63,7 @@ BEGIN
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND b.quantity <> 0 AND b.quantity <> 0
AND (vItemFk IS NULL OR b.itemFk = vItemFk) AND (vItemFk IS NULL OR b.itemFk = vItemFk)
AND NOT t.daysInForward AND NOT t.isRaid
UNION ALL UNION ALL
SELECT r.itemFk, SELECT r.itemFk,
r.shipment, r.shipment,

View File

@ -30,7 +30,7 @@ BEGIN
AND NOT s.name = 'INVENTARIO' AND NOT s.name = 'INVENTARIO'
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk) AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
AND w.isComparative AND w.isComparative
AND NOT t.daysInForward AND NOT t.isRaid
GROUP BY i.id; GROUP BY i.id;
UPDATE tmp.itemInventory y UPDATE tmp.itemInventory y

View File

@ -109,7 +109,7 @@ BEGIN
JOIN warehouse w ON w.id = tr.warehouseInFk JOIN warehouse w ON w.id = tr.warehouseInFk
WHERE tr.landed BETWEEN vInventoried AND vDateDayEnd WHERE tr.landed BETWEEN vInventoried AND vDateDayEnd
AND IF(tr.landed = util.VN_CURDATE(), tr.isReceived, TRUE) AND IF(tr.landed = util.VN_CURDATE(), tr.isReceived, TRUE)
AND NOT tr.daysInForward AND NOT tr.isRaid
AND w.valuatedInventory AND w.valuatedInventory
AND t.isInventory AND t.isInventory
AND e.supplierFk <> vInventorySupplierFk AND e.supplierFk <> vInventorySupplierFk
@ -131,7 +131,7 @@ BEGIN
JOIN itemCategory ic ON ic.id = t.categoryFk JOIN itemCategory ic ON ic.id = t.categoryFk
JOIN warehouse w ON w.id = tr.warehouseOutFk JOIN warehouse w ON w.id = tr.warehouseOutFk
WHERE tr.shipped BETWEEN vInventoried AND vDateDayEnd WHERE tr.shipped BETWEEN vInventoried AND vDateDayEnd
AND NOT tr.daysInForward AND NOT tr.isRaid
AND w.valuatedInventory AND w.valuatedInventory
AND t.isInventory AND t.isInventory
AND (t.id = vItemTypeFk OR vItemTypeFk IS NULL) AND (t.id = vItemTypeFk OR vItemTypeFk IS NULL)
@ -196,7 +196,7 @@ BEGIN
JOIN warehouse wIn ON wIn.id = tr.warehouseInFk JOIN warehouse wIn ON wIn.id = tr.warehouseInFk
JOIN warehouse wOut ON wOut.id = tr.warehouseOutFk JOIN warehouse wOut ON wOut.id = tr.warehouseOutFk
WHERE vDated >= tr.shipped AND vDated < tr.landed WHERE vDated >= tr.shipped AND vDated < tr.landed
AND NOT tr.daysInForward AND NOT tr.isRaid
AND wIn.valuatedInventory AND wIn.valuatedInventory
AND t.isInventory AND t.isInventory
AND e.isConfirmed AND e.isConfirmed

View File

@ -60,7 +60,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
AND w.isComparative AND w.isComparative
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward AND NOT t.isRaid
UNION ALL UNION ALL
SELECT b.itemFk, - b.quantity SELECT b.itemFk, - b.quantity
FROM buy b FROM buy b
@ -71,7 +71,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
AND w.isComparative AND w.isComparative
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward AND NOT t.isRaid
) sub ) sub
GROUP BY itemFk; GROUP BY itemFk;
@ -121,7 +121,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
AND w.isComparative AND w.isComparative
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward AND NOT t.isRaid
UNION ALL UNION ALL
SELECT b.itemFk, t.shipped, - b.quantity SELECT b.itemFk, t.shipped, - b.quantity
FROM buy b FROM buy b
@ -132,7 +132,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
AND w.isComparative AND w.isComparative
AND NOT e.isExcludedFromAvailable AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward AND NOT t.isRaid
) sub ) sub
GROUP BY sub.itemFk, sub.dated; GROUP BY sub.itemFk, sub.dated;

View File

@ -10,7 +10,7 @@ BEGIN
JOIN vn.entry e ON e.travelFk = tr.id JOIN vn.entry e ON e.travelFk = tr.id
JOIN vn.buy b ON b.entryFk = e.id JOIN vn.buy b ON b.entryFk = e.id
WHERE tr.landed BETWEEN vFromDated AND vToDated WHERE tr.landed BETWEEN vFromDated AND vToDated
AND NOT tr.daysInForward AND NOT tr.isRaid
AND tr.warehouseInFk = vWarehouseFk AND tr.warehouseInFk = vWarehouseFk
GROUP BY tr.landed , a.name ; GROUP BY tr.landed , a.name ;
END$$ END$$

View File

@ -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 ;

View File

@ -37,7 +37,8 @@ BEGIN
SELECT id travelFk, SELECT id travelFk,
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded
FROM travel FROM travel
WHERE daysInForward; WHERE isRaid
AND daysInForward;
START TRANSACTION; START TRANSACTION;

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`entry_beforeUpdate`
BEFORE UPDATE ON `entry` BEFORE UPDATE ON `entry`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
DECLARE vDaysInForward INT; DECLARE vIsRaid BOOL;
DECLARE vPrintedCount INT; DECLARE vPrintedCount INT;
DECLARE vHasDistinctWarehouses BOOL; DECLARE vHasDistinctWarehouses BOOL;
DECLARE vTotalBuy INT; DECLARE vTotalBuy INT;
@ -38,7 +38,7 @@ BEGIN
CALL travel_throwAwb(NEW.travelFk); CALL travel_throwAwb(NEW.travelFk);
END IF; END IF;
SELECT daysInForward INTO vDaysInForward SELECT isRaid INTO vIsRaid
FROM travel t FROM travel t
JOIN entry e ON e.travelFk = t.id JOIN entry e ON e.travelFk = t.id
WHERE entryFk = NEW.id; WHERE entryFk = NEW.id;
@ -50,7 +50,7 @@ BEGIN
WHERE o.id = OLD.travelFk WHERE o.id = OLD.travelFk
AND n.id = NEW.travelFk; AND n.id = NEW.travelFk;
IF vDaysInForward AND vHasDistinctWarehouses THEN IF vIsRaid AND vHasDistinctWarehouses THEN
SIGNAL SQLSTATE '45000' SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses'; SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses';
END IF; END IF;

View File

@ -21,7 +21,8 @@ BEGIN
OR !(NEW.kmEnd <=> OLD.kmEnd) OR !(NEW.kmEnd <=> OLD.kmEnd)
OR !(NEW.workerFk <=> OLD.workerFk) OR !(NEW.workerFk <=> OLD.workerFk)
OR !(NEW.m3 <=> OLD.m3) OR !(NEW.m3 <=> OLD.m3)
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)THEN OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
CALL route_calcCommission(NEW.id); CALL route_calcCommission(NEW.id);
END IF; END IF;

View File

@ -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 ;

View File

@ -9,6 +9,10 @@ BEGIN
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk); 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 IF NEW.awbFk IS NOT NULL THEN
CALL travel_throwAwb(NEW.id); CALL travel_throwAwb(NEW.id);
END IF; END IF;

View File

@ -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

View File

@ -6,7 +6,7 @@ AS SELECT `t`.`warehouseInFk` AS `warehouseInFk`,
`b`.`itemFk` AS `itemFk`, `b`.`itemFk` AS `itemFk`,
`b`.`quantity` AS `quantity`, `b`.`quantity` AS `quantity`,
`t`.`isReceived` AS `isReceived`, `t`.`isReceived` AS `isReceived`,
`t`.`daysInForward` AS `isVirtualStock`, `t`.`isRaid` AS `isVirtualStock`,
`e`.`id` AS `entryFk` `e`.`id` AS `entryFk`
FROM ( FROM (
( (

View File

@ -15,5 +15,5 @@ FROM (
JOIN `vn`.`travel` `t` ON(`e`.`travelFk` = `t`.`id`) JOIN `vn`.`travel` `t` ON(`e`.`travelFk` = `t`.`id`)
) )
WHERE `e`.`isExcludedFromAvailable` = 0 WHERE `e`.`isExcludedFromAvailable` = 0
AND NOT `t`.`daysInForward` AND NOT `t`.`isRaid`
AND `b`.`quantity` <> 0 AND `b`.`quantity` <> 0

View File

@ -31,5 +31,5 @@ FROM (
LEFT JOIN `edi`.`ekt` `ek` ON(`ek`.`id` = `b`.`ektFk`) LEFT JOIN `edi`.`ekt` `ek` ON(`ek`.`id` = `b`.`ektFk`)
) )
WHERE `tr`.`landed` BETWEEN `util`.`yesterday`() AND `util`.`tomorrow`() WHERE `tr`.`landed` BETWEEN `util`.`yesterday`() AND `util`.`tomorrow`()
AND NOT `tr`.`daysInForward` AND NOT `tr`.`isRaid`
AND `b`.`stickers` > 0 AND `b`.`stickers` > 0

View File

@ -8,6 +8,7 @@ AS SELECT `e`.`gestDocFk` AS `gestdoc_id`,
`e`.`isExcludedFromAvailable` AS `Inventario`, `e`.`isExcludedFromAvailable` AS `Inventario`,
`e`.`isConfirmed` AS `Confirmada`, `e`.`isConfirmed` AS `Confirmada`,
`e`.`isOrdered` AS `Pedida`, `e`.`isOrdered` AS `Pedida`,
`tr`.`isRaid` AS `isRaid`,
`tr`.`daysInForward` AS `daysInForward`, `tr`.`daysInForward` AS `daysInForward`,
`e`.`evaNotes` AS `notas`, `e`.`evaNotes` AS `notas`,
`e`.`supplierFk` AS `Id_Proveedor`, `e`.`supplierFk` AS `Id_Proveedor`,

View File

@ -18,5 +18,6 @@ AS SELECT `t`.`id` AS `id`,
`t`.`totalEntries` AS `totalEntries`, `t`.`totalEntries` AS `totalEntries`,
`t`.`appointment` AS `appointment`, `t`.`appointment` AS `appointment`,
`t`.`awbFk` AS `awbFk`, `t`.`awbFk` AS `awbFk`,
`t`.`isRaid` AS `isRaid`,
`t`.`daysInForward` AS `daysInForward` `t`.`daysInForward` AS `daysInForward`
FROM `vn`.`travel` `t` FROM `vn`.`travel` `t`

View File

@ -86,4 +86,4 @@ FROM (
) )
WHERE NOT `W_IN`.`isFeedStock` WHERE NOT `W_IN`.`isFeedStock`
AND NOT `E`.`Inventario` AND NOT `E`.`Inventario`
AND NOT `TR`.`daysInForward` AND NOT `TR`.`isRaid`

View File

@ -0,0 +1,4 @@
ALTER TABLE vn.travel ADD 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';

View File

@ -0,0 +1,5 @@
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';

View File

@ -0,0 +1,15 @@
USE vn;
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteAction', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'create', 'WRITE', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'delivery');

View File

@ -245,6 +245,7 @@
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first", "There are tickets for this area, delete them first": "There are tickets for this area, delete them first",
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}", "ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
"Payment method is required": "Payment method is required", "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" "Sales already moved": "Sales already moved"
} }

View File

@ -388,5 +388,7 @@
"There is no company associated with that warehouse": "No hay ninguna empresa asociada a ese almacén", "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 }}", "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", "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"
} }

View File

@ -9,6 +9,7 @@ columns:
notes: notes notes: notes
isConfirmed: confirmed isConfirmed: confirmed
isVirtual: virtual isVirtual: virtual
isRaid: raid
commission: commission commission: commission
isOrdered: price3 isOrdered: price3
created: created created: created

View File

@ -9,6 +9,7 @@ columns:
notes: notas notes: notas
isConfirmed: confirmado isConfirmed: confirmado
isVirtual: virtual isVirtual: virtual
isRaid: redada
commission: comisión commission: comisión
isOrdered: pedida isOrdered: pedida
created: creado created: creado

View File

@ -194,6 +194,7 @@ module.exports = Self => {
e.evaNotes observation, e.evaNotes observation,
e.isConfirmed, e.isConfirmed,
e.isOrdered, e.isOrdered,
t.isRaid,
t.daysInForward, t.daysInForward,
e.commission, e.commission,
e.created, e.created,

View File

@ -49,8 +49,8 @@ module.exports = Self => {
'isReceived', 'isReceived',
'isDelivered', 'isDelivered',
'ref', 'ref',
'daysInForward', 'isRaid',
], 'daysInForward'],
include: [ include: [
{ {
relation: 'agency', relation: 'agency',

View File

@ -30,7 +30,7 @@
<vn-icon <vn-icon
vn-tooltip="Is virtual entry" vn-tooltip="Is virtual entry"
icon="icon-net" icon="icon-net"
ng-if="$ctrl.entryData.travel.daysInForward"> ng-if="$ctrl.entryData.travel.isRaid">
</vn-icon> </vn-icon>
</div> </div>
<div class="quicklinks"> <div class="quicklinks">

View File

@ -86,7 +86,7 @@ auto-load="true">
</vn-check> </vn-check>
<vn-check <vn-check
label="Raid" label="Raid"
ng-model="$ctrl.entryData.travel.daysInForward" ng-model="$ctrl.entryData.travel.isRaid"
disabled="true"> disabled="true">
</vn-check> </vn-check>
<vn-check <vn-check

View File

@ -23,6 +23,12 @@
"Route": { "Route": {
"dataSource": "vn" "dataSource": "vn"
}, },
"RouteAction": {
"dataSource": "vn"
},
"RouteComplement": {
"dataSource": "vn"
},
"RouteLog": { "RouteLog": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,30 @@
{
"name": "RouteAction",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "routeAction"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
},
"price": {
"type": "number"
},
"isMainlineDelivered": {
"type": "boolean",
"required": true
}
}
}

View File

@ -0,0 +1,37 @@
{
"name": "RouteComplement",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "routeComplement"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"dated": {
"type": "date"
},
"price": {
"type": "number"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"routeAction": {
"type": "belongsTo",
"model": "RouteAction",
"foreignKey": "routeActionFk"
}
}
}

View File

@ -154,6 +154,7 @@ module.exports = Self => {
t.landingHour, t.landingHour,
t.cargoSupplierFk, t.cargoSupplierFk,
t.totalEntries, t.totalEntries,
t.isRaid,
t.daysInForward, t.daysInForward,
am.name agencyModeName, am.name agencyModeName,
win.name warehouseInName, win.name warehouseInName,

View File

@ -51,6 +51,9 @@
"landingHour": { "landingHour": {
"type": "string" "type": "string"
}, },
"isRaid": {
"type": "boolean"
},
"daysInForward": { "daysInForward": {
"type": "number" "type": "number"
} }

View File

@ -301,7 +301,19 @@
"birth", "birth",
"educationLevelFk", "educationLevelFk",
"originCountryFk", "originCountryFk",
"maritalStatus" "maritalStatus",
"SSN"
],
"include": [
{
"relation": "client",
"scope": {
"fields": [
"id",
"phone"
]
}
}
] ]
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-back", "name": "salix-back",
"version": "24.44.0", "version": "24.50.0",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix backend", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",