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
fix: transaction filtering by direction and type (#1101)
Transaction filtering was incomplete and wrong so far, which is fixed with this change.
There are now two different filters, direction and type.
direction filters by the source/destination accounts being internal or external. It has the following values:
IN: Transaction from an external to an internal account
OUT: Transaction from an internal account to an external account
INTERNAL: Transaction from an internal to an internal account (same as the old direction: TRANSFER)
type filters by the effect a transaction has on the budget. It has the following values
INCOME: From an off-budget to an on-budget account (same as the old direction: INCOMING)
SPEND: From an on-budget to an off-budget account (same as the old direction: OUTGOING)
TRANSFER: From an on-budget to an on-budget account
{"Amount less or equal to 2.71", "amountLessOrEqual=2.71", 1},
238
+
{"Amount less or equal to 2.718", "amountLessOrEqual=2.718", 3},
239
+
{"Amount less or equal to 1000", "amountLessOrEqual=1000", 3},
240
+
{"Amount more or equal to 1 and less than 3", "amountMoreOrEqual=1&amountLessOrEqual=3", 3},
230
241
{"Amount more or equal to 2.718", "amountMoreOrEqual=2.718", 3},
231
242
{"Amount more or equal to 100 and less than 10", "amountMoreOrEqual=100&amountLessOrEqual=10", 0},
232
243
{"Amount more or equal to 100", "amountMoreOrEqual=100", 1},
233
244
{"Amount more or equal to 11235.813", "amountMoreOrEqual=11235.813", 1},
234
245
{"Amount more or equal to 99999", "amountMoreOrEqual=99999", 0},
235
-
{"Available after - no transactions", fmt.Sprintf("availableFromFromDate=%s", time.Date(2020, 7, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 1}, // Available from is only relevant for income, but set for all transactions
236
-
{"Available after - returns transactions", fmt.Sprintf("availableFromFromDate=%s", time.Date(2000, 12, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 3}, // Available from is only relevant for income, but set for all transactions
246
+
{"Available after - no transactions", fmt.Sprintf("availableFromFromDate=%s", time.Date(2020, 7, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 2}, // Available from is only relevant for income, but set for all transactions
247
+
{"Available after - returns transactions", fmt.Sprintf("availableFromFromDate=%s", time.Date(2000, 12, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 4}, // Available from is only relevant for income, but set for all transactions
237
248
{"Available at date - no transactions", fmt.Sprintf("availableFromDate=%s", time.Date(2016, 5, 2, 11, 17, 0, 0, time.UTC).Format(time.RFC3339Nano)), 0},
238
249
{"Available at month - with transaction", fmt.Sprintf("availableFromDate=%s", time.Date(2016, 5, 1, 12, 53, 15, 148041, time.UTC).Format(time.RFC3339Nano)), 1},
239
250
{"Available before - no transactions", fmt.Sprintf("availableFromUntilDate=%s", time.Date(2016, 4, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 0}, // Needs to be before 2016-05-01T00:00:00Z since that's what the transaction defaults to when created
240
-
{"Available before - returns transactions", fmt.Sprintf("availableFromUntilDate=%s", time.Date(2024, 12, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 3}, // Available from is only relevant for income, but set for all transactions
251
+
{"Available before - returns transactions", fmt.Sprintf("availableFromUntilDate=%s", time.Date(2024, 12, 1, 0, 0, 0, 0, time.UTC).Format(time.RFC3339Nano)), 4}, // Available from is only relevant for income, but set for all transactions
{"Not reconciled in destination account", "reconciledDestination=false", 2},
267
-
{"Not reconciled in source account", "reconciledSource=false", 2},
281
+
{"Not reconciled in destination account", "reconciledDestination=false", 3},
282
+
{"Not reconciled in source account", "reconciledSource=false", 3},
268
283
{"Note", "note=Not important", 1},
269
284
{"Offset and Fuzzy Note", "offset=2¬e=important", 0},
270
285
{"Offset higher than number", "offset=5", 0},
271
-
{"Offset positive", "offset=2", 1},
272
-
{"Offset zero", "offset=0", 3},
286
+
{"Offset positive", "offset=2", 2},
287
+
{"Offset zero", "offset=0", 4},
273
288
{"Reconciled in destination account", "reconciledDestination=true", 1},
274
289
{"Reconciled in source account", "reconciledSource=true", 1},
275
290
{"Regression - For 'account', query needs to be ORed between the accounts and ANDed with all other conditions", fmt.Sprintf("note=&account=%s", a2.Data.ID), 1},
0 commit comments