You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this field, you can set for which month an income transaction
will be counted towards the available for budget sum.
This also updates the YNAB 4 importer to set the AvailableFrom field
to the following month for all transactions that are marked as
„Income for next month“ in YNAB 4.
Copy file name to clipboardExpand all lines: api/docs.go
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3257,6 +3257,11 @@ const docTemplate = `{
3257
3257
"multipleOf": 1e-8,
3258
3258
"example": 14.03
3259
3259
},
3260
+
"availableFrom": {
3261
+
"description": "The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.",
3262
+
"type": "string",
3263
+
"example": "2021-11-17:00:00:00Z"
3264
+
},
3260
3265
"budgetId": {
3261
3266
"type": "string",
3262
3267
"example": "55eecbd8-7c46-4b06-ada9-f287802fb05e"
@@ -3719,6 +3724,11 @@ const docTemplate = `{
3719
3724
"multipleOf": 1e-8,
3720
3725
"example": 14.03
3721
3726
},
3727
+
"availableFrom": {
3728
+
"description": "The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.",
Copy file name to clipboardExpand all lines: api/swagger.json
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3245,6 +3245,11 @@
3245
3245
"multipleOf": 1e-8,
3246
3246
"example": 14.03
3247
3247
},
3248
+
"availableFrom": {
3249
+
"description": "The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.",
3250
+
"type": "string",
3251
+
"example": "2021-11-17:00:00:00Z"
3252
+
},
3248
3253
"budgetId": {
3249
3254
"type": "string",
3250
3255
"example": "55eecbd8-7c46-4b06-ada9-f287802fb05e"
@@ -3707,6 +3712,11 @@
3707
3712
"multipleOf": 1e-8,
3708
3713
"example": 14.03
3709
3714
},
3715
+
"availableFrom": {
3716
+
"description": "The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.",
suite.Assert().Fail("Resource could not be saved", err)
109
+
}
99
110
100
-
assert.True(suite.T(), a.Balance.Equal(incomingTransaction.Amount.Sub(outgoingTransaction.Amount).Add(a.InitialBalance)), "Balance for account is not correct. Should be: %v but is %v", incomingTransaction.Amount.Sub(outgoingTransaction.Amount), a.Balance)
111
+
a:=account.WithCalculations(suite.db)
101
112
102
-
assert.True(suite.T(), a.ReconciledBalance.Equal(incomingTransaction.Amount.Add(a.InitialBalance)), "Reconciled balance for account is not correct. Should be: %v but is %v", incomingTransaction.Amount, a.ReconciledBalance)
113
+
expected:=incomingTransaction.Amount.Sub(outgoingTransaction.Amount).Add(a.InitialBalance).Add(decimal.NewFromFloat(100)) // Add 100 for futureIncomeTransaction
114
+
assert.True(suite.T(), a.Balance.Equal(expected), "Balance for account is not correct. Should be: %v but is %v", expected, a.Balance)
assert.True(suite.T(), a.ReconciledBalance.Equal(expected), "Reconciled balance for account is not correct. Should be: %v but is %v", expected, a.ReconciledBalance)
assert.True(suite.T(), balanceNow.Equal(decimal.NewFromFloat(184.72)), "Current balance for account is not correct. Should be: %v but is %v", decimal.NewFromFloat(184.72), balanceNow)
121
+
122
+
expected=decimal.NewFromFloat(284.72)
123
+
assert.True(suite.T(), balanceNow.Equal(expected), "Current balance for account is not correct. Should be: %v but is %v", expected, balanceNow)
124
+
125
+
expected=decimal.NewFromFloat(184.72)
126
+
assert.True(suite.T(), availableNow.Equal(expected), "Available balance for account is not correct. Should be: %v but is %v", expected, availableNow)
108
127
109
128
err=suite.db.Delete(&incomingTransaction).Error
110
129
iferr!=nil {
111
130
suite.Assert().Fail("Resource could not be deleted", err)
112
131
}
113
132
114
133
a=account.WithCalculations(suite.db)
115
-
assert.True(suite.T(), a.Balance.Equal(outgoingTransaction.Amount.Neg().Add(a.InitialBalance)), "Balance for account is not correct. Should be: %v but is %v", outgoingTransaction.Amount.Neg(), a.Balance)
116
-
assert.True(suite.T(), a.ReconciledBalance.Equal(decimal.NewFromFloat(0).Add(a.InitialBalance)), "Reconciled balance for account is not correct. Should be: %v but is %v", decimal.NewFromFloat(0), a.ReconciledBalance)
134
+
expected=outgoingTransaction.Amount.Neg().Add(a.InitialBalance).Add(decimal.NewFromFloat(100)) // Add 100 for futureIncomeTransaction
135
+
assert.True(suite.T(), a.Balance.Equal(expected), "Balance for account is not correct. Should be: %v but is %v", expected, a.Balance)
assert.True(suite.T(), a.ReconciledBalance.Equal(expected), "Reconciled balance for account is not correct. Should be: %v but is %v", expected, a.ReconciledBalance)
AvailableFrom types.Month`json:"availableFrom" example:"2021-11-17:00:00:00Z"`// The date from which on the transaction amount is available for budgeting. Only used for income transactions. Defaults to the transaction date.
0 commit comments