7430_devToTest #2490
|
@ -1,22 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`exchangeReportSource`
|
|
||||||
AS SELECT `e`.`dated` AS `dated`,
|
|
||||||
cast(sum(`e`.`amountIn`) AS decimal(10, 2)) AS `amountIn`,
|
|
||||||
cast(sum(`e`.`rateIn`) AS decimal(10, 4)) AS `rateIn`,
|
|
||||||
cast(sum(`e`.`amountOut`) AS decimal(10, 2)) AS `amountOut`,
|
|
||||||
cast(sum(`e`.`rateOut`) AS decimal(10, 4)) AS `rateOut`,
|
|
||||||
cast(sum(`e`.`amountEntry`) AS decimal(10, 2)) AS `amountEntry`,
|
|
||||||
cast(sum(`e`.`rateEntry`) AS decimal(10, 4)) AS `rateEntry`,
|
|
||||||
cast(
|
|
||||||
IFNULL(`rr`.`value`, `rrc`.`simulatedValue`) AS decimal(10, 4)
|
|
||||||
) AS `rateECB`
|
|
||||||
FROM (
|
|
||||||
(
|
|
||||||
`vn`.`exchangeReportSourcePrevious` `e`
|
|
||||||
LEFT JOIN `vn`.`referenceRate` `rr` ON(`rr`.`dated` = `e`.`dated`)
|
|
||||||
)
|
|
||||||
JOIN `vn`.`referenceRateConfig` `rrc` ON(1)
|
|
||||||
)
|
|
||||||
GROUP BY `e`.`dated`
|
|
||||||
ORDER BY `e`.`dated`
|
|
|
@ -1,29 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn`.`exchangeReportSourcePrevious`
|
|
||||||
AS SELECT `exchangeInsuranceIn`.`dated` AS `dated`,
|
|
||||||
`exchangeInsuranceIn`.`amount` AS `amountIn`,
|
|
||||||
`exchangeInsuranceIn`.`rate` AS `rateIn`,
|
|
||||||
0.00 AS `amountOut`,
|
|
||||||
0.00 AS `rateOut`,
|
|
||||||
0.00 AS `amountEntry`,
|
|
||||||
0.00 AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceIn`
|
|
||||||
UNION ALL
|
|
||||||
SELECT `exchangeInsuranceOut`.`received` AS `received`,
|
|
||||||
0.00 AS `amountIn`,
|
|
||||||
0.00 AS `ratedIn`,
|
|
||||||
`exchangeInsuranceOut`.`divisa` AS `amountOut`,
|
|
||||||
`exchangeInsuranceOut`.`rate` AS `ratedOut`,
|
|
||||||
0.00 AS `amountEntry`,
|
|
||||||
0.00 AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceOut`
|
|
||||||
UNION ALL
|
|
||||||
SELECT `exchangeInsuranceEntry`.`dated` AS `dated`,
|
|
||||||
0.00 AS `amountIn`,
|
|
||||||
0.00 AS `ratedIn`,
|
|
||||||
0.00 AS `amountOut`,
|
|
||||||
0.00 AS `ratedOut`,
|
|
||||||
`exchangeInsuranceEntry`.`Dolares` AS `amountEntry`,
|
|
||||||
`exchangeInsuranceEntry`.`rate` AS `rateEntry`
|
|
||||||
FROM `vn`.`exchangeInsuranceEntry`
|
|
|
@ -14,6 +14,5 @@ AS SELECT `dn`.`id` AS `albaran_id`,
|
||||||
`dn`.`workerFk` AS `Id_Trabajador`,
|
`dn`.`workerFk` AS `Id_Trabajador`,
|
||||||
`dn`.`supervisorFk` AS `Id_Responsable`,
|
`dn`.`supervisorFk` AS `Id_Responsable`,
|
||||||
`dn`.`departmentFk` AS `department_id`,
|
`dn`.`departmentFk` AS `department_id`,
|
||||||
`dn`.`invoiceInFk` AS `recibida_id`,
|
`dn`.`invoiceInFk` AS `recibida_id`
|
||||||
`dn`.`farmingFk` AS `farmingFk`
|
|
||||||
FROM `vn`.`deliveryNote` `dn`
|
FROM `vn`.`deliveryNote` `dn`
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE vn.deliveryNote CHANGE farmingFk farmingFk__ int(10) unsigned DEFAULT NULL NULL;
|
Loading…
Reference in New Issue