Annotation: core.is_stock_item

CREATE OR REPLACE FUNCTION core.is_stock_item(item_code character varying)
RETURNS boolean

Information: core.is_stock_item

Schema core
Function Name is_stock_item
Arguments item_code character varying
Owner postgres
Result Type boolean
Description

Implementation: core.is_stock_item

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

    RETURN false;
END
$function$