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`.`invoiceCorrectionDataSource`
|
|
|
|
AS SELECT `s`.`itemFk` AS `itemFk`,
|
|
|
|
`s`.`quantity` AS `quantity`,
|
|
|
|
`s`.`concept` AS `concept`,
|
|
|
|
`s`.`price` AS `price`,
|
|
|
|
`s`.`discount` AS `discount`,
|
|
|
|
`t`.`refFk` AS `refFk`,
|
|
|
|
`s`.`id` AS `saleFk`,
|
|
|
|
`t`.`shipped` AS `shipped`
|
|
|
|
FROM (
|
|
|
|
`vn`.`sale` `s`
|
|
|
|
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `s`.`ticketFk`)
|
|
|
|
)
|
|
|
|
WHERE `t`.`shipped` > `util`.`VN_CURDATE`() + INTERVAL -3 year
|