17 lines
480 B
SQL
17 lines
480 B
SQL
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
|
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
|