Skip to content

Added support for PDF format containing a refund with a variation in the PDF#5821

Open
kimmerin wants to merge 2 commits into
portfolio-performance:masterfrom
kimmerin:pdfimport_wirbank_distibutionsupport
Open

Added support for PDF format containing a refund with a variation in the PDF#5821
kimmerin wants to merge 2 commits into
portfolio-performance:masterfrom
kimmerin:pdfimport_wirbank_distibutionsupport

Conversation

@kimmerin

Copy link
Copy Markdown
Contributor

added support for a variation of a PDF containing a refund as provided at the PP-forum.

hasCurrencyCode("CHF"))));

// check dividend transaction
assertThat(results, hasItem(dividend( //

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a dividend or is this a tax refund?

The text in the document reads "Refund Swiss withholding tax"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@kimmerin kimmerin Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@buchen buchen added the pdf label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants