mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 12:08:37 -04:00
Initial pass at OFX imports
Still needs some fixups: * UI is incomplete * Investment transactions are unbalanced initially * OFX imports don't detect if one of the description fields for a transaction is empty (to fall back on another) * I'm sure plenty of other issues I haven't discovered yet
This commit is contained in:
@ -2,15 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const (
|
||||
Banknote int64 = 1
|
||||
Bond = 2
|
||||
Stock = 3
|
||||
MutualFund = 4
|
||||
Currency int64 = 1
|
||||
Stock = 2
|
||||
)
|
||||
|
||||
type Security struct {
|
||||
@ -22,6 +21,8 @@ type Security struct {
|
||||
// security is precise to
|
||||
Precision int
|
||||
Type int64
|
||||
// AlternateId is CUSIP for Type=Stock
|
||||
AlternateId string
|
||||
}
|
||||
|
||||
type SecurityList struct {
|
||||
@ -1303,6 +1304,15 @@ func GetSecurity(securityid int64) *Security {
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetSecurityByName(name string) (*Security, error) {
|
||||
for _, value := range security_map {
|
||||
if value.Name == name {
|
||||
return value, nil
|
||||
}
|
||||
}
|
||||
return nil, errors.New("Invalid Security Name")
|
||||
}
|
||||
|
||||
func GetSecurities() []*Security {
|
||||
return security_list
|
||||
}
|
||||
|
Reference in New Issue
Block a user