Annotation: core.is_stock_item

CREATE OR REPLACE FUNCTION core.is_stock_item(item_id integer)
RETURNS boolean

Information: core.is_stock_item

Schema core
Function Name is_stock_item
Arguments item_id integer
Owner postgres
Result Type boolean
Description

Implementation: core.is_stock_item

CREATE OR REPLACE FUNCTION core.is_stock_item(item_id integer)
 RETURNS boolean
 LANGUAGE plpgsql
AS $function$
BEGIN
    IF EXISTS
    (
        SELECT 1 FROM core.items WHERE core.items.item_id=$1 AND maintain_stock=true
    ) THEN
        RETURN true;
    END IF;

    RETURN false;
END
$function$