refs #6372 DeleteTablesFromVn2008 #2055
|
@ -1,27 +0,0 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`isPalletHomogeneus`(vExpedition INT)
|
||||
RETURNS tinyint(1)
|
||||
NOT DETERMINISTIC
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
DECLARE vScanId INT;
|
||||
DECLARE vDistinctRoutesInThePallet INT;
|
||||
|
||||
SELECT scan_id INTO vScanId
|
||||
FROM vn2008.scan_line
|
||||
WHERE code = vExpedition
|
||||
LIMIT 1;
|
||||
|
||||
SELECT COUNT(*) INTO vDistinctRoutesInThePallet
|
||||
FROM (
|
||||
SELECT DISTINCT t.Id_Ruta
|
||||
FROM vn2008.scan_line sl
|
||||
JOIN vn2008.expeditions e ON e.expeditions_id = sl.code
|
||||
JOIN vn2008.Tickets t ON t.Id_Ticket = e.ticket_id
|
||||
WHERE sl.scan_id = vScanId
|
||||
AND t.Id_Ruta
|
||||
) t1;
|
||||
|
||||
RETURN vDistinctRoutesInThePallet = 1;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,9 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`exchangeInsuranceInPrevious`
|
||||
AS SELECT `ei`.`finished` AS `dated`,
|
||||
`ei`.`amount` AS `amount`,
|
||||
`ei`.`rate` AS `rate`
|
||||
FROM `vn`.`exchangeInsurance` `ei`
|
||||
WHERE `ei`.`amount` <> 0
|
||||
AND `ei`.`financialProductTypefk` = 'SC'
|
|
@ -1,6 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`unaryScanLineBuy`
|
||||
AS SELECT `u`.`scan_line_id` AS `unaryScanLineFk`,
|
||||
`u`.`Id_Article` AS `itemFk`
|
||||
FROM `vn2008`.`unary_scan_line_buy` `u`
|
|
@ -1,6 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`unaryScanLineExpedition`
|
||||
AS SELECT `u`.`scan_line_id` AS `unaryScanLineFk`,
|
||||
`u`.`expedition_id` AS `expeditionFk`
|
||||
FROM `vn2008`.`unary_scan_line_expedition` `u`
|
|
@ -0,0 +1,16 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`pago_sdc`
|
||||
AS SELECT `ei`.`id` AS `pago_sdc_id`,
|
||||
`ei`.`amount` AS `importe`,
|
||||
`ei`.`dated` AS `fecha`,
|
||||
`ei`.`finished` AS `vencimiento`,
|
||||
`ei`.`entityFk` AS `entity_id`,
|
||||
`ei`.`ref` AS `ref`,
|
||||
`ei`.`rate` AS `rate`,
|
||||
`ei`.`companyFk` AS `empresa_id`,
|
||||
`ei`.`financialProductTypefk` AS `financialProductTypefk`,
|
||||
`ei`.`upperBarrier` AS `upperBarrier`,
|
||||
`ei`.`lowerBarrier` AS `lowerBarrier`,
|
||||
`ei`.`strike` AS `strike`
|
||||
FROM `vn`.`exchangeInsurance` `ei`
|
|
@ -0,0 +1,11 @@
|
|||
DROP VIEW IF EXISTS `vn`.`exchangeInsurance`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn2008`.`pago_sdc` RENAME `vn`.`exchangeInsurance`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn`.`exchangeInsurance`
|
||||
CHANGE COLUMN IF EXISTS `pago_sdc_id` `id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
CHANGE COLUMN IF EXISTS `importe` `amount` decimal(10,2) NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `fecha` `dated` date NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `vencimiento` `finished` date NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `entity_id` `entityFk` int(10) unsigned NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `empresa_id` `companyFk`int(10) unsigned NOT NULL DEFAULT 442;
|
Loading…
Reference in New Issue