mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update Billable Periods automatically runs Update User Invoices immediately afterwards
This commit is contained in:
@@ -19,7 +19,7 @@ class Admin::AccountsAndBillingSettingsController < Spree::Admin::BaseController
|
||||
Spree::Config.set(params[:settings])
|
||||
|
||||
if params[:button] == "update_and_run_job"
|
||||
Delayed::Job.enqueue UpdateBillablePeriods.new({create_invoices: true})
|
||||
Delayed::Job.enqueue UpdateBillablePeriods.new
|
||||
end
|
||||
|
||||
flash[:success] = t(:successfully_updated, :resource => t(:billing_and_account_settings))
|
||||
|
||||
@@ -91,4 +91,8 @@ UpdateBillablePeriods = Struct.new("UpdateBillablePeriods") do
|
||||
|
||||
obsolete_billable_periods.each(&:delete)
|
||||
end
|
||||
|
||||
def success(job)
|
||||
Delayed::Job.enqueue UpdateUserInvoices.new
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user