Skip to Content
0
Former Member
Apr 12, 2010 at 03:18 PM

Journal Stored Procedure

33 Views

Hi All

I am doing a Journal Entry Procedure so that only specific users can process all accounts and the rest can only process to specific accounts. And i do not want to have these accounts as 'Confidential' as i need the users to process the accounts in a voucher instead of a actual journal.

My code is below:

if @object_type = '30' and @transaction_type IN ('A', 'U')

BEGIN

DECLARE @JE as varchar(10)

Select @JE = 'TRUE' from [dbo].[jdt1] T0

WHERE T0.usersign <> '5' or t0.usersign <> '21' or t0.usersign <> '33' and ((Not (T0.[ShortName]) = '_SYS00000000222' or not (T0.[ShortName]) = '_SYS00000000225' or not (T0.[ShortName]) = '_SYS00000000321' or not (T0.[ShortName]) = '_SYS00000000322' or not (T0.[ShortName]) = '_SYS00000000298' or not (T0.[ShortName]) = '_SYS00000000299'

or not (T0.[ContraAct]) = '_SYS00000000222' or not (T0.[ContraAct]) = '_SYS00000000225' or not (T0.[ContraAct]) = '_SYS00000000321' or not (T0.[ContraAct]) = '_SYS00000000322' or not (T0.[ContraAct]) = '_SYS00000000298' or not( T0.[ContraAct]) = '_SYS00000000299'))

IF (@JE = 'TRUE' )

begin

select @error = 1, @error_message = 'Please Add to Journal Voucher'

end

end

Thanks