mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 02:54:10 +00:00
Recurring scoping implementation (#1300)
* Recurring scoping implementation * FIX tests and reviews
This commit is contained in:
@@ -54,6 +54,7 @@ class TransactionsController < ApplicationController
|
||||
|
||||
# Load projected recurring transactions for next 10 days
|
||||
@projected_recurring = Current.family.recurring_transactions
|
||||
.accessible_by(Current.user)
|
||||
.active
|
||||
.where("next_expected_date <= ? AND next_expected_date >= ?",
|
||||
10.days.from_now.to_date,
|
||||
@@ -304,6 +305,7 @@ class TransactionsController < ApplicationController
|
||||
|
||||
# Check if a recurring transaction already exists for this pattern
|
||||
existing = Current.family.recurring_transactions.find_by(
|
||||
account_id: transaction.entry.account_id,
|
||||
merchant_id: transaction.merchant_id,
|
||||
name: transaction.merchant_id.present? ? nil : transaction.entry.name,
|
||||
currency: transaction.entry.currency,
|
||||
|
||||
Reference in New Issue
Block a user