cmd/ofx: Play nice with Fidelity

Fidelity (Netbenefits at least) returns an error of DTEND is the current
day, so request 'yesterday' by default.
This commit is contained in:
Aaron Lindsay 2017-03-28 19:42:16 -04:00
parent 0dc6f0ba8a
commit f51af6dd44
2 changed files with 10 additions and 6 deletions

View File

@ -52,10 +52,11 @@ func invDownload() {
BrokerId: ofxgo.String(brokerId),
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)), // a year ago
DtEnd: ofxgo.Date(time.Now().AddDate(0, 0, -1)), // Some FIs (*cough* Fidelity) return errors if DTEND is the current day
Include: true,
IncludeOO: true,
PosDtAsOf: ofxgo.Date(time.Now()),
IncludePos: true,
IncludeBalance: true,
Include401K: true,

View File

@ -38,12 +38,15 @@ func invTransactions() {
BrokerId: ofxgo.String(brokerId),
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)), // a year ago
DtEnd: ofxgo.Date(time.Now().AddDate(0, 0, -1)), // Some FIs (*cough* Fidelity) return errors if DTEND is the current day
Include: true,
IncludeOO: true,
PosDtAsOf: ofxgo.Date(time.Now()),
IncludePos: true,
IncludeBalance: true,
// TODO Include401K: true,
// TODO Include401KBal: true,
Include401K: true,
Include401KBal: true,
}
query.Investments = append(query.Investments, &statementRequest)