CREATE PROCEDURE sp_api2_conComprobantesEncMaxNum
AS
BEGIN
    SET NOCOUNT ON;

    SELECT ISNULL(MAX(numero), 0) + 1 AS numero
    FROM conComprobantesEnc;
END;
