DROP PROCEDURE IF EXISTS `vn`.`ticket_canMerge`;

DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_canMerge`(vDated DATE, vScopeDays INT, vLitersMax INT, vLinesMax INT, vWarehouseFk INT)
BEGIN
 CALL vn.ticket_canbePostponed(vDated,TIMESTAMPADD(DAY, vScopeDays, vDated),vLitersMax,vLinesMax,vWarehouseFk);
END  $$
DELIMITER ;

INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
    ('Ticket', 'getTicketsFuture', 'READ', 'ALLOW', 'ROLE', 'employee'),
    ('Ticket', 'merge', 'WRITE', 'ALLOW', 'ROLE', 'employee');