cancel
Showing results for 
Search instead for 
Did you mean: 

Setting tax code in sales invoice

Former Member
0 Kudos

I am creating sales invoices and credits using data from an external source and I need to set the tax code to purchase tax rather than sales tax for credits as this will help the customer reconcile the different types of trransactions. My problem is that whilst I can set the tax property it seems to be getting overridden when the record is added. The code I am using is: -

Select Case TaxCode1

Case "B1"

'21%

If TXNType = "II" Then

'Invoice

SalesInv.Lines.TaxCode = "21V"

Else

'Credit

SalesInv.Lines.TaxCode = "V21"

End If

Case "B3"

'0%

If TXNType = "II" Then

'Invoice

SalesInv.Lines.TaxCode = "0VIC"

Else

'Credit

SalesInv.Lines.TaxCode = "VIC0"

End If

End Select

If I test this property immediatley before the add it is set to V21 but it gets added to the database as 21V.

Has anyone else had this problem? Is it that the SDK is preventing the use of a purchase tax code in sales even though it can be selected manually by the user?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gordon,

I first tested in the application - in both 2005 A PL48 and 2007 A PL41 - and when adding a sales invoice or AR Credit Note, I could only choose Outgoing tax codes. Additionally, if I used the option "Define New" in the choose from list, the new tax code would be outgoing with no way to change it to incoming. Are you able to add incoming tax codes on a Sales Invoice?

Generally, if it is not possible to do something in the application, it should not be possible with the DI, so I'm afraid in this case it looks like the DIs behaviour seems correct unless I was following a different scenario to you?

After testing in the DI API, I had the same results as you - the tax code is defaulted to an outgoing tax code.

A possible workaround is to create an outgoing tax code with the same rate as the incoming code you wish to use but I'm not sure if this would be acceptable.

Sorry I couldn't be more helpful,

Niall

SAP Business One Forums

Former Member
0 Kudos

Thanks Niall,

thats the conclusion I had come to. In fact I had originally thought that it could be done in the application but I realise that I was wrong in this, I am working in a Belgian localisation and there are a huge amount of codes that are very similar which managed to lead me in the wrong direction.

thanks for your prompt help.

Gordon