venue_management/app/views/venue_managements/show_data.html.erb

400 lines
19 KiB
Plaintext

<% # encoding: utf-8 %>
<% @@session = session %>
<%= yield %>
<%
data = action_data
@venue_management = data["venue_management"]
@sign_up = data["sign_up"]
@sign_up_time_range = data["sign_up_time_range"]
@venue_management_time_range = data["venue_management_time_range"]
@contribute_time_range = data["contribute_time_range"]
@contribute_action = data["contribute_action"]
@params = data['params']
%>
<table class="table table-striped venue_managementive-show-table">
<tbody >
<tr>
<th class="venue_managementive-title-field"><%= t(:category) %></th>
<td class="venue_managementive-title-value"><%= @venue_management.category.title %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('venue_management.event_during') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_time_range %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.title') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.title %></td>
</tr>
<% if !@venue_management.speaker.blank? #address %>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.speaker') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.speaker %></td>
</tr>
<% end %>
<% if !@venue_management.land_number.blank? %>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.land_number') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.land_number %></td>
</tr>
<% end %>
<% areas = ['land_area','building_area','area'] %>
<% areas.each do |area| %>
<% if !@venue_management.send(area).blank? %>
<tr>
<th class="venue_managementive-title-field"><%= t("venue_management.#{area}") %></th>
<td class="venue_managementive-title-value"><%= @venue_management.send(area) %></td>
</tr>
<% end %>
<% end %>
<% if !@venue_management.land_zoning.blank? %>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.land_zoning') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.land_zoning %></td>
</tr>
<% end %>
<% if !@venue_management.content.blank? %>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.content') %></th>
<td class="venue_managementive-title-value"><%= nl2br(@venue_management.content) %></td>
</tr>
<% end %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('venue_management.signup_during') %></th>
<td class="venue_managementive-title-value"><%= @sign_up_time_range %></td>
</tr>
<% if !@contribute_time_range.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('venue_management.contribute_during') %></th>
<td class="venue_managementive-title-value"><%= @contribute_time_range %></td>
</tr>
<% end %>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.signup') %></th>
<td class="venue_managementive-title-value"><%= @sign_up %><br /><%= @contribute_action %></td>
</tr>
<% if !@venue_management.act_place.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="icon-flag"></i><%= t('venue_management.act_place') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.act_place %></td>
</tr>
<% end %>
<% if !@venue_management.venue_management_files.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-fw fa-paperclip"></i><%= t(:file_) %></th>
<td class="venue_managementive-title-value">
<% @venue_management.venue_management_files.map do |file| %>
<%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %>
<% end %>
</td>
</tr>
<% end %>
<% if !@venue_management.venue_management_links.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-fw fa-link"></i><%= t(:link) %></th>
<td class="venue_managementive-title-value">
<% @venue_management.venue_management_links.map do |link| %>
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
<% end %>
</td>
</tr>
<% end %>
<% @venue_management.venue_management_item_contents.asc(:_id).each do |item_content| %>
<tr>
<th class="venue_managementive-title-field"><%= item_content.venue_management_item.title %></th>
<td class="venue_managementive-title-value"><%= item_content.content.html_safe %></td>
</tr>
<% end %>
<!-- 履約紀錄 -->
<% @venue_management_contract = @venue_management.venue_management_contracts.desc(:id).first %>
<% if !@venue_management_contract.nil? %>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.case_no') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.newest_case_no rescue "" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_tags %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.contractor') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_contractors %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.rents') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_contract.early_rent} / #{@venue_management_contract.operation_rent}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.royalty') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_royalty %></td>
</tr>
<tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.house_land_tax_payer') %></th>
<td class="venue_managementive-title-value"><%= t("vm_inviting.enums.#{@venue_management_contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_contract.land_tax_payer}") %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.renewal_permission') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.renewal_permission.present? ? t("vm_contract.renewal.#{@venue_management_contract.renewal_permission}") : t("vm_contract.renewal.false") %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.start_end') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_contract.contract_start_date} ~ #{@venue_management_contract.contract_end_date}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.construction_start_end') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_contract.construction_start_date} ~ #{@venue_management_contract.construction_end_date}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.operation_start_end') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_contract.operation_start_date} ~ #{@venue_management_contract.operation_end_date}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.free_period_start_end') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_contract.free_period_start_date} ~ #{@venue_management_contract.free_period_end_date}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.sign_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.sign_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.handover_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.handover_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.deposit_payment_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.deposit_payment_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.deposit_type') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.deposit_type %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.deposit_exp_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.deposit_exp_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.insurance_type') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_type %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_deadline') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_deadline %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.other_commitment') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.other_commitment %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.note') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.note %></td>
</tr>
<% if !@venue_management_contract.venue_management_files.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-fw fa-paperclip"></i><%= t(:file_) %></th>
<td class="venue_managementive-title-value">
<% @venue_management_contract.venue_management_files.map do |file| %>
<%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %>
<% end %>
</td>
</tr>
<% end %>
<% if !@venue_management_contract.venue_management_links.blank? %>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-fw fa-link"></i><%= t(:link) %></th>
<td class="venue_managementive-title-value">
<% @venue_management_contract.venue_management_links.map do |link| %>
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<br />
<ul class="venue_management-plugins nav nav-pills" role="tablist" data-list="plugins" data-level="0">
<li class=""><a href="#inviting_history" role="tab" data-toggle="tab" title="<%=t('venue_management.inviting_history')%>" aria-expanded="false"><%=t('venue_management.inviting_history')%></a></li>
<li class="active"><a href="#contract_history" role="tab" data-toggle="tab" title="<%=t('venue_management.contract_history')%>" aria-expanded="true"><%=t('venue_management.contract_history')%></a></li>
<li class=""><a href="#memorabilia" role="tab" data-toggle="tab" title="<%=t('venue_management.memorabilia')%>" aria-expanded="false"><%=t('venue_management.memorabilia')%></a></li>
<li class=""><a href="#bills" role="tab" data-toggle="tab" title="<%=t('venue_management.bills')%>" aria-expanded="false"><%=t('venue_management.bills')%></a></li>
</ul>
<div class="tab-content" data-list="plugins" data-level="0">
<div class="tab-pane active" id="contract_history">
<div class="info" data-list="plugin_data_intro" data-level="1">
</div>
<table class="table table-hover table-striped dt-responsive nowrap dataTable" id="table0">
<thead>
<tr data-list="pd_title" data-level="1">
<% @table_fields = [
'vm_contract.case_no',
'vm_contract.vendor',
'vm_contract.start_end',
'vm_contract.renewal_permission',
'vm_contract.note',
] %>
<% @table_fields.each do |th| %>
<th><%=t(th)%></th>
<% end %>
</tr>
</thead>
<tbody data-level="1" data-list="plugin_datas">
<% @contracts = @venue_management.venue_management_contracts.to_a %>
<% @contracts.each do |contract| %>
<tr>
<td>
<%= link_to contract.display_case_no, "/#{I18n.locale}"+@params[:url]+"/#{contract.display_case_no.to_s.strip}-#{contract.id}?method=show_contract" , :target => '_blank' %>
</td>
<td><%= contract.display_contractors %></td>
<td><%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %></td>
<td><%= contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false") %></td>
<td><%= contract.note %></td>
</tr>
<% end%>
</tbody>
</table>
</div>
<div class="tab-pane" id="memorabilia">
<div class="info" data-list="plugin_data_intro" data-level="1">
</div>
<%
@table_fields = [
'vm_memorabilia.case_no',
'vm_memorabilia.event_date',
'vm_memorabilia.details'
]
@memorabilias = @venue_management.venue_management_memorabilias.to_a
%>
<table class="table table-hover table-striped dt-responsive nowrap dataTable" id="table0">
<thead>
<tr data-list="pd_title" data-level="1">
<% @table_fields.each do |th| %>
<th><%=t(th)%></th>
<% end %>
</tr>
</thead>
<tbody data-level="1" data-list="plugin_datas">
<% @memorabilias.each do |memorabilia| %>
<tr data-level="2" data-list="pd_datas">
<td>
<%= link_to memorabilia.case_no, "/#{I18n.locale}"+@params[:url]+"/#{memorabilia.case_no.to_s.strip}-#{memorabilia.id}?method=show_memorabilia", :target => '_blank' %>
</td>
<td><%= memorabilia.event_date %></td>
<td><%= memorabilia.details %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="tab-pane" id="inviting_history">
<div class="info" data-list="plugin_data_intro" data-level="1">
</div>
<%
@table_fields = [
'vm_inviting.case_no',
'vm_inviting.publish_times',
'vm_inviting.rents',
'vm_inviting.royalty',
'vm_inviting.house_land_tax_payer',
'vm_inviting.contractor_manager',
'vm_inviting.bid_result',
]
@invitings = @venue_management.venue_management_invitings.to_a
%>
<table class="table table-hover table-striped dt-responsive nowrap dataTable" id="table0">
<thead>
<tr data-list="pd_title" data-level="1">
<% @table_fields.each do |th| %>
<th><%=t(th)%></th>
<% end %>
</tr>
</thead>
<tbody data-level="1" data-list="plugin_datas">
<% @invitings.each do |inviting| %>
<tr data-level="2" data-list="pd_datas">
<td>
<%= link_to inviting.display_case_no, "/#{I18n.locale}"+@params[:url]+"/#{inviting.display_case_no.strip}-#{inviting.id}?method=show_inviting", :target => '_blank' %>
</td>
<td><%= inviting.publish_times %></td>
<td><%= "#{inviting.early_rent} / #{inviting.operation_rent}" %></td>
<td><%= inviting.display_royalty %></td>
<td><%= t("vm_inviting.enums.#{inviting.house_tax_payer}") + "/" + t("vm_inviting.enums.#{inviting.land_tax_payer}") %></td>
<td><%= inviting.contractor_manager %></td>
<td><%= t("vm_inviting.enums.bid_result.#{inviting.bid_result}") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="tab-pane" id="bills">
<div class="info" data-list="plugin_data_intro" data-level="1">
</div>
<%
@table_fields = [
"contractor",
"accounting_month",
"bill_type",
"caculation_basis",
"reason",
"total_amount",
"pay_date",
"pay_method",
"note"
]
@bills = @venue_management.venue_management_bills.to_a
%>
<table class="table table-hover table-striped dt-responsive nowrap dataTable" id="table0">
<thead>
<tr data-list="pd_title" data-level="1">
<% @table_fields.each do |th| %>
<%=Admin::VenueManagementBillsHelper.thead(th)%>
<% end %>
</tr>
</thead>
<tbody data-level="1" data-list="plugin_datas">
<% @bills.each do |bill| %>
<tr>
<td>
<% contractors = bill.contractor.display_contractors rescue "" %>
<% contractors = t(:empty) if contractors.blank? %>
<%= link_to contractors, "/#{I18n.locale}"+@params[:url]+"/#{contractors.to_s.strip}-#{bill.id}?method=show_bill", :target => '_blank' %>
</td>
<td><%= bill.display_accounting_month %></td>
<td><%= "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}" %>
<% if bill.bill_typeB == 'other' && bill.bill_other.present? %>
-<%=bill.bill_other%>
<% end %>
</td>
<td><%= bill.display_caculation_basis %></td>
<td><%= bill.reason %></td>
<td><%= bill.total_amount %></td>
<td><%= bill.pay_date %></td>
<td><%= bill.pay_method %></td>
<td><%= bill.note %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>