salix/db/routines/vn2008/views/Rutas_Master.sql

23 lines
746 B
SQL

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn2008`.`Rutas_Master`
AS SELECT `rm`.`id` AS `id`,
`rm`.`warehouseFk` AS `warehouse_id`,
`rm`.`km` AS `km`,
`rm`.`packages` AS `bultos`,
`rm`.`vehicleCost` AS `vehiculos_coste`,
`rm`.`staffCost` AS `personal_coste`,
`rm`.`vehicle` AS `vehiculos_numero`,
`rm`.`staff` AS `personal_numero`,
`rm`.`fuel` AS `gasoil`,
`rm`.`freelancers` AS `autonomos`,
`rm`.`year` AS `año`,
`rm`.`month` AS `mes`,
`rm`.`expense` AS `gastos`,
`rm`.`freelancersPackages` AS `bultos_autonomos`,
`rm`.`kmCost` AS `coste_km`,
`rm`.`packageCost` AS `coste_bulto`,
`rm`.`freelancerPackageCost` AS `coste_bulto_autonomo`,
`rm`.`created` AS `odbc_date`
FROM `vn`.`routeMaster` `rm`