This commit is contained in:
1 parent
82f9c94d10
commit
7284545571
15 files changed
+292
-218
No files matched your search
+1
-1
@@ -56,7 +56,6 @@ func (c *Client) SetAccountBalance(accountID string, balance int) error {
|
||||
|
||||
balanceDelta := balance - ynabAccount.Data.Account.Balance
|
||||
balanceDelta += ynabTransactionAmount // Take into account the existing transaction
|
||||
|
||||
if balanceDelta == 0 {
|
||||
return nil // If balanceDelta is 0 do not create a transaction i.e. market is closed today
|
||||
}
|
||||
@@ -71,6 +70,7 @@ func (c *Client) SetAccountBalance(accountID string, balance int) error {
|
||||
|
||||
} else {
|
||||
// there is an existing transaction - so update the existing one
|
||||
|
||||
err = c.updateTodayYNABCapitalGainsTransaction(accountID, ynabTransactionID, balanceDelta)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update YNAB capital gains transaction for account ID '%s': %v", accountID, err)
|
||||
|
||||
Reference in new issue
Block a user