Added support for PDF format containing a refund with a variation in the PDF#5821
Added support for PDF format containing a refund with a variation in the PDF#5821kimmerin wants to merge 2 commits into
Conversation
| hasCurrencyCode("CHF")))); | ||
|
|
||
| // check dividend transaction | ||
| assertThat(results, hasItem(dividend( // |
There was a problem hiding this comment.
Is this a dividend or is this a tax refund?
The text in the document reads "Refund Swiss withholding tax"
There was a problem hiding this comment.
I've assumed a dividend payment because that's what is mentioned in the dump:
Dividend Payment
We have booked the following payment for you:
Type of distribution: Refund Swiss withholding tax
I've asked in the forum for clarification.
There was a problem hiding this comment.
Mmmh, I read this as. A refund of a withholding tax previously taxed on the dividend. If we record this as dividend, then we are not "cancelling" the taxes recorded earlier.
I wanted to ask in the forum, but I see you already did that. Thank you. Let's see
There was a problem hiding this comment.
I've checked the other tax refund samples in the test and they are essentially the same (minus the "Swiss" in the text for the return). I've removed the if-block checking the type against the text in the PDF. The assign-block is only executed if the match-block matches and the regex already contains everything that is checked later on.
That duplicate checks was the reason why the importer treated this as dividend. The regex said tax-return (and made me happy that the parser stopped throwing IllegalArgumentExceptions) but the subsequent duplicate check wasn't amended by me so it never changed the type accordingly.
added support for a variation of a PDF containing a refund as provided at the PP-forum.