cancel
Showing results for 
Search instead for 
Did you mean: 

didn't accept Multiple tax codes in A/R invoice

Former Member
0 Kudos

Hi,

In A/R Invoice they are using many tax codes. But now onwards they need to maintain only one type of tax code using in single A/R invoice. But end users are take multiple  tax codes in one invoice. Is there any stored procedure to block this type of scenario. If they are using multiple tax code the A/R invoice should may rise one error ie., multiple tax code not accepted. Kindly provide stored procedure for this scenario.

Thanks & Regards,

Kishore.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try this

-- Block multi taxcode

declare @numvatgroup int

IF (@object_type='13') and (@transaction_type='A' )

          BEGIN

                    set @numvatgroup=(SELECT COUNT( DISTINCT VATGROUP) FROM INV1  WHERE dbo.INV1.DocEntry = @list_of_cols_val_tab_del );

                    if @numvatgroup >1

                                                  BEGIN

                                                            SELECT @Error = 1, @error_message = 'Multi Taxcode not accepted .'

                                                  END

          END

Hope this helps,

TVSon

Former Member
0 Kudos

Hi TVSon

It is not working, even when i take same tax codes in multiple rows that was not added.

Kindly help me.

Thanks & Regards,

Kishore

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi Ravi,

Try this:

if @object_type = '13' and (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')

begin

If exists(SELECT T0.[DocNum] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode WHERE T1.[VatGroup] <> T2.[ECVatGroup]  

where t0.docentry = @list_of_cols_val_tab_del )

begin

select @error = 1, @error_message = 'Multi tax code not allowed '

end

end

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

Try this which tested

-- block multi taxcode

declare @numvatgroup int

IF (@object_type='13') and (@transaction_type='A' )

          BEGIN

  set @numvatgroup=(SELECT COUNT( DISTINCT T1.VATGROUP) FROM INV1 T1 WHERE T1.DocEntry = @list_of_cols_val_tab_del );

                      if @numvatgroup >1

                                                  BEGIN

                                                            SELECT @Error = 1, @error_message = 'Multi Taxcode is not accepted'

                                                  END

          END

Regards,

TVSon

Former Member
0 Kudos

Hi TVSon,

Now it was add successfully in A/R invoice. In  DISTINCT T1.VATGROUP here am replaced wth

DISTINCT T1.TAXCODE.

Thanks & Regards

Kishore

Former Member
0 Kudos

Hi,

It's great.

May be your database localization is different with mine. Could I know your localization? In my database, taxcode is null for lines in INV1 table.

Thanks,

TVSon

Former Member
0 Kudos

DemoIN

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravi,

You can use SP_ Transaction Notification in Stored Procedures.

GBU

0 Kudos

Hi GBU,

I want query, how to write in stored procedure to block multiple tax codes in A/R invoice. am tried it but not executed successfully.