mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Add account activity to registrar
This commit is contained in:
parent
f2f2e42608
commit
32073ca862
15 changed files with 117 additions and 32 deletions
21
app/controllers/registrar/account_activities_controller.rb
Normal file
21
app/controllers/registrar/account_activities_controller.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
class Registrar::AccountActivitiesController < RegistrarController
|
||||
load_and_authorize_resource
|
||||
|
||||
# before_action :set_invoice, only: [:show]
|
||||
|
||||
def index
|
||||
account = current_user.registrar.cash_account
|
||||
@q = account.activities.search(params[:q])
|
||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||
@account_activities = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_invoice
|
||||
@invoice = Invoice.find(params[:id])
|
||||
end
|
||||
end
|
|
@ -4,7 +4,10 @@ class Registrar::InvoicesController < RegistrarController
|
|||
before_action :set_invoice, only: [:show]
|
||||
|
||||
def index
|
||||
@invoices = current_user.registrar.invoices.includes(:invoice_items).order(id: :desc)
|
||||
invoices = current_user.registrar.invoices.includes(:invoice_items, :account_activity)
|
||||
@q = invoices.search(params[:q])
|
||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||
@invoices = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue