[dbo].[IsVanLineStatementImportable]
CREATE FUNCTION [dbo].[IsVanLineStatementImportable](
@inVanlineGroupExternalCode varchar(10),
@inStatementYear int,
@inStatementNumber int,
@inVanLineStatementDefaultEndDate datetime,
@inDefaultImportable bit )
returns bit as
begin
declare @outIsImportable bit
declare @theCurrentDate datetime = convert( date, dbo.GetMssDateTime() )
declare @theVanLineStatementImportableDate datetime
if( isnull( @inDefaultImportable, 0 ) != 1 )
begin
set @theVanLineStatementImportableDate = dbo.GetVanLineStatementImportableDate( @inVanlineGroupExternalCode,
@inStatementYear, @inStatementNumber, @inVanLineStatementDefaultEndDate )
if( @inVanlineGroupExternalCode = 'SIRVA' )
begin
set @outIsImportable = case
when @theCurrentDate >= @theVanLineStatementImportableDate then 1
else 0
end
end
end
return isnull( @outIsImportable, @inDefaultImportable )
end
GO
GRANT EXECUTE ON [dbo].[IsVanLineStatementImportable] TO [MssExec]
GO