From d17a61d4c1c4d1c79b7e161e870d11ec0bb4174b Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 16 Nov 2020 08:45:20 +0100 Subject: [PATCH] Version merge --- db/changes/10250-curfew/00-ACL.sql | 11 ++- .../00-claimState.sql | 0 .../00-observationType.sql | 0 .../00-supplierLog.sql | 0 .../00-ticket_beforeUpdate.sql | 0 .../00-ticket_componentPreview.sql | 0 db/changes/10250-curfew/00-travelDetail.sql | 94 ------------------- db/changes/10250-toqueDeQueda/00-ACL.sql | 10 -- 8 files changed, 10 insertions(+), 105 deletions(-) rename db/changes/{10250-toqueDeQueda => 10250-curfew}/00-claimState.sql (100%) rename db/changes/{10250-toqueDeQueda => 10250-curfew}/00-observationType.sql (100%) rename db/changes/{10250-toqueDeQueda => 10250-curfew}/00-supplierLog.sql (100%) rename db/changes/{10250-toqueDeQueda => 10250-curfew}/00-ticket_beforeUpdate.sql (100%) rename db/changes/{10250-toqueDeQueda => 10250-curfew}/00-ticket_componentPreview.sql (100%) delete mode 100644 db/changes/10250-curfew/00-travelDetail.sql delete mode 100644 db/changes/10250-toqueDeQueda/00-ACL.sql diff --git a/db/changes/10250-curfew/00-ACL.sql b/db/changes/10250-curfew/00-ACL.sql index 90f673c67..46921e575 100644 --- a/db/changes/10250-curfew/00-ACL.sql +++ b/db/changes/10250-curfew/00-ACL.sql @@ -1,4 +1,13 @@ + +UPDATE `salix`.`ACL` SET `principalId` = 'deliveryBoss' WHERE (`id` = '194'); +UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '97'); +UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '100'); +UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '103'); +UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '202'); + INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Supplier', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Supplier', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierLog', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierContact', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); \ No newline at end of file +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierContact', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Town', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'); +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Province', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'); \ No newline at end of file diff --git a/db/changes/10250-toqueDeQueda/00-claimState.sql b/db/changes/10250-curfew/00-claimState.sql similarity index 100% rename from db/changes/10250-toqueDeQueda/00-claimState.sql rename to db/changes/10250-curfew/00-claimState.sql diff --git a/db/changes/10250-toqueDeQueda/00-observationType.sql b/db/changes/10250-curfew/00-observationType.sql similarity index 100% rename from db/changes/10250-toqueDeQueda/00-observationType.sql rename to db/changes/10250-curfew/00-observationType.sql diff --git a/db/changes/10250-toqueDeQueda/00-supplierLog.sql b/db/changes/10250-curfew/00-supplierLog.sql similarity index 100% rename from db/changes/10250-toqueDeQueda/00-supplierLog.sql rename to db/changes/10250-curfew/00-supplierLog.sql diff --git a/db/changes/10250-toqueDeQueda/00-ticket_beforeUpdate.sql b/db/changes/10250-curfew/00-ticket_beforeUpdate.sql similarity index 100% rename from db/changes/10250-toqueDeQueda/00-ticket_beforeUpdate.sql rename to db/changes/10250-curfew/00-ticket_beforeUpdate.sql diff --git a/db/changes/10250-toqueDeQueda/00-ticket_componentPreview.sql b/db/changes/10250-curfew/00-ticket_componentPreview.sql similarity index 100% rename from db/changes/10250-toqueDeQueda/00-ticket_componentPreview.sql rename to db/changes/10250-curfew/00-ticket_componentPreview.sql diff --git a/db/changes/10250-curfew/00-travelDetail.sql b/db/changes/10250-curfew/00-travelDetail.sql deleted file mode 100644 index 673044b9e..000000000 --- a/db/changes/10250-curfew/00-travelDetail.sql +++ /dev/null @@ -1,94 +0,0 @@ -drop procedure `vn2008`.travelDetail; - -create definer = root@`%` procedure `vn2008`.travelDetail__() -BEGIN - - DECLARE vDateFrom DATE DEFAULT TIMESTAMPADD(WEEK,-12,CURDATE()); - - SELECT IFNULL(CONCAT(" ",Entrada),travel) travelAndEntry, - travel, - Entrada, - IsTravel, - Agencia, - ref, - shipment, - OrigenCajas, - landing, - Destino, - Etiquetas, - Notas_Eva, - kg, - loadedKg, - volumeKg, - loadPriority, - Notas, - Carguera - FROM(SELECT - 1 as IsTravel, - tr.id as travel, - NULL as Entrada, - ag.Agencia, - tr.ref, - tr.shipment, - wo.name as OrigenCajas, - tr.landing, - w.name as Destino, - sum(c.Etiquetas) as Etiquetas, - NULL as Notas_Eva, - kg, - cast(sum(a.density * c.Etiquetas * IF(cb.Volumen, cb.Volumen, cb.X * cb.Y * cb.Z) / 1000000 ) as DECIMAL(10,0)) as loadedKg, - cast(sum(167.5 * c.Etiquetas * IF(cb.Volumen, cb.Volumen, cb.X * cb.Y * cb.Z) / 1000000 ) as DECIMAL(10,0)) as volumeKg, - NULL as loadPriority, - NULL as Notas, - pc.Alias as Carguera - FROM travel tr - LEFT JOIN Proveedores pc ON pc.Id_Proveedor = tr.cargoSupplierFk - LEFT JOIN Entradas e ON e.travel_id = tr.id - LEFT JOIN Compres c ON c.Id_Entrada = e.Id_Entrada - LEFT JOIN Cubos cb ON cb.Id_Cubo = c.Id_Cubo - LEFT JOIN Articles a ON a.Id_Article = c.Id_Article - LEFT JOIN Tipos tp ON tp.tipo_id = a.tipo_id - JOIN warehouse w ON w.id = tr.warehouse_id - JOIN warehouse wo ON wo.id = tr.warehouse_id_out - JOIN Agencias ag ON ag.Id_Agencia = tr.agency_id - WHERE tr.landing >= vDateFrom AND (wo.name="Colombia" OR wo.name="Ecuador") - GROUP BY tr.id - - UNION ALL - - SELECT - 0 as IsTravel, - e.travel_id as travel, - e.Id_Entrada, - p.Proveedor, - e.Referencia, - tr.shipment, - wo.name as OrigenCajas, - tr.landing, - w.name as Destino, - sum(Etiquetas) as Etiquetas, - e.Notas_Eva, - NULL as kg, - cast(sum(a.density * c.Etiquetas * IF(cb.Volumen, cb.Volumen, cb.X * cb.Y * cb.Z) / 1000000 ) as DECIMAL(10,0)) as loadedkg, - cast(sum(167.5 * c.Etiquetas * IF(cb.Volumen, cb.Volumen, cb.X * cb.Y * cb.Z) / 1000000 ) as DECIMAL(10,0)) as volumeKg, - loadPriority, - e.Notas, - pc.Alias as carguera - - FROM Entradas e - JOIN Compres c ON c.Id_Entrada = e.Id_Entrada - JOIN Cubos cb ON cb.Id_Cubo = c.Id_Cubo - JOIN Articles a ON a.Id_Article = c.Id_Article - JOIN Tipos tp ON tp.tipo_id = a.tipo_id - JOIN Proveedores p ON p.Id_Proveedor = e.Id_Proveedor - JOIN travel tr ON tr.id = e.travel_id - LEFT JOIN Proveedores pc ON pc.Id_Proveedor = tr.cargoSupplierFk - JOIN warehouse w ON w.id = tr.warehouse_id - JOIN warehouse wo ON wo.id = tr.warehouse_id_out - WHERE tr.landing >= vDateFrom AND (wo.name="Colombia" OR wo.name="Ecuador") - GROUP BY e.Id_Entrada - ) sub - ORDER BY landing ASC, shipment ASC,travel, IsTravel DESC, (loadPriority > 0) DESC,loadPriority, Agencia, Notas_Eva ; - -END; - diff --git a/db/changes/10250-toqueDeQueda/00-ACL.sql b/db/changes/10250-toqueDeQueda/00-ACL.sql deleted file mode 100644 index 4cdadfd04..000000000 --- a/db/changes/10250-toqueDeQueda/00-ACL.sql +++ /dev/null @@ -1,10 +0,0 @@ -UPDATE `salix`.`ACL` SET `principalId` = 'deliveryBoss' WHERE (`id` = '194'); -UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '97'); -UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '100'); -UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '103'); -UPDATE `salix`.`ACL` SET `principalId` = 'claimManager' WHERE (`id` = '202'); - -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Town', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Province', '*', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('supplier', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative'); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SupplierContact', '*', 'WRITE', 'ALLOW', 'ROLE', 'administrative');