Annotation: core.get_item_tax_rate

CREATE OR REPLACE FUNCTION core.get_item_tax_rate(_item_id integer)
RETURNS numeric

Information: core.get_item_tax_rate

Schema core
Function Name get_item_tax_rate
Arguments _item_id integer
Owner postgres
Result Type numeric
Description

Implementation: core.get_item_tax_rate

CREATE OR REPLACE FUNCTION core.get_item_tax_rate(_item_id integer)
 RETURNS numeric
 LANGUAGE plpgsql
 STABLE
AS $function$
BEGIN
    RETURN
        core.sales_taxes.rate
    FROM core.sales_taxes
    INNER JOIN core.items
    ON core.items.sales_tax_id = core.sales_taxes.sales_tax_id
    AND core.items.item_id = $1;
END
$function$