2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`buyerSales`
|
|
|
|
AS SELECT `v`.`importe` AS `importe`,
|
|
|
|
`w`.`code` AS `comprador`,
|
|
|
|
`t`.`year` AS `año`,
|
|
|
|
`t`.`week` AS `semana`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`bs`.`ventas` `v`
|
|
|
|
JOIN `vn`.`time` `t` ON(`t`.`dated` = `v`.`fecha`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`itemType` `it` ON(`it`.`id` = `v`.`tipo_id`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `it`.`workerFk`)
|
|
|
|
)
|