Skip to Content
0
Former Member
Dec 01, 2008 at 11:09 AM

Stored procedure for checking Invoice value if more than R 15 000

18 Views

Hi All

I have a problem with my stored procedure below, i want to check the doctotal if it above R 15 000 , if it is then it checks if the supplier has a tax clearance cert.

IF @transaction_type = 'A' AND @object_type = '22'

BEGIN

If exists (SELECT T0.cardcode, t0.docentry FROM OPOR T0 where T0.DOCTOTAL >'15,000.00' and T0.U_TAXCLEAR IS NULL AND T0.docentry=@list_of_cols_val_tab_del)

begin

SET @error = 10

SET @error_message = N'Amount is above R 15 000 please select Supplier with Valid Tax Certificate'

END

END

-


I tried this executing the sp and there was this error

Msg 208, Level 16, State 6, Procedure SBO_SP_TransactionNotification, Line 41

Invalid object name 'dbo.SBO_SP_TransactionNotification'.

In this case line 41 is 2nd END.

Thanks

Bongani Dlamini