Annotation: office.is_periodic_inventory

CREATE OR REPLACE FUNCTION office.is_periodic_inventory(_office_id integer)
RETURNS boolean

Information: office.is_periodic_inventory

Schema office
Function Name is_periodic_inventory
Arguments _office_id integer
Owner postgres
Result Type boolean
Description

Implementation: office.is_periodic_inventory

CREATE OR REPLACE FUNCTION office.is_periodic_inventory(_office_id integer)
 RETURNS boolean
 LANGUAGE plpgsql
AS $function$
    DECLARE config boolean;
BEGIN
    SELECT value = 'Periodic' INTO config
    FROM office.configuration
    WHERE config_id=1
    AND office_id=$1;

    IF(config IS NULL) THEN
        RETURN false;
        --RAISE EXCEPTION '%', 'ERROR M9001: Invalid MixERP database schema. Please consult with your administrator.';
    END IF;

    RETURN config;
END
$function$