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

Allow Negative Tax and Fee (Credits) #3450

Open
flywire opened this issue Jul 19, 2023 · 7 comments
Open

Allow Negative Tax and Fee (Credits) #3450

flywire opened this issue Jul 19, 2023 · 7 comments
Labels

Comments

@flywire
Copy link
Contributor

flywire commented Jul 19, 2023

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 flywire added the bug label Jul 19, 2023
@Nirus2000
Copy link
Member

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

@flywire
Copy link
Contributor Author

flywire commented Jul 19, 2023

@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

@Nirus2000
Copy link
Member

Nirus2000 commented Jul 19, 2023

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

@flywire
Copy link
Contributor Author

flywire commented Jul 20, 2023

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

@Nirus2000
Copy link
Member

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

to be closed.

@flywire
Copy link
Contributor Author

flywire commented Jul 23, 2023

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

@pfalcon
Copy link
Contributor

pfalcon commented Oct 13, 2023

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:

return Math.abs(Math.round(newNumberFormat.parse(value).doubleValue() * valueType.factor()));
, 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);

@flywire flywire changed the title Allow Negative Tax (Tax Credits) Allow Negative Tax and Fee (Credits) Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants