cancel
Showing results for 
Search instead for 
Did you mean: 

PAN number blocking in A/P Invoices

0 Kudos

Dear Experts,

I have a following Scenario,

I want block pan number in A/P or A/R invoices for not all the ones .

I want to book TDS in invoices , The Pan Number field is empty in TAX Tab it will Block the document . i know its based on only in SP Transction , i have tried many things it will not work pls provide the query.

My SP procdure is working BP master level , but i dont want in BP master data I want in Invoices only .

MY Query is for invoices.

IF @transaction_type IN (N'A', N'U') AND (@Object_type IN ('18'))

----BEGIN

----select T1.TaxId0 from OCRD T0 INNER JOIN CRD7 T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN OPCH T2 ON T0.[CardCode] = T2.[CardCode] INNER JOIN PCH1 T3 ON T2.[DocEntry] = T3.[DocEntry]

WHERE T3.[WTLiable] = 'y' ----AND (T1.TaxId0 is null ) AND T3.Docentry=@list_of_cols_val_tab_del

----BEGIN

----SET @error = 150

----SET @error_message = N'Enter PAN Number Must'

----END

----END

former_member186605
Active Contributor
0 Kudos

Balaji, can you please check/correct the assigned tag "the intercompany integration solution for SAP Business One"? This assure best attention and answer rate for you

Accepted Solutions (1)

Accepted Solutions (1)

azizelmir
Contributor
0 Kudos

Hi Balaji,

This is the TN:

IF @transaction_Type in ('A','U') and @object_type in ('18') 
BEGIN
IF EXISTS(
	SELECT t1.DocNum,t1.Cardcode FROM dbo.OPCH AS t1 
	WHERE t1.DocEntry = @list_of_cols_val_tab_del
	AND EXISTS(Select Q1.Cardcode from OCRD q1 inner join CRD7 q2 on q1.Cardcode=q2.Cardcode where q2.TaxId0 is null)
	)
 	BEGIN
		SET @error = 150
		SET @error_message = N'Enter PAN Number Must'
	END	


END

Thank you,

Aziz

0 Kudos

Thank you very much , sir its working.

Answers (0)