diff --git a/services/db/install/changes/1.0.3/01-ticketVolume.sql b/services/db/install/changes/1.0.3/01-ticketVolume.sql deleted file mode 100644 index 89cebb67e6..0000000000 --- a/services/db/install/changes/1.0.3/01-ticketVolume.sql +++ /dev/null @@ -1,29 +0,0 @@ -USE `vn`; -DROP procedure IF EXISTS `ticketVolume`; - -DELIMITER $$ -USE `vn`$$ -CREATE DEFINER=`root`@`%` PROCEDURE `ticketVolume`(IN vTicketId INT) -BEGIN - DECLARE vWarehouseId INTEGER; - DECLARE vShippedDate DATE; - - DROP TEMPORARY TABLE IF EXISTS ticketVolume; - SELECT warehouseFk, shipped INTO vWarehouseId,vShippedDate FROM vn.ticket WHERE id = vTicketId; - - CREATE TEMPORARY TABLE IF NOT EXISTS ticketVolume ENGINE MEMORY - - SELECT itemFk, saleFk, quantity, concept, VolUd as m3_uni, volume as m3, volume * quantity as volumeTimesQuantity, @m3:= @m3 + ifnull(volume,0) as m3_total - FROM - ( - SELECT round(r.cm3 / 1000000,3) as VolUd ,s.quantity, round(r.cm3 * s.quantity / 1000000,3) as volume, - s.itemFk, s.id AS saleFk, s.concept, @m3:= 0, @vol:=0, t.agencyModeFk - FROM sale s - JOIN vn.ticket t on t.id = s.ticketFk - JOIN bi.rotacion r ON r.Id_Article = s.itemFk AND r.warehouse_id = t.warehouseFk - WHERE s.ticketFk = vTicketId - ) sub; -END$$ - -DELIMITER ; - diff --git a/services/db/install/changes/1.0.3/04-ticketUpdateAction.sql b/services/db/install/changes/1.0.3/04-ticketUpdateAction.sql deleted file mode 100644 index 4371a07159..0000000000 --- a/services/db/install/changes/1.0.3/04-ticketUpdateAction.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`ticketUpdateAction` AS - SELECT - `b`.`buo_id` AS `id`, `b`.`description` AS `description` - FROM - `vn2008`.`bionic_updating_options` `b`; \ No newline at end of file diff --git a/services/db/install/changes/1.0.3/05-workerMana.sql b/services/db/install/changes/1.0.3/05-workerMana.sql deleted file mode 100644 index b6f94a4265..0000000000 --- a/services/db/install/changes/1.0.3/05-workerMana.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE `bs`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `bs`.`workerMana` AS - SELECT - `m`.`Id_Trabajador` AS `workerFk`, `m`.`used` AS `amount` - FROM - `bs`.`mana_spellers` `m`; \ No newline at end of file diff --git a/services/db/install/changes/1.0.3/06-ticketWeekly.sql b/services/db/install/changes/1.0.3/06-ticketWeekly.sql deleted file mode 100644 index c8230a9b00..0000000000 --- a/services/db/install/changes/1.0.3/06-ticketWeekly.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `ticketWeekly` AS - SELECT - `t`.`Id_Ticket` AS `ticketFk`, `t`.`weekDay` AS `weekDay` - FROM - `vn2008`.`Tickets_turno` `t`; \ No newline at end of file diff --git a/services/db/install/changes/1.0.4-cau6508/01-warehouse.sql b/services/db/install/changes/1.0.4-cau6508/01-warehouse.sql deleted file mode 100644 index df344b2f29..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/01-warehouse.sql +++ /dev/null @@ -1,16 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`warehouse` AS - SELECT - `t`.`id` AS `id`, - `t`.`name` AS `name`, - `t`.`inventario` AS `isInventory`, - `t`.`is_comparative` AS `isComparative`, - `t`.`comisionantes` AS `hasComission`, - `t`.`reserve` AS `hasAvailable`, - `t`.`isManaged` AS `isManaged` - FROM - `vn2008`.`warehouse` `t`; \ No newline at end of file diff --git a/services/db/install/changes/1.0.4-cau6508/02-buy.sql b/services/db/install/changes/1.0.4-cau6508/02-buy.sql deleted file mode 100644 index 704af9641d..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/02-buy.sql +++ /dev/null @@ -1,32 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `buy` AS - SELECT - `c`.`Id_Compra` AS `id`, - `c`.`Id_Entrada` AS `entryFk`, - `c`.`Id_Article` AS `itemFk`, - `c`.`Cantidad` AS `amount`, - `c`.`Costefijo` AS `buyingValue`, - `c`.`Cantidad` AS `quantity`, - `c`.`Id_Cubo` AS `packageFk`, - `c`.`Etiquetas` AS `stickers`, - `c`.`Portefijo` AS `freightValue`, - `c`.`Embalajefijo` AS `packageValue`, - `c`.`Comisionfija` AS `comissionValue`, - `c`.`Packing` AS `packing`, - `c`.`grouping` AS `grouping`, - `c`.`caja` AS `groupingMode`, - `c`.`Nicho` AS `location`, - `c`.`Tarifa1` AS `price1`, - `c`.`Tarifa2` AS `price2`, - `c`.`Tarifa3` AS `price3`, - `c`.`PVP` AS `minPrice`, - `c`.`Productor` AS `producer`, - `c`.`Vida` AS `printedStickers`, - `c`.`punteo` AS `isChecked`, - `c`.`Novincular` AS `isIgnored` - FROM - `vn2008`.`Compres` `c`; diff --git a/services/db/install/changes/1.0.4-cau6508/03-item.sql b/services/db/install/changes/1.0.4-cau6508/03-item.sql deleted file mode 100644 index 188ead9703..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/03-item.sql +++ /dev/null @@ -1,31 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`item` AS - SELECT - `t`.`Id_Article` AS `id`, - `t`.`Article` AS `name`, - `t`.`tipo_id` AS `typeFk`, - `t`.`Medida` AS `size`, - `t`.`Color` AS `inkFk`, - `t`.`Categoria` AS `category`, - `t`.`Tallos` AS `stems`, - `t`.`id_origen` AS `originFk`, - `t`.`description` AS `description`, - `t`.`producer_id` AS `producerFk`, - `t`.`Codintrastat` AS `intrastatFk`, - `t`.`offer` AS `isOnOffer`, - `t`.`expenceFk` AS `expenceFk`, - `t`.`bargain` AS `isBargain`, - `t`.`comments` AS `comment`, - `t`.`relevancy` AS `relevancy`, - `t`.`Foto` AS `image`, - `t`.`generic` AS `generic`, - `t`.`density` AS `density`, - `t`.`iva_group_id` AS `taxClassFk`, - `t`.`PVP` AS `minPrice`, - `t`.`Min` AS `hasMinPrice` - FROM - `vn2008`.`Articles` `t`; diff --git a/services/db/install/changes/1.0.4-cau6508/04-travel.sql b/services/db/install/changes/1.0.4-cau6508/04-travel.sql deleted file mode 100644 index c8cb2d30ec..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/04-travel.sql +++ /dev/null @@ -1,22 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`travel` AS - SELECT - `t`.`id` AS `id`, - `t`.`shipment` AS `shipped`, - `t`.`shipment_hour` AS `shipmentHour`, - `t`.`landing` AS `landed`, - `t`.`landing_hour` AS `landingHour`, - `t`.`warehouse_id` AS `warehouseInFk`, - `t`.`warehouse_id_out` AS `warehouseOutFk`, - `t`.`agency_id` AS `agencyFk`, - `t`.`ref` AS `ref`, - `t`.`delivered` AS `isDelivered`, - `t`.`received` AS `isReceived`, - `t`.`m3` AS `m3`, - `t`.`kg` AS `kg` - FROM - `vn2008`.`travel` `t`; diff --git a/services/db/install/changes/1.0.4-cau6508/05-getSpecialPrice.sql b/services/db/install/changes/1.0.4-cau6508/05-getSpecialPrice.sql deleted file mode 100644 index 231f2d2d60..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/05-getSpecialPrice.sql +++ /dev/null @@ -1,22 +0,0 @@ -USE `vn`; -DROP function IF EXISTS `getSpecialPrice`; - -DELIMITER $$ -USE `vn`$$ -CREATE DEFINER=`root`@`%` FUNCTION `getSpecialPrice`(vItemFk int(11),vClientFk int(11)) RETURNS decimal(10,2) -BEGIN - DECLARE price DECIMAL(10,2); - - SELECT rate3 INTO price - FROM vn.priceFixed - WHERE itemFk = vItemFk - AND CURDATE() BETWEEN started AND ended ORDER BY created DESC LIMIT 1; - - SELECT `value` INTO price - FROM vn.specialPrice - WHERE itemFk = vItemFk - AND clientFk = vClientFk ; -RETURN price; -END$$ - -DELIMITER ; \ No newline at end of file diff --git a/services/db/install/changes/1.0.4-cau6508/06-specialPrice.sql b/services/db/install/changes/1.0.4-cau6508/06-specialPrice.sql deleted file mode 100644 index ffedb9ce38..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/06-specialPrice.sql +++ /dev/null @@ -1,13 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`specialPrice` AS - SELECT - `p`.`Id_PrecioEspecial` AS `id`, - `p`.`Id_Cliente` AS `clientFk`, - `p`.`Id_Article` AS `itemFk`, - `p`.`PrecioEspecial` AS `value` - FROM - `vn2008`.`PreciosEspeciales` `p`; diff --git a/services/db/install/changes/1.0.4-cau6508/07-ticketComponentTemplate.sql b/services/db/install/changes/1.0.4-cau6508/07-ticketComponentTemplate.sql deleted file mode 100644 index 3f594e9883..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/07-ticketComponentTemplate.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE vn.ticketComponentTemplate - - SELECT * FROM vn2008.template_bionic_component; - -ALTER TABLE `vn`.`ticketComponentTemplate` - -CHANGE COLUMN `warehouse_id` `warehouseFk` SMALLINT(5) UNSIGNED NOT NULL , - -CHANGE COLUMN `item_id` `itemFk` INT(11) NOT NULL , - -CHANGE COLUMN `component_id` `componentFk` INT(10) UNSIGNED NOT NULL; \ No newline at end of file diff --git a/services/db/install/changes/1.0.4-cau6508/08-agencyProvince.sql b/services/db/install/changes/1.0.4-cau6508/08-agencyProvince.sql deleted file mode 100644 index 15bb437f16..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/08-agencyProvince.sql +++ /dev/null @@ -1,14 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`agencyProvince` AS - SELECT - `a`.`province_id` AS `provinceFk`, - `a`.`agency_id` AS `agencyFk`, - `a`.`zona` AS `zone`, - `a`.`warehouse_id` AS `warehouseFk`, - `a`.`route` AS `route` - FROM - `vn2008`.`Agencias_province` `a`; diff --git a/services/db/install/changes/1.0.4-cau6508/09-agencyModeZone.sql b/services/db/install/changes/1.0.4-cau6508/09-agencyModeZone.sql deleted file mode 100644 index 9558a85380..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/09-agencyModeZone.sql +++ /dev/null @@ -1,16 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`agencyModeZone` AS - SELECT - `a`.`Id_Agencia` AS `agencyModeFk`, - `a`.`zona` AS `zone`, - `a`.`price` AS `price`, - `a`.`Id_Article` AS `itemFk`, - `a`.`warehouse_id` AS `warehouseFk`, - `a`.`porte_minimo` AS `minimCost`, - `a`.`inflacion` AS `inflation` - FROM - `vn2008`.`Agencias_zonas` `a`; diff --git a/services/db/install/changes/1.0.4-cau6508/10-agencyWeekdayBonus.sql b/services/db/install/changes/1.0.4-cau6508/10-agencyWeekdayBonus.sql deleted file mode 100644 index ff616db01b..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/10-agencyWeekdayBonus.sql +++ /dev/null @@ -1,15 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`agencyWeekdayBonus` AS - SELECT - `a`.`id` AS `id`, - `a`.`warehouse_id` AS `warehouseFk`, - `a`.`agency_id` AS `agencyFk`, - `a`.`weekDay` AS `weekDay`, - `a`.`zona` AS `zone`, - `a`.`bonus` AS `bonus` - FROM - `vn2008`.`agency_weekday_bonus` `a`; diff --git a/services/db/install/changes/1.0.4-cau6508/11-preparationPercentaje.sql b/services/db/install/changes/1.0.4-cau6508/11-preparationPercentaje.sql deleted file mode 100644 index 1b9dc6c3d2..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/11-preparationPercentaje.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`preparationPercentage` AS - SELECT - `p`.`week_day` AS `weekDay`, - `p`.`warehouse_id` AS `warehouseFk`, - `p`.`percentage` AS `percentage` - FROM - `vn2008`.`preparation_percentage` `p`; diff --git a/services/db/install/changes/1.0.4-cau6508/12-preparationException.sql b/services/db/install/changes/1.0.4-cau6508/12-preparationException.sql deleted file mode 100644 index c51e13861b..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/12-preparationException.sql +++ /dev/null @@ -1,12 +0,0 @@ -USE `vn`; -CREATE - OR REPLACE ALGORITHM = UNDEFINED - DEFINER = `root`@`%` - SQL SECURITY DEFINER -VIEW `vn`.`preparationException` AS - SELECT - `p`.`exception_day` AS `exceptionDay`, - `p`.`warehouse_id` AS `warehouseFk`, - `p`.`percentage` AS `percentage` - FROM - `vn2008`.`preparation_exception` `p`; diff --git a/services/db/install/changes/1.0.4-cau6508/ACL.sql b/services/db/install/changes/1.0.4-cau6508/ACL.sql deleted file mode 100644 index 2d44e3be3e..0000000000 --- a/services/db/install/changes/1.0.4-cau6508/ACL.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`) VALUES ('WorkerMana', '*', 'READ', 'ALLOW', 'ROLE'); -UPDATE `salix`.`ACL` SET `principalId`='employee' WHERE `id`='77';