Save all unmatched transfers as regular transactions
This commit is contained in:
parent
843dcd2536
commit
2843d8a2f1
@ -243,7 +243,12 @@ func (ynab *YNABImport) ImportTransactions(r io.Reader) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, openTransfer := range openTransfers {
|
for _, openTransfer := range openTransfers {
|
||||||
fmt.Printf("Found transfer from %s to %s on %s over %f\n", openTransfer.FromAccount, openTransfer.ToAccount, openTransfer.Date, openTransfer.Amount.GetFloat64())
|
fmt.Printf("Saving unmatched transfer from %s to %s on %s over %f as regular transaction\n", openTransfer.FromAccount, openTransfer.ToAccount, openTransfer.Date, openTransfer.Amount.GetFloat64())
|
||||||
|
_, err = ynab.queries.CreateTransaction(ynab.Context, openTransfer.CreateTransactionParams)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("could not save transaction %v: %w", openTransfer.CreateTransactionParams, err)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
fmt.Printf("Imported %d transactions\n", count)
|
fmt.Printf("Imported %d transactions\n", count)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user