Slide 46
Slide 46 text
<%= component :page_header do |header| %>
<% header.breadcrumbs(@search.building) %>
<% header.actions do %>
<%= component :action_menu do |menu| %>
<% menu.action :new_transaction, new_building_transaction_path(@building) %>
<% menu.action :export_zip, building_transaction_path(@building, format: :zip, **@search.params) %>
<% menu.action :export_excel, building_transaction_path(@building, format: :xls, **@search.params) %>
<% menu.action :export_print, building_transaction_path(@building, variant: :print, **@search.params) %>
<% end %>
<% end %>
<% end %>
<%= component :filter_form, params: params do |form| %>
<% form.search :query %>
<% form.select :user_id, placeholder: :cashier, options: t_options(@search.user_options), classes: 'w-36' %>
<% form.select :source, placeholder: :source, options: @search.source_options, classes: 'w-56' %>
<% form.date_range :date %>
<% form.select :kind, placeholder: :kind, options: @search.kind_options %>
<% end %>
<%= component :stats do |c| %>
<% c.number :balance,
amount: format_money(@search.balance),
color: @search.balance.positive? ? :green : :red %>
<% c.number title: :cash_reserve,
amount: format_money(@search.cash_reserve_amount),
color: :gray %>
<% c.number title: :wallet_amount,
amount: format_money(@search.wallet_amount),
color: :gray %>
<% c.number title: :transaction_income,
amount: format_money(@search.income_amount),
color: :green %>
<% c.number title: :transaction_expense,
amount: format_money(@search.expense_amount),
color: :red %>
<% c.number title: :total_count,
amount: @search.total_count,
color: :gray %>
<% end %>
<%= component :table, @search.results do |table| %>
<% table.record :name, :itself %>
<% table.record :apartment %>
<% table.number :document do |record| %>
<% record.documents.each do |document| %>
<%= link_to document.display_number, document_path(document), class: 'link' %>
<% end %>
<% end %>
<% table.record :cashier, :user %>
<% table.date :date %>
<% table.money :cash_reserve_amount %>
<% table.money :wallet_amount %>
<% table.money :total_amount %>
<% table.column :kind do |record| %>
<%= component :transaction_kind_badge, record %>
<% end %>
<% table.actions do |record| %>
<%= button_details transaction_path(record) %>
<% end %>
<% end %>