salix/services/db/install/changes/1.0.6/buy.sql

33 lines
1.0 KiB
SQL

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`.`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`.`buy_edi_id` AS `ektFk`,
`c`.`Novincular` AS `isIgnored`
FROM
`vn2008`.`Compres` `c`;