Hi,
I have the following code in the SP. It works fine for the A/P Invoice but it's not working for the Good Receipt PO. Any idea ?
-- A/P Invoices if @object_type = '18' and (@transaction_type in ('A' ,'U')) begin if (@object_type = '18') begin select @RefNo = NumAtCard, @CardCode = CardCode from OPCH T0 where docentry = @list_of_cols_Val_tab_del begin if (@RefNo is not null) begin if 1 != (select count (docentry) from OPCH where (NumatCard = @RefNo) and (cardcode = @CardCode)) begin select @error = -1 select @error_message = 'La référence (NumAtCard) exist déjà' End End End End End -- A/P Good Receipt if @object_type = '20' and (@transaction_type in ('A' ,'U')) begin if (@object_type = '20') begin select @RefNo = NumAtCard, @CardCode = CardCode from OPDN T0 where docentry = @list_of_cols_Val_tab_del begin if (@RefNo is not null) begin if 1 != (select count (docentry) from OPDN where (NumatCard = @RefNo) and (cardcode = @CardCode)) begin select @error = -1 select @error_message = 'La référence (NumAtCard) exist déjà' End End End End End