2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`invoiceOut_getPath`(vSelf INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
RETURNS varchar(255) CHARSET utf8mb3 COLLATE utf8mb3_general_ci
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
|
|
|
DECLARE vIssued DATE;
|
|
|
|
DECLARE vSerial VARCHAR(15);
|
|
|
|
|
|
|
|
SELECT issued, ref
|
|
|
|
INTO vIssued, vSerial
|
|
|
|
FROM invoiceOut WHERE id = vSelf;
|
|
|
|
|
|
|
|
RETURN CONCAT_WS('/'
|
|
|
|
,'invoice'
|
|
|
|
,YEAR(vIssued)
|
|
|
|
,MONTH(vIssued)
|
|
|
|
,DAY(vIssued)
|
|
|
|
,CONCAT(YEAR(vIssued), vSerial, '.pdf')
|
|
|
|
);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|