Extract package

This commit is contained in:
2022-02-23 21:30:28 +00:00
parent d89a8f4e2e
commit 28c20aacd3
11 changed files with 81 additions and 69 deletions

View File

@ -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))