Annotation: core.get_currency_code_by_party_id

CREATE OR REPLACE FUNCTION core.get_currency_code_by_party_id(party_id bigint)
RETURNS text

Information: core.get_currency_code_by_party_id

Schema core
Function Name get_currency_code_by_party_id
Arguments party_id bigint
Owner postgres
Result Type text
Description

Implementation: core.get_currency_code_by_party_id

CREATE OR REPLACE FUNCTION core.get_currency_code_by_party_id(party_id bigint)
 RETURNS text
 LANGUAGE plpgsql
 STABLE
AS $function$
BEGIN
    RETURN core.accounts.currency_code
    FROM core.accounts
    INNER JOIN core.parties
    ON core.accounts.account_id = core.parties.account_id
    AND core.parties.party_id=$1;
END
$function$