portfolio icon indicating copy to clipboard operation
portfolio copied to clipboard

Allow Negative Tax and Fee (Credits)

Open flywire opened this issue 11 months ago • 7 comments

Describe the bug PP Gui does not allow negative tax (tax credit) input but it works if data file is edited directly.

To Reproduce Steps to reproduce the behavior:

  1. In the Dividend Form enter a negative tax amount
  2. See error - Not a valid number

Expected behavior Allow tax credits which are part of income, eg

image

Screenshots

image

Desktop (please complete the following information): Version: 0.64.4 (July 2023) Platform: win32, x86_64

flywire avatar Jul 19 '23 01:07 flywire

Negative taxes or fees must always be entered as positive. (Unsigned) In your example, however, the taxes are a tax refund. These can be posted separately so tax refund, or you create a PDF debug, then I'll take a look. This is not an error, but is correct.

to be closed

Nirus2000 avatar Jul 19 '23 11:07 Nirus2000

@Nirus2000 there is still miscommunication here, it needs more discussion.

Negative taxes or fees must always be entered as positive. (Unsigned)

There are lots of things I don't understand:

  1. Why is that the case? Is it an accounting or PP convention, or something special about Java?
  2. What does PP consider to be a bank? It doesn't seem to have any relevance to shares in Australia.
  3. What document might be used for a PDF debug. Each company has their own document so there would be endless documents. It's like invoices from a supplier.

image

image

image

flywire avatar Jul 19 '23 14:07 flywire

There are lots of things I don't understand:

Yes we know... use the PP-Forum and not here. Here, at Github, bugs in the program are described and solutions are worked out. Source code and logic functions.

Why is that the case? Is it an accounting or PP convention, or something special about Java?

Because this was determined programmatically and also by the developer.

What does PP consider to be a bank? It doesn't seem to have any relevance to shares in Australia.

A bank is a credit institution that provides banking and other financial services to its banking customers.

What document might be used for a PDF debug. Each company has their own document so there would be endless documents. It's like invoices from a supplier.

Account statements, settlements, securities transactions, custody account movements.... We have already implemented hundreds of documents in PP. Your screenshots, are such documents and we have written some importers for you as well, so I don't understand these "confusing" questions from you....

This is the wrong place for this kind of basic question and is better off in the PP forum. That's where you can ask these questions.

There is no error here.

TO BE CLOSED

Nirus2000 avatar Jul 19 '23 14:07 Nirus2000

Because this was determined programmatically and also by the developer.

Checks in the program can easily be changed. This is a call for @buchen.

The discussion moved to https://forum.portfolio-performance.info/t/dividends-with-imputation-credits/17148/6

flywire avatar Jul 20 '23 01:07 flywire

@flywire Solution here https://forum.portfolio-performance.info/t/dividends-with-imputation-credits/17148/8

to be closed.

Nirus2000 avatar Jul 20 '23 11:07 Nirus2000

Work around at https://forum.portfolio-performance.info/t/dividends-with-imputation-credits/17148/15 involving a manual file edit.

flywire avatar Jul 23 '23 10:07 flywire

I now see this happening with fees. Wouldn't have opinion re: taxes, but getting a fee rebate is absolutely normal practice, and should be recorded as such. @flywire, can you please update the title to mention fees too?

And what's worrying is that during import, invalid data gets recorded at all, due to this line: https://github.com/portfolio-performance/portfolio/blob/b1b4c48dca8b2316d931e3ee4bef4cf5f6e43d06/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/ExtractorUtils.java#L225 , so a fee rebate is turned into a fee deduction blindly, with other values in transaction getting incorrect. And fix for that is of course more complicated than just throwing out that Math.abs(), because all usage places would need to be checked for correct usage of sign (negated in many places, etc.). So, in my fork I added convertToSignedNumberLong() and use it in places which I can verify to have the right effect.

Fixing bug with transaction edit dialog not allowing signed numbers is easier:

--- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/dialogs/transactions/AbstractTransactionDialog.java
+++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/dialogs/transactions/AbstractTransactionDialog.java
@@ -81,7 +81,7 @@ public abstract class AbstractTransactionDialog extends TitleAreaDialog
 
         public void bindValue(String property, String description, Values<?> values, boolean isMandatory)
         {
-            StringToCurrencyConverter converter = new StringToCurrencyConverter(values);
+            StringToCurrencyConverter converter = new StringToCurrencyConverter(values, true);
             UpdateValueStrategy<String, Long> strategy = new UpdateValueStrategy<>();
             strategy.setAfterGetValidator(converter);
             strategy.setConverter(converter);

pfalcon avatar Oct 13 '23 09:10 pfalcon