on 07-22-2020 9:25 AM
Dear All
Stored Procedure Required for to Block Duplicate vendor creation based on the
T1.[GSTRegnNo] and T2.[TaxId0] matches ,
Kindly help to over come the issuse
Thanks for advance Help
SELECT T0.[CardCode], T1.[GSTRegnNo], T2.[TaxId0]
FROM OCRD T0 INNER JOIN
CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode]
Dear Ramudu,
Please check this SP:
IF (@object_type = '2') and @transaction_type in ('A')
BEGIN
Declare @GstNo as varchar (100)
Declare @PanNo as varchar (100)
SET @GstNo = (select T1.[GSTRegnNo] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode] where T0.[CardCode] = @list_of_cols_Val_tab_del)
SET @PanNo = (Select T2.[TaxId0] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode] where T0.[CardCode] = @list_of_cols_Val_tab_del)
IF EXISTS (
SELECT T0.[CardCode] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode] where (@GstNo = T1.[GSTRegnNo])
UNION ALL
SELECT T0.[CardCode] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode] where (@PanNo=T2.[TaxId0])
)
BEGIN
set @error =-100
set @error_message = 'Duplicate vendor creation based on the GST No & PAN Matched'
END
END
Thank you,
Aziz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BEGIN
declare @GstNo as varchar (100)
declare @CardCode as varchar (100)
declare @PanNo as varchar (100)
IF (@object_type = '2') and and @transaction_type in ('A')
BEGIN
SELECT @GstNo = T1.[GSTRegnNo], @CardCode = T0.[CardCode], @PanNo=T2.[TaxId0] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode] where T0.[CardCode] = @list_of_cols_Val_tab_del
BEGIN
if (@GstNo is not null)
BEGIN
IF 1!= (select count T0.[CardCode] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode]
where (@GstNo = T1.[GSTRegnNo])and ( @CardCode = T0.[CardCode]) and (@PanNo=T2.[TaxId0]))
BEGIN
if (@PanNo is not null)
BEGIN
IF 1!= (select count T0.[CardCode] from OCRD T0 INNER JOIN CRD1 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN CRD7 T2 ON T0.[CardCode] = T2.[CardCode]
where (@GstNo = T1.[GSTRegnNo])and ( @CardCode = T0.[CardCode]) and (@PanNo=T2.[TaxId0]))
BEGIN
select @error = 10
select @error_message = 'BP Exist kindly check in bp Master ..'
End
End
End
End
End
The above SP is Not working , any suggestions please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.