~mendelmaleh/pfin

12c925e26eea0c49083a7c5f0ecd673ca7a59271 — Mendel E 3 months ago ca50e97
Invert amount, now positive for debits, negative for credits
M parser/amex/interface.go => parser/amex/interface.go +1 -2
@@ 11,8 11,7 @@ func (tx Transaction) Date() time.Time {
}

func (tx Transaction) Amount() float64 {
	// amex is inverted, positive is debit, negative is credit
	return -tx.Raw.Amount
	return tx.Raw.Amount
}

func (tx Transaction) Name() string {

M parser/bofa/interface.go => parser/bofa/interface.go +1 -1
@@ 11,7 11,7 @@ func (tx Transaction) Date() time.Time {
}

func (tx Transaction) Amount() float64 {
	return tx.Raw.Amount
	return -tx.Raw.Amount
}

func (tx Transaction) Name() string {

M parser/capitalone/interface.go => parser/capitalone/interface.go +2 -2
@@ 13,11 13,11 @@ func (tx Transaction) Date() time.Time {

func (tx Transaction) Amount() float64 {
	if tx.Debit != 0 {
		return -tx.Debit
		return tx.Debit
	}

	if tx.Credit != 0 {
		return tx.Credit
		return -tx.Credit
	}

	// TODO

M parser/chase/interface.go => parser/chase/interface.go +1 -1
@@ 14,7 14,7 @@ func (tx Transaction) Date() time.Time {
}

func (tx Transaction) Amount() float64 {
	return tx.Raw.Amount
	return -tx.Raw.Amount
}

func (tx Transaction) Name() string {

M parser/personal/interface.go => parser/personal/interface.go +0 -1
@@ 11,7 11,6 @@ func (tx Transaction) Date() time.Time {
}

func (tx Transaction) Amount() float64 {
	// TODO: should it be negative?
	return tx.Raw.Amount
}


M transaction.go => transaction.go +1 -1
@@ 6,7 6,7 @@ import (

type Transaction interface {
	Date() time.Time
	Amount() float64 // positive for credit, negative for debit
	Amount() float64 // positive for debit, negative for credit
	Name() string

	Category() string