<% content_for :head do %> <%= stylesheet_link_tag "index" , :media => "all"%> <%= stylesheet_link_tag "filters" , :media => "all"%> <%= stylesheet_link_tag "materialsTable" , :media => "all"%> <%= javascript_include_tag 'jquery.dataTables' %> <%= stylesheet_link_tag "DataTables", :media => "all" %> <%= javascript_include_tag "table2CSV"%> <%= javascript_include_tag "dataTables.numericComma"%> <% end %>
<% form_tag "/soft/stats_payments", :method => :get do -%> Оплата: <%= select_tag(:filter_payments, options_for_select(Report.soft_get_money.insert(0, ['БЕЗ ИНН', 77]).insert(0, ['--- Все ---', "10"]), params[:filter_payments].to_i)) %> Документы: <%= select_tag(:filter_docs, options_for_select(Report.soft_get_docs.insert(0, ['--- Все ---', "10"]), (params[:filter_docs].to_i if params[:filter_docs]))) %> Категория: <%= select_tag(:category, options_for_select((Category.soft.collect{ |c| ["Софт: #{c.name}", c.id]}.sort).insert(0, ['--- Все ---', ""]), params[:category].to_i)) %> Деньги: <%= select_tag(:money_type, options_for_select([["Безнал", 10], ["Онлайн касса", 6]].insert(0, ['--- Все ---', 0]), params[:money_type].to_i)) -%>
<%= label_tag 'Дата с:' %><%= calendar_field_tag 'date_from', Russian::strftime(@date_from), { :class => 'plaintext', :size=> 9 }, {} %> <%= label_tag 'Дата по:' %><%= calendar_field_tag 'date_to', Russian::strftime(@date_to), { :class => 'plaintext', :size=> 9 }, {} %>
Только статистика:<%= check_box_tag 'only_static', value = true, checked = params[:only_static]%> <%= button_to "Фильтр" %> <% end %>
">

Отчет по безнальным документам:

<% for report in @reports do%> > <% end %>
# Отдел Категория Логин Наименование ИНН Дата работ Состав группы Сумма с клиента Оплачено по финн Процент yandex Признак оплаты Комментарий Редактировать
<%= link_to report.id, edit_soft_path(report), :target => 'blank' %> <%= report.department %> <%= report.category_name %> <%= report.name %> <%= link_to_function attr_for_edit(report.pay_name), "new_attr(#{report.id}, 'pay_name')" %> <%= link_to_function attr_for_edit(report.inn), "new_attr(#{report.id}, 'inn')" %> <%= Russian::strftime(report.date.to_date) %> <%= report.done_employees.map{|i| i.empl_name}.join(', ')%> <%= report.total_sum_get_money%> <%= report.finn_money%> <%= if report.get_money_status == 2 then (report.total_sum_get_money.to_f - report.finn_money.to_f) else 0 end %> <%= report.get_money_status_form %>
<%= (button_to_remote "Отказались платить", :url => { :action => "change_get_money_status", :id => report.id, :get_money_status => 3}, :confirm => "Сменить статус?") if report.get_money_status.to_i == 1 || report.get_money_status.to_i == 0 %> <%= (button_to_remote "Остаток это процент", :url => { :action => "change_get_money_status", :id => report.id, :finn_closed => true, :get_money_status => 2}, :confirm => "Поступлений больше не ожидается?") if report.get_money_status.to_i == 4 && report.money_type.to_i == 6 %> <%= (button_to_remote "Удалить процент", :url => { :action => "change_get_money_status", :id => report.id, :finn_closed => false, :get_money_status => 4}, :confirm => "Процент был указан неверно?") if report.get_money_status.to_i == 2 && report.money_type.to_i == 6 %> <%= (button_to_remote "Не оплачено", :url => { :action => "change_get_money_status", :id => report.id, :get_money_status => 0}, :confirm => "Сменить статус?") if report.get_money_status.to_i == 3 %>
<%= link_to_function (report.com_buh.to_s.blank? ? "Добавить" : report.com_buh.to_s), "new_attr(#{report.id}, 'com_buh')" %> <%= link_to_remote "Редактировать", :url => { :action => "edit_payment", :id => report.id}%>
Итого: <%= @reports.sum{|i|i.total_sum_get_money.to_f}%> <%= @reports.sum{|i|i.finn_money.to_f}%> <%= @reports.sum{|i| if i.get_money_status == 2 then (i.total_sum_get_money.to_f-i.finn_money.to_f) else 0 end}%>
<%= render :partial => 'stats_payment_stats', :locals => {:all_beznal => @all_beznal_soft, :dep => "soft"} %>