USP_SIMPLEDATALIST_PDACCOUNTSYSTEMBASECURRENCYEXCHANGERATES
Returns a list of exchange rates for converted from the given currency to the base currency of the given account system.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@TRANSACTIONCURRENCYID | uniqueidentifier | IN | Transaction currency |
@PDACCOUNTSYSTEMID | uniqueidentifier | IN | Account system |
@ASOFDATE | datetime | IN | As of date |
@INCLUDESPOTRATE | bit | IN | Include spot rate |
@CURRENTEXCHANGERATEID | uniqueidentifier | IN | Current exchange rate |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
Definition
Copy
create procedure dbo.USP_SIMPLEDATALIST_PDACCOUNTSYSTEMBASECURRENCYEXCHANGERATES
(
@TRANSACTIONCURRENCYID uniqueidentifier = null,
@PDACCOUNTSYSTEMID uniqueidentifier = null,
@ASOFDATE datetime = null,
@INCLUDESPOTRATE bit = 0,
@CURRENTEXCHANGERATEID uniqueidentifier = null,
@CURRENTAPPUSERID uniqueidentifier = null
)
as
set nocount on;
declare @CURRENCYSETID uniqueidentifier;
declare @BASECURRENCYID uniqueidentifier;
if @PDACCOUNTSYSTEMID is null
select
@PDACCOUNTSYSTEMID = PDACCOUNTSYSTEM.ID
from
dbo.PDACCOUNTSYSTEM
where
PDACCOUNTSYSTEM.ISDEFAULT = 1;
select
@CURRENCYSETID = PDACCOUNTSYSTEM.CURRENCYSETID
from
dbo.PDACCOUNTSYSTEM
where
PDACCOUNTSYSTEM.ID = @PDACCOUNTSYSTEMID;
if @CURRENCYSETID is null
set @CURRENCYSETID = dbo.UFN_CURRENCYSET_GETAPPUSERCURRENCYSET(@CURRENTAPPUSERID);
select
@BASECURRENCYID = CURRENCYSET.BASECURRENCYID
from
dbo.CURRENCYSET
where
CURRENCYSET.ID = @CURRENCYSETID;
exec dbo.USP_SIMPLEDATALIST_CURRENCYEXCHANGERATES
@FROMCURRENCYID = @TRANSACTIONCURRENCYID,
@TOCURRENCYID = @BASECURRENCYID,
@TYPECODE = 1, -- Daily
@ASOFDATE = @ASOFDATE,
@INCLUDESPOTRATE = @INCLUDESPOTRATE,
@CURRENTEXCHANGERATEID = @CURRENTEXCHANGERATEID;