-
Notifications
You must be signed in to change notification settings - Fork 630
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
added Fidelity PDF import of trade confirmations #3678
Conversation
P.S. tests are running fine. I cannot run PP as program from Eclipse on my Mac. Buttons are not showing, ... |
Do you use the https://marketplace.eclipse.org/content/launch-configuration-dsl to generate the launch configuration? (I am developing on macOS so it does work there from within Eclipse) |
Hello @ggrossbe First of all, however, the importer must be called in PP. To keep the source code clean, we would welcome the removal of unused source code (commented out). One question remains. Please merge the two. Regards |
.section("month", "day", "year") // | ||
.match("^\\d+-\\w+.* (?<month>\\d+)-(?<day>\\d+)-(?<year>\\d+) \\d+-\\d+-\\d+.*$") | ||
.assign((t, v) -> // | ||
t.setDate(asDate(v.get("day") + "." + v.get("month") + ".20" + v.get("year")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example with contributing rules
.section("month", "day", "year") // | |
.match("^\\d+-\\w+.* (?<month>\\d+)-(?<day>\\d+)-(?<year>\\d+) \\d+-\\d+-\\d+.*$") | |
.assign((t, v) -> // | |
t.setDate(asDate(v.get("day") + "." + v.get("month") + ".20" + v.get("year")))) | |
// @formatter:off | |
// 20123-1XXXXX 1* WK# 01-04-21 01-06-21 46428Q109 20123-XXXXX | |
// @formatter:on | |
.section("date") // | |
.match("^.* WK# (?<date>[\\d]{2}\\-[\\d]{2}\\-[\\d]{2}) .*$") // | |
.assign((t, v) -> t.setDate(asDate(v.get("date")))) |
Merged now. There are two different document formats from different brokerage accounts. One is a regular account and one is a company stock plan account. |
.match("^(?!REFERENCE)(?!DESCRIPTION)(?<tickerSymbol>[A-Z]{2,5}).*$") // | ||
.assign((t, v) -> { | ||
t.setCurrencyCode(asCurrencyCode("USD")); | ||
v.put("currency", "USD"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the "$" to identify the currency. You can find the appropriate regex -> here <-.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no $ sign in the text :(
String date = v.get("date"); | ||
// convert month to camel case | ||
if (Character.isLetter(date.charAt(0))) | ||
{ | ||
date = date.charAt(0) + date.substring(1, 3).toLowerCase() + date.substring(3); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you use the ExtractorUtils correctly, we could save this part.
What did you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, as the DateFormatter expects "Dec" and the text from the bank statement is "DEC"
@Override | ||
protected long asShares(String value) | ||
{ | ||
String language = "de"; | ||
String country = "DE"; | ||
|
||
int lastDot = value.lastIndexOf("."); | ||
int lastComma = value.lastIndexOf(","); | ||
|
||
// returns the greater of two int values | ||
if (Math.max(lastDot, lastComma) == lastDot) | ||
{ | ||
language = "en"; | ||
country = "US"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if all "asShares" are in en_US you can remove this and use
.assign((t, v) -> t.setShares(asShares(v.get("shares"), "en", "US"))),
The same for "asAmount"... 👍🏻 ...
added Fidelity PDF import of trade confirmations (not monthly/quarterly statements)