Extract package
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"git.javil.eu/jacob1123/budgeteer/postgres/numeric"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
@ -43,8 +44,8 @@ func (ynab *YNABExport) ExportAssignments(context context.Context, w io.Writer)
|
||||
assignment.Group,
|
||||
assignment.Category,
|
||||
assignment.Amount.String() + "€",
|
||||
NewZeroNumeric().String() + "€",
|
||||
NewZeroNumeric().String() + "€",
|
||||
numeric.Zero().String() + "€",
|
||||
numeric.Zero().String() + "€",
|
||||
}
|
||||
|
||||
err := csv.Write(row)
|
||||
@ -129,9 +130,9 @@ func GetTransactionRow(transaction GetAllTransactionsForBudgetRow) []string {
|
||||
row = append(row, transaction.Memo)
|
||||
|
||||
if transaction.Amount.IsPositive() {
|
||||
row = append(row, NewZeroNumeric().String()+"€", transaction.Amount.String()+"€")
|
||||
row = append(row, numeric.Zero().String()+"€", transaction.Amount.String()+"€")
|
||||
} else {
|
||||
row = append(row, transaction.Amount.String()[1:]+"€", NewZeroNumeric().String()+"€")
|
||||
row = append(row, transaction.Amount.String()[1:]+"€", numeric.Zero().String()+"€")
|
||||
}
|
||||
|
||||
return append(row, string(transaction.Status))
|
||||
|
Reference in New Issue
Block a user