Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7856

SP Transaction Notification Check for Duplicate NumAtCard

$
0
0

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

Viewing all articles
Browse latest Browse all 7856

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>