lunes, 6 de julio de 2020

Get Tender Type in iDempiere


-- SELECT * FROM fnt_get_tendertype('X');

CREATE OR REPLACE FUNCTION fnt_get_tendertype(p_tender_type CHAR)
RETURNS VARCHAR
AS $$
BEGIN
    RETURN
    (
        SELECT
            lt."name"
        FROM ad_reference AS r
            JOIN ad_ref_list AS l
            ON r.ad_reference_id = l.ad_reference_id
            JOIN ad_ref_list_trl AS lt
            ON l.ad_ref_list_id = lt.ad_ref_list_id
        WHERE r.ad_reference_id = 214
            AND lt.ad_language = 'es_NI'
            AND l.isactive = 'Y'
            AND l."value" = p_tender_type
    );
END;
$$ LANGUAGE plpgsql;

No hay comentarios:

Publicar un comentario