Annotation: core.get_base_quantity_by_unit_id
CREATE OR REPLACE FUNCTION core.get_base_quantity_by_unit_id(integer, integer)
RETURNS numeric
Information: core.get_base_quantity_by_unit_id
| Schema | core |
| Function Name | get_base_quantity_by_unit_id |
| Arguments | integer, integer |
| Owner | postgres |
| Result Type | numeric |
| Description | |
Implementation: core.get_base_quantity_by_unit_id
CREATE OR REPLACE FUNCTION core.get_base_quantity_by_unit_id(integer, integer)
RETURNS numeric
LANGUAGE plpgsql
AS $function$
DECLARE _root_unit_id integer;
DECLARE _factor decimal;
BEGIN
_root_unit_id = core.get_root_unit_id($1);
_factor = core.convert_unit($1, _root_unit_id);
RETURN _factor * $2;
END
$function$