Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle TypeError when dim1 is omitted on VAT lines #199

Merged

Conversation

rojtjo
Copy link
Contributor

@rojtjo rojtjo commented Aug 25, 2021

I ran into a TypeError while omitting dim1 field on a transaction line with type VAT. According to the Twinfield documentation the dim1 field can be empty for these transaction lines.

If line type = vat the VAT balance account. When an empty dim1 is entered, by default the general ledger account will be taken as entered at the VAT code in Twinfield.

This seems to be true for all transaction types which allow VAT lines.

@willemstuursma
Copy link
Contributor

willemstuursma commented Aug 25, 2021

Cheers. Could you please add an accompanying test case that would have caught this error.

@willemstuursma willemstuursma merged commit c6fc4dc into php-twinfield:master Apr 26, 2022
@edwin-easytrans
Copy link

Hi @rojtjo, this is a breaking change. I don't have dim1 on my total line to choose the debtor ledger of the customer, instead of providing it in the request. After this update i get the following error: "Dimensie 1 moet altijd worden ingevuld.//De dimensie 1 mag niet leeg zijn als dimensie 2 gevuld is., Dimensie op niveau 2 mag niet worden ingevuld omdat de dimensie op niveau 1 leeg gelaten is."

So this change is not only applicable to the VAT line, but also to the Totals line.
I hope you are able to correct this. Thank you.

@rojtjo
Copy link
Contributor Author

rojtjo commented Mar 18, 2023

It's been a while since I added this change so I'll have to read up on this again.
If you happen to have time to create a pull request for this feel free, otherwise I'll try to have a look at this somewhere next week.

@edwin-easytrans
Copy link

If you could have a look, that would be great. Thanks.

@rojtjo
Copy link
Contributor Author

rojtjo commented Apr 1, 2023

Hi @edwin-easytrans,

I'm sorry for the delay, I've been really busy these last few weeks.

I just pushed a potential fix to the fix/only-skip-setting-dim1-on-vat-line branch. You should be able to install this using composer require php-twinfield/twinfield:dev-fix/only-skip-setting-dim1-on-vat-line.

After you confirm this fixes your problem I'll merge these changes and make a new release.

@edwin-easytrans
Copy link

Hi @rojtjo, Thank you very much for the fix. I have tested the changes and it works great again.
Really appreciate your help!

@rojtjo
Copy link
Contributor Author

rojtjo commented Apr 1, 2023

Great to hear!
I have created a new release (3.3.0) which includes these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants