Skip to Content
0
Former Member
May 12, 2014 at 07:57 AM

JOURNAL VOUCHER APPROVAL PROCESS

403 Views

Dear Experts,

I want to create an approval procedure for Journal Vouchers.

I did the following:-

  1. I created a UDF - MD-Approval on accounting - Journal transactions header with valid values of Pending, Declined and Approved. Pending is the default value. The field is a mandatory field.
  2. I made the MD the only user who can edit this field by creating a category in Settings- Fields - setup that is relevant to him only
  3. I created a stored procedure to block posting of journal Vouchers unless the UDF status reads "approved"

--------- Block unapproved Journal Voucher-----

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

BEGIN

IF Exists (Select T0.TransID from dbo.OBTF T0

WHERE T0.TransId=@list_of_cols_val_tab_del and U_MD_APPROVAL <> 'Approved')

select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'

End

The stored procedure above is not working and journal voucher are processed irrespective of the udf field status. Kindly review and let me know what is wrong with it.

Regards

George Njuguna