Update all files.

This commit is contained in:
BoHung Chiu 2020-11-12 21:51:31 +08:00
parent de83819ac3
commit b8bc1cbe7c
70 changed files with 5749 additions and 392 deletions

View File

@ -0,0 +1,6 @@
*{
display: none;
}
.print_text{
display: block;
}

View File

@ -0,0 +1,16 @@
# encoding: utf-8
class Admin::VenueAdminController < OrbitAdminController
#alias_method :org_datetime_picker, :datetime_picker
#include OrbitFormHelper
before_action :set_calendar_types,only: [:edit,:new,:copy]
def set_calendar_types
@calendar_types = CalendarType.all.collect{|v| [v.title,v.id.to_s]}
@module_pages = Page.where(:module => 'venue_management').collect{|p| [p.name,p.id] }
end
def initialize(*)
super
ActionView::Helpers::FormBuilder.send(:prepend,VenueAdminHelper)
@venue = 'venue'
end
end

View File

@ -0,0 +1,216 @@
class Admin::VenueManagementBillsController < Admin::VenueAdminController
include Admin::VenueManagementsHelper
include ActionView::Helpers::FormOptionsHelper
#include ActionView::Helpers::FormTagHelper #don't include this helper,or you will got an error when using redirect_to and url_for
#include ActionView::Helpers::FormHelper #don't include this helper,or you will got an error when using redirect_to and url_for
include VenueAdminHelper
include ActionView::Context
before_action ->(module_app = @app_title) { set_variables module_app }
before_action :set_venue_management_bill, only: [:edit, :update, :destroy]
def initialize
super
@app_title = 'venue_management'
end
def filter_fields(categories)
{
:category=>categories.map{|c| {:title=>(c.title.blank? ? " " : c.title), :id=>c.id}}
}
end
def index
@table_fields = [
'venue_management.title',
"contractor",
"accounting_month",
"bill_type",
"caculation_basis",
"reason",
"total_amount",
"pay_date",
"pay_method",
"note"
]
@bills = nil
@categories = @module_app.categories.enabled
@filter_fields = filter_fields(@categories)
@tags = @module_app.tags
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
bill_type_select_str = "<div class=\"controls\">"
value_bill_typeA = params[:filters]["bill_typeA"] rescue "0"
value_bill_typeB = params[:filters]["bill_typeB"] rescue "0"
bill_type_select_str += render_html('<%= select_tag "filters[bill_typeA]", options_for_select(VenueManagementBill::BILLTYPE.keys.map { |k| [ I18n.t("vm_bill.#{k}"), k ] },value_bill_typeA) ,{:onchange=>"var $this=this;(function(){var obj=#{VenueManagementBill::BILLTYPE.map{|k,v| [k,v.map{|vv| [vv,I18n.t("vm_bill.#{vv}")]}.to_h]}.to_h.to_s.gsub(\'=>\',\':\')};$($this).siblings(\'select\').html($.map(obj[$this.value],function(v,k){return \'<option value=\"\'+k+\'\">\'+v+\'</option>\'}).join(\' \'))})()"} %>',{:value_bill_typeA=>value_bill_typeA})
bill_typeB = (params[:filters]["bill_typeA"].blank? rescue true) ? VenueManagementBill::BILLTYPE.values.first : VenueManagementBill::BILLTYPE[params[:filters]["bill_typeA"]]
bill_type_select_str += render_html('<%= select_tag "filters[bill_typeB]", options_for_select(bill_typeB.map { |v| [ I18n.t("vm_bill.#{v}"), v ] },value_bill_typeB) , {:onchange=> "var $this=this;(function(){if($this.value == \'other\') $(\'#bill_other_field\').removeClass(\'hidden\');else $(\'#bill_other_field\').addClass(\'hidden\');})()"} %>',{:bill_typeB=>bill_typeB,:value_bill_typeB=>value_bill_typeB})
bill_type_select_str += render_html('<%= submit_tag(I18n.t(\'venue_management.search\')) %>')
bill_type_select_str += "</div>"
@filter_fields['vm_bill.bill_type'] = bill_type_select_str
@filter_fields['vm_bill.accounting_month'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[accounting_month_start]", {:no_label => true, :format=>"yyyy/MM", :new_record=>false, :value=>(DateTime.parse(params[:filters]["accounting_month_start"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[accounting_month_end]", {:no_label => true, :format=>"yyyy/MM", :new_record=>false, :value=>(DateTime.parse(params[:filters]["accounting_month_end"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
filter_bill
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial => 'index'
end
end
def filter_bill
@ext_filename = ""
@bills = nil
@categories = @module_app.categories.enabled
@filter_fields = filter_fields(@categories)
filter_tags = params[:filters]["type"].to_a rescue []
@main_ids = nil
if !filter_tags.blank?
@ext_filename += (I18n.t("vm_inviting.type") + ": #{Tag.where(:id.in=>filter_tags).map{|t| t.name}.join(',')}")
@main_ids = VenueManagementInviting.with_tags(filter_tags).pluck(:venue_management_main_id)
if !filters("category").blank?
@main_ids = VenueManagementMain.where(:id.in=>@main_ids).with_categories(filters("category")).pluck(:id)
end
elsif !filters("category").blank?
@ext_filename += (I18n.t(:category) + ": #{Category.where(:id.in=>filters("category")).map{|t| t.title}.join(',')}") if @ext_filename.blank?
@main_ids = VenueManagementMain.all.with_categories(filters("category")).pluck(:id)
end
if ( !params[:filters]["bill_typeA"].blank? rescue false)
@bills = VenueManagementBill.where(:bill_typeA=>params[:filters]["bill_typeA"],:bill_typeB=>params[:filters]["bill_typeB"]).page(params[:page]).per(10)
end
accounting_month_start = DateTime.parse(params[:filters]["accounting_month_start"]) rescue 0
accounting_month_end = DateTime.parse(params[:filters]["accounting_month_end"]) rescue 0
if(accounting_month_end != 0)
accounting_month_end = accounting_month_end + 1.month - 1.day
end
if @bills.nil?
if accounting_month_start != 0 && accounting_month_end != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{accounting_month_start}~#{accounting_month_end}") if @ext_filename.blank?
@bills = VenueManagementBill.where(:accounting_month.gte=>accounting_month_start,:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
elsif accounting_month_start != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{accounting_month_start}~") if @ext_filename.blank?
@bills = VenueManagementBill.where(:accounting_month.gte=>accounting_month_start).page(params[:page]).per(10)
elsif accounting_month_end != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": ~#{accounting_month_end}") if @ext_filename.blank?
@bills = VenueManagementBill.where(:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
end
else
if accounting_month_start != 0 && accounting_month_end != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{accounting_month_start}~#{accounting_month_end}") if @ext_filename.blank?
@bills = @bills.where(:accounting_month.gt=>accounting_month_start,:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
elsif accounting_month_start != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{accounting_month_start}~") if @ext_filename.blank?
@bills = @bills.where(:accounting_month.gt=>accounting_month_start).page(params[:page]).per(10)
elsif accounting_month_end != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": ~#{accounting_month_end}") if @ext_filename.blank?
@bills = @bills.where(:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
end
end
if !@main_ids.nil?
if @bills.nil?
@bills = VenueManagementBill.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
else
@bills = @bills.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
end
end
if @bills.nil? && params[:id].blank?
@bills = VenueManagementBill.all.page(params[:page]).per(10)
elsif @bills.nil?
@bills = VenueManagementBill.where(:venue_management_main_id=>params[:id])
elsif !params[:id].blank?
@bills = @bills.where(:venue_management_main_id=>params[:id])
end
if params[:keywords].present?
@main_ids = @bills.pluck(:venue_management_main_id)
@venue_managements = VenueManagementMain.where(:id.in=>@main_ids)
if params[:keywords] == I18n.t(:empty)
ids = @bills.map{|bill| ((bill.contractor.display_contractors.blank?) rescue true) ? bill.id : nil }
else
ids = @bills.map{|bill| (bill.contractor.display_contractors.include?(params[:keywords]) rescue false) ? bill.id : nil }
end
@main_ids = search_data(@venue_managements,[:title]).pluck(:id)
ids1 = VenueManagementBill.where(:venue_management_main_id.in=>@main_ids).pluck(:id)
@bills = VenueManagementBill.where(:id.in=>(ids + ids1)).page(params[:page]).per(10)
end
end
def new
@venue_management = VenueManagementMain.find(params[:id])
@venue_management_bill = VenueManagementBill.new(venue_management_main_id: params[:id])
end
def create
@venue_management_bill = VenueManagementBill.new(venue_management_bill_params)
@venue_management_bill.save
redirect_to params['referer_url']
end
def edit
@venue_management = VenueManagementMain.find(@venue_management_bill.venue_management_main_id)
end
def copy
@venue_management_bill_to_copy = VenueManagementBill.find(params[:id])
attributes = @venue_management_bill_to_copy.attributes.except("_id","updated_at","created_at")
VenueManagementBill.fields.each do |k,v|
if v.options[:localize]
attributes.delete k
attributes[k+"_translations"] = @venue_management_bill_to_copy[k]
elsif attributes[k].class == Hash
attributes[k] = BSON::Document.new(attributes[k])
end
end
@venue_management_bill = VenueManagementBill.new(attributes)
#render :html =>attributes and return
@venue_management = VenueManagementMain.find(@venue_management_bill_to_copy.venue_management_main_id)
end
def update
@venue_management_bill.update_attributes(venue_management_bill_params)
redirect_to venue_management_bills_admin_venue_management_path(@venue_management_bill.venue_management_main_id)
end
def destroy
@venue_management_main_id = @venue_management_bill.venue_management_main_id
@venue_management_bill.destroy
redirect_to venue_management_bills_admin_venue_management_path(@venue_management_main_id)
end
def render_html(code,pass_variables={})
render_to_string(:inline=>code,:locals=>pass_variables)
end
def export
filter_bill
@bills = @bills.page(1).per(@bills.count)
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
@host = "#{@protocol}://#{request.host_with_port}"
@site_in_use_locales = Site.first.in_use_locales
@ext_filename = "export_bills" if @ext_filename.blank?
@ext_filename = @ext_filename + "_export.xlsx"
@id = params[:id]
respond_to do |format|
format.xlsx {
response.headers['Content-Transfer-Encoding'] = 'binary'
response.headers['Content-Type'] = 'binary/octet-stream'
response.headers['Content-Disposition'] = 'attachment; filename="' + @ext_filename + '"'
}
end
render :layout => false
# file_path = "tmp/cache/#{@ext_filename}"
# File.open(file_path, 'w') do |f|
# f.write render_to_string( handlers: [:axlsx], formats: [:xlsx] ,locals: {:@bills=>@bills,:@protocol=>@protocol,:@host=>@host,:@site_in_use_locales=>@site_in_use_locales}, :layout=>false )
# end
# send_file file_path
end
private
def set_venue_management_bill
@venue_management_bill = VenueManagementBill.find(params[:id])
end
def venue_management_bill_params
params.require(:venue_management_bill).permit!
end
def venue_management_bill_params
params.require(:venue_management_bill).permit!
end
end

View File

@ -0,0 +1,189 @@
# frozen_string_literal: true
class Admin::VenueManagementContractsController < Admin::VenueAdminController
include Admin::VenueManagementsHelper
before_action ->(module_app = @app_title) { set_variables module_app }
before_action :set_venue_management_contract, only: [:edit, :update, :destroy]
def filter_fields(categories)
{
:category=>categories.map{|c| {:title=>(c.title.blank? ? " " : c.title), :id=>c.id}}
}
end
def initialize
super
@app_title = 'venue_management'
end
def fetch_inviting
invitings = VenueManagementInviting.where(id: params[:id])
data = {}
if !invitings.first.nil?
key = [:early_rent,:operation_rent,:royalty,:house_tax_payer,:land_tax_payer]
invitings.pluck(*key)[0].each_with_index do |v,i|
data[key[i]] = v
end
end
render :json => data
end
def index
@table_fields = [
'venue_management.title',
'vm_contract.case_no',
'vm_inviting.type',
'vm_contract.vendor',
'vm_inviting.rents',
'vm_inviting.royalty',
'vm_contract.start_end',
'vm_contract.deposit_amount_type_exp_date',
'vm_contract.renewal_permission',
'vm_contract.other_commitment',
'vm_contract.note'
]
@filter_fields = filter_fields(@categories)
@tags = @module_app.tags
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
@filter_fields['vm_contract.start_end'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[contract_start_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["contract_start_date"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[contract_end_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["contract_end_date"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
filter_contract
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial => 'index'
end
end
def filter_contract
@ext_filename = ""
filter_tags = params[:filters]["type"].to_a rescue []
@main_ids = nil
@inviting_ids = nil
if !filter_tags.blank?
@ext_filename += (I18n.t("vm_bill.type") + ": #{Tag.where(:id.in=>filter_tags).map{|t| t.name}.join(',')}")
@inviting_ids = VenueManagementInviting.with_tags(filter_tags).pluck(:id)
end
if !filters("category").blank?
@ext_filename += (I18n.t(:category) + ": #{Category.where(:id.in=>filters("category")).map{|t| t.title}.join(',')}") if @ext_filename.blank?
@main_ids = VenueManagementMain.all.with_categories(filters("category")).pluck(:id)
end
contract_start_date = DateTime.parse(params[:filters]["contract_start_date"]) rescue 0
contract_end_date = DateTime.parse(params[:filters]["contract_end_date"]) rescue 0
if @contracts.nil?
if contract_start_date != 0 && contract_end_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{contract_start_date}~#{contract_end_date}") if @ext_filename.blank?
@contracts = VenueManagementContract.where(:contract_start_date.gte=>contract_start_date,:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
elsif contract_start_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{contract_start_date}~") if @ext_filename.blank?
@contracts = VenueManagementContract.where(:contract_start_date.gte=>contract_start_date).page(params[:page]).per(10)
elsif contract_end_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": ~#{contract_end_date}") if @ext_filename.blank?
@contracts = VenueManagementContract.where(:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
end
else
if contract_start_date != 0 && contract_end_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{contract_start_date}~#{contract_end_date}") if @ext_filename.blank?
@contracts = @contracts.where(:contract_start_date.gte=>contract_start_date,:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
elsif contract_start_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": #{contract_start_date}~") if @ext_filename.blank?
@contracts = @contracts.where(:contract_start_date.gte=>contract_start_date).page(params[:page]).per(10)
elsif contract_end_date != 0
@ext_filename += (I18n.t("vm_bill.accounting_month") + ": ~#{contract_end_date}") if @ext_filename.blank?
@contracts = @contracts.where(:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
end
end
if !@main_ids.nil?
if @contracts.nil?
@contracts = VenueManagementContract.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
else
@contracts = @contracts.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
end
end
if @contracts.nil?
@contracts = VenueManagementContract.all.page(params[:page]).per(10)
end
if !@inviting_ids.nil?
@contracts = @contracts.where(:venue_management_inviting_id.in=>@inviting_ids)
end
if params[:id].present?
@ext_filename = "#{VenueManagementMain.find(params[:id]).title rescue ''}_export_invitings" if @ext_filename.blank?
@contracts = @contracts.and(:venue_management_main_id=>params[:id])
end
if params[:keywords].present?
@main_ids = @contracts.pluck(:venue_management_main_id)
@venue_managements = VenueManagementMain.where(:id.in=>@main_ids)
@main_ids = search_data(@venue_managements,[:title]).pluck(:id)
if params[:keywords] == I18n.t(:empty)
@contracts = @contracts.where(:case_no=>"")
else
@contracts = search_data(@contracts,[:case_no])
end
ids = @contracts.pluck(:id)
ids1 = VenueManagementContract.where(:venue_management_main_id.in=>@main_ids).pluck(:id)
@contracts = VenueManagementContract.where(:id.in=>(ids + ids1)).page(params[:page]).per(10)
end
@contracts = @contracts.order(updated_at: :desc).page(params[:page]).per(10)
end
def render_html(code,pass_variables={})
render_to_string(:inline=>code,:locals=>pass_variables)
end
def new
@venue_management = VenueManagementMain.find(params[:id])
@venue_management_contract = @venue_management.venue_management_contracts.build
end
def create
OrbitHelper.set_params(params,current_user)
@venue_management_contract = VenueManagementContract.new(venue_management_contract_params)
@venue_management_contract.save
redirect_to params['referer_url']
end
def edit
@venue_management = VenueManagementMain.find(@venue_management_contract.venue_management_main_id)
end
def update
OrbitHelper.set_params(params,current_user)
@venue_management_contract.update_attributes!(venue_management_contract_params)
redirect_to venue_management_contracts_admin_venue_management_path(@venue_management_contract.venue_management_main_id)
end
def destroy
@venue_management_main_id = @venue_management_contract.venue_management_main_id
@venue_management_contract.destroy
redirect_to venue_management_contracts_admin_venue_management_path(@venue_management_main_id)
end
def export
filter_contract
@contracts = @contracts.order(updated_at: :desc).page(1).per(@contracts.count)
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
@host = "#{@protocol}://#{request.host_with_port}"
@site_in_use_locales = Site.first.in_use_locales
@ext_filename = "export_contracts" if @ext_filename.blank?
@ext_filename = @ext_filename + "_export.xlsx"
@id = params[:id]
respond_to do |format|
format.xlsx {
response.headers['Content-Transfer-Encoding'] = 'binary'
response.headers['Content-Type'] = 'binary/octet-stream'
response.headers['Content-Disposition'] = 'attachment; filename="' + @ext_filename + '"'
}
end
render :layout => false
end
private
def set_venue_management_contract
@venue_management_contract = VenueManagementContract.find(params[:id])
end
def venue_management_contract_params
contract_params = params.require(:venue_management_contract).permit!
contract_params["contractor_ids"] = [] if contract_params["contractor_ids"].nil?
return contract_params
end
end

View File

@ -0,0 +1,138 @@
# frozen_string_literal: true
class Admin::VenueManagementInvitingsController < Admin::VenueAdminController
include Admin::VenueManagementsHelper
before_action ->(module_app = @app_title) { set_variables module_app }
before_action :set_venue_management_inviting, only: [:edit, :update, :destroy]
def initialize
super
@app_title = 'venue_management'
end
def index
@table_fields = [
'venue_management.title',
'vm_inviting.case_no',
'vm_inviting.type',
'vm_inviting.publish_times',
'vm_inviting.start_end',
'vm_inviting.rents',
'vm_inviting.royalty',
'vm_inviting.house_land_tax_payer',
'vm_inviting.contractor_manager',
'vm_inviting.bid_result',
'vm_inviting.details'
]
@tags = @module_app.tags
@filter_fields = {}
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
@filter_fields['vm_inviting.start_end'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[start_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["start_date"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[end_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["end_date"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
filter_inviting
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial => 'index'
end
end
def filter_inviting
@ext_filename = ""
filter_tags = params[:filters]["type"].to_a rescue []
start_date = DateTime.parse(params[:filters]["start_date"]) rescue 0
end_date = DateTime.parse(params[:filters]["end_date"]) rescue 0
@invitings = VenueManagementInviting.with_tags(filter_tags).order(updated_at: :desc).page(params[:page]).per(10)
@ext_filename += (I18n.t("vm_inviting.type") + ": #{Tag.where(:id.in=>filter_tags).map{|t| t.name}.join(',')}") if !filter_tags.blank?
if start_date != 0 && end_date != 0
@ext_filename += (I18n.t("vm_inviting.start_end") + ": #{start_date}~#{end_date}") if @ext_filename.blank?
@invitings = @invitings.where(:start_date.gte=>start_date,:end_date.lte=>end_date).page(params[:page]).per(10)
elsif start_date != 0
@ext_filename += (I18n.t("vm_inviting.start_end") + ": #{start_date}~") if @ext_filename.blank?
@invitings = @invitings.where(:start_date.gte=>start_date).page(params[:page]).per(10)
elsif end_date != 0
@ext_filename += (I18n.t("vm_inviting.start_end") + ": ~#{end_date}") if @ext_filename.blank?
@invitings = @invitings.where(:end_date.lte=>end_date).page(params[:page]).per(10)
end
if params[:id].present?
@ext_filename = "#{VenueManagementMain.find(params[:id]).title rescue ''}_export_invitings" if @ext_filename.blank?
@invitings = @invitings.where(:venue_management_main_id=>params[:id])
end
if params[:keywords].present?
@main_ids = @invitings.pluck(:venue_management_main_id)
@venue_managements = VenueManagementMain.where(:id.in=>@main_ids)
@main_ids = search_data(@venue_managements,[:title]).pluck(:id)
if params[:keywords] == I18n.t(:empty)
@invitings = @invitings.where(:case_no=>"")
else
@invitings = search_data(@invitings,[:case_no])
end
ids = @invitings.pluck(:id)
ids1 = VenueManagementInviting.where(:venue_management_main_id.in=>@main_ids).pluck(:id)
@invitings = VenueManagementInviting.where(:id.in=>(ids + ids1)).page(params[:page]).per(10)
end
end
def new
@venue_management = VenueManagementMain.find(params[:id])
@venue_management_inviting = @venue_management.venue_management_invitings.build
end
def create
@venue_management_inviting = VenueManagementInviting.new(venue_management_inviting_params)
@venue_management_inviting.save
redirect_to params['referer_url']
end
def edit
@venue_management = VenueManagementMain.find(@venue_management_inviting.venue_management_main_id)
end
def update
@venue_management_inviting.update_attributes(venue_management_inviting_params)
redirect_to venue_management_invitings_admin_venue_management_path(@venue_management_inviting.venue_management_main_id)
end
def destroy
@venue_management_main_id = @venue_management_inviting.venue_management_main_id
@venue_management_inviting.destroy
redirect_to venue_management_invitings_admin_venue_management_path(@venue_management_main_id)
end
def render_html(code,pass_variables={})
render_to_string(:inline=>code,:locals=>pass_variables)
end
def export
filter_inviting
@invitings = @invitings.page(1).per(@invitings.count)
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
@host = "#{@protocol}://#{request.host_with_port}"
@site_in_use_locales = Site.first.in_use_locales
@ext_filename = "export_invitings" if @ext_filename.blank?
@ext_filename = @ext_filename + "_export.xlsx"
@id = params[:id]
respond_to do |format|
format.xlsx {
response.headers['Content-Transfer-Encoding'] = 'binary'
response.headers['Content-Type'] = 'binary/octet-stream'
response.headers['Content-Disposition'] = 'attachment; filename="' + @ext_filename + '"'
}
end
render :layout => false
end
private
def set_venue_management_inviting
@venue_management_inviting = VenueManagementInviting.find(params[:id])
end
def venue_management_inviting_params
inviting_params = params.require(:venue_management_inviting).permit!
inviting_params["tags"] = [] if inviting_params["tags"].nil?
return inviting_params
end
end

View File

@ -0,0 +1,82 @@
class Admin::VenueManagementMemorabiliasController < Admin::VenueAdminController
include Admin::VenueManagementsHelper
before_action ->(module_app = @app_title) { set_variables module_app }
before_action :set_venue_management_memorabilia, only: [:edit, :update, :destroy]
def initialize
super
@app_title = 'venue_management'
end
def index
@table_fields = [
'venue_management.title',
'vm_memorabilia.case_no',
'vm_memorabilia.event_date',
'vm_memorabilia.details',
]
filter_memorabilia
@memorabilias = @memorabilias.order(updated_at: :desc).page(params[:page]).per(10)
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial => 'index'
end
end
def filter_memorabilia
@memorabilias = VenueManagementMemorabilia.all
@filter_fields = {}
if params[:keywords].present?
@main_ids = @memorabilias.pluck(:venue_management_main_id)
@invintings = VenueManagementInviting.where(:id.in => VenueManagementMemorabilia.all.pluck(:venue_management_inviting_id))
@venue_managements = VenueManagementMain.where(:id.in=>@main_ids)
@main_ids = search_data(@venue_managements,[:title]).pluck(:id)
if params[:keywords] == I18n.t(:empty)
@invintings = @invintings.where(:case_no=>"")
else
@invintings = search_data(@invintings,[:case_no])
end
ids = VenueManagementMemorabilia.where(:venue_management_inviting_id.in=>@invintings.pluck(:id)).pluck(:id)
ids1 = VenueManagementMemorabilia.where(:venue_management_main_id.in=>@main_ids).pluck(:id)
ids2 = VenueManagementMemorabilia.where(:venue_management_inviting_id =>nil ).pluck(:id)
@memorabilias = VenueManagementMemorabilia.where(:id.in=>(ids + ids1 + ids2))
end
end
def new
@venue_management = VenueManagementMain.find(params[:id])
@venue_management_memorabilia = VenueManagementMemorabilia.new(venue_management_main_id: params[:id])
end
def create
@venue_management_memorabilia = VenueManagementMemorabilia.new(venue_management_memorabilia_params)
@venue_management_memorabilia.save
redirect_to params['referer_url']
end
def edit
@venue_management = VenueManagementMain.find(@venue_management_memorabilia.venue_management_main_id)
end
def update
@venue_management_memorabilia.update_attributes(venue_management_memorabilia_params)
redirect_to venue_management_memorabilias_admin_venue_management_path(@venue_management_memorabilia.venue_management_main_id)
end
def destroy
@venue_management_main_id = @venue_management_memorabilia.venue_management_main_id
@venue_management_memorabilia.destroy
redirect_to venue_management_memorabilias_admin_venue_management_path(@venue_management_main_id)
end
private
def set_venue_management_memorabilia
@venue_management_memorabilia = VenueManagementMemorabilia.find(params[:id])
end
def venue_management_memorabilia_params
params.require(:venue_management_memorabilia).permit!
end
end

View File

@ -1,11 +1,14 @@
# encoding: utf-8 # encoding: utf-8
class Admin::VenueManagementsController < OrbitAdminController class Admin::VenueManagementsController < Admin::VenueAdminController
include ActionView::Helpers::FormOptionsHelper
#include ActionView::Helpers::FormTagHelper #don't include this helper,or you will got an error when using redirect_to and url_for
#include ActionView::Helpers::FormHelper #don't include this helper,or you will got an error when using redirect_to and url_for
include VenueAdminHelper
include ActionView::Context
require 'axlsx' require 'axlsx'
helper Admin::VenueManagementsFieldHelper helper Admin::VenueManagementsFieldHelper
before_action ->(module_app = @app_title) { set_variables module_app } before_action ->(module_app = @app_title) { set_variables module_app }
before_action :set_venue_management, only: [:edit, :set_write_off, :venue_management_signup, :destroy] before_action :set_venue_management, only: [:edit, :set_write_off, :venue_management_signup, :destroy, :venue_management_invitings, :venue_management_memorabilias, :venue_management_bills, :venue_management_contracts]
def initialize def initialize
super super
@app_title = "venue_management" @app_title = "venue_management"
@ -20,35 +23,92 @@ class Admin::VenueManagementsController < OrbitAdminController
def index def index
@categories = @module_app.categories.enabled @categories = @module_app.categories.enabled
@filter_fields = filter_fields(@categories) @filter_fields = filter_fields(@categories)
@table_fields = [:category, 'venue_management.title', 'venue_management.event_during', 'venue_management.signup_during', 'venue_management.signup_count', 'venue_management.inviting_hostory', 'venue_management.memorabilia','venue_management.export'] @table_fields = [ :category,
'vm_inviting.type',
if !params[:sort].blank? 'venue_management.title',
"venue_management.contractor",
'venue_management.event_during',
'venue_management.signup_during',
'venue_management.inviting_history',
'venue_management.contract_history',
'venue_management.memorabilia',
'venue_management.bills',
'venue_management.export'
]
@filter_fields["vm_inviting.type"] = @module_app.tags.map{|t| {:title => t.name,:id => t.id} }
if !params[:sort].blank?
if params[:sort] == 'event_during' if params[:sort] == 'event_during'
sort = {:venue_management_start_date.to_sym=>params[:order]} sort = {:venue_management_start_date.to_sym=>params[:order]}
elsif params[:sort] == 'signup_during' elsif params[:sort] == 'signup_during'
sort = {:signup_start_date.to_sym=>params[:order]} sort = {:signup_start_date.to_sym=>params[:order]}
else else
sort = {params[:sort].to_sym=>params[:order]} sort = {params[:sort].to_sym=>params[:order]}
end end
else else
sort = {:signup_start_date=>"desc"} sort = {:signup_start_date=>"desc"}
end end
filter_tags = params[:filters][:type].to_a rescue []
if filter_tags.empty?
@venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category"))
@venue_managements = search_data(@venue_managements,[:title]).page(params[:page]).per(10)
else
@venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category"))
@venue_managements = search_data(@venue_managements,[:title])
@venue_management_inviting_ids = @venue_managements.map{|v| v.venue_management_invitings.desc(:id).first.id rescue ""}
@venue_management_ids = VenueManagementInviting.where(:id.in=>@venue_management_inviting_ids).with_tags(filter_tags).pluck(:venue_management_main_id)
@venue_managements = VenueManagementMain.where(:id.in=>@venue_management_ids).page(params[:page]).per(10)
end
@venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category"))
@venue_managements = search_data(@venue_managements,[:title]).page(params[:page]).per(10)
if request.xhr? if request.xhr?
render :partial => "index" render :partial => "index"
end end
end end
def print_pdf
time_now = Time.now
venue_management = VenueManagementMain.find(params[:id])
if !venue_management.registration_status.blank? && venue_management.signup_start_date <= time_now && ( venue_management.signup_end_date.nil? || venue_management.signup_end_date+1 >= time_now )
sign_up = ('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '" target="_blank">' + t('venue_management.signup') + '</a>').html_safe
elsif venue_management.registration_status.blank?
sign_up = t('venue_management.sign_up_not_open')
elsif venue_management.signup_start_date > time_now
sign_up = t('venue_management.sign_up_not_yet')
else
sign_up = t('venue_management.sign_up_overdue')
end
if !venue_management.registration_status.blank? && venue_management.registration_status.include?('C') && venue_management.contribute_start_date <= time_now && ( venue_management.contribute_end_date.nil? || venue_management.contribute_end_date+1 >= time_now )
if !@@session[:venue_management_signup_id].blank?
if @@session[:venue_management_main_id] == venue_management.id
contribute_action = ('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_upload">' + t('venue_management_signup.uploads') + '</a>').html_safe
else
contribute_action = ('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_login">' + t('venue_management_signup.con_login') + '</a>').html_safe
end
else
contribute_action = ('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_login">' + t('venue_management_signup.con_login') + '</a>').html_safe
end
end
@venue_management = venue_management
@sign_up = sign_up
@contribute_action = contribute_action
@time_now = time_now
@contribute_time_range = VenueManagementMain.time_range(venue_management.contribute_start_date, venue_management.contribute_end_date)
@sign_up_time_range = venue_management.display_signup_during
@venue_management_time_range = venue_management.display_event_during
@params = params
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if params[:type] == "print"
render "print_pdf" , :layout => false
end
end
def export def export
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)
@host = "#{@protocol}://#{request.host_with_port}"
@venue_management = VenueManagementMain.find(params[:id]) @venue_management = VenueManagementMain.find(params[:id])
@venue_management_signups = VenueManagementSignup.where(:venue_management_main_id => params[:id]) @venue_management_signups = VenueManagementSignup.where(:venue_management_main_id => params[:id])
filename = @venue_management.title.parameterize.underscore + "_export.xlsx" @site_in_use_locales = Site.first.in_use_locales
filename = @venue_management.title.to_s.strip + "_export.xlsx"
respond_to do |format| respond_to do |format|
format.xlsx { format.xlsx {
response.headers['Content-Disposition'] = 'attachment; filename="' + filename + '"' response.headers['Content-Disposition'] = 'attachment; filename="' + filename + '"'
@ -72,13 +132,13 @@ class Admin::VenueManagementsController < OrbitAdminController
end end
def create def create
if !venue_management_params['venue_management_links_attributes'].nil? venue_management_main_params = venue_management_params
venue_management_params['venue_management_links_attributes'].each do |idx,link| if !venue_management_main_params['venue_management_links_attributes'].nil?
venue_management_params['venue_management_links_attributes'].delete(idx.to_s) if link['url'].blank? venue_management_main_params['venue_management_links_attributes'].each do |idx,link|
venue_management_main_params['venue_management_links_attributes'].delete(idx.to_s) if link['url'].blank?
end end
end end
venue_management_main_params = venue_management_params
venue_management_signup_set_params = venue_management_main_params['venue_management_signup_field_sets'] venue_management_signup_set_params = venue_management_main_params['venue_management_signup_field_sets']
venue_management_submission_set_params = venue_management_main_params['venue_management_submission_field_sets'] venue_management_submission_set_params = venue_management_main_params['venue_management_submission_field_sets']
venue_management_email_sets_params = venue_management_main_params['venue_management_email_sets'] venue_management_email_sets_params = venue_management_main_params['venue_management_email_sets']
@ -139,7 +199,7 @@ class Admin::VenueManagementsController < OrbitAdminController
params[:venue_management_main][:registration_status] = (params[:venue_management_main][:registration_status] ? params[:venue_management_main][:registration_status] : []) params[:venue_management_main][:registration_status] = (params[:venue_management_main][:registration_status] ? params[:venue_management_main][:registration_status] : [])
uid = params[:id].split('-').last uid = params[:id].split('-').last
@venue_management = VenueManagementMain.find_by(:uid=>uid) @venue_management = VenueManagementMain.find_by(:uid=>uid)
@ -165,25 +225,26 @@ class Admin::VenueManagementsController < OrbitAdminController
@venue_management.venue_management_submission_fields.each{|t| t.destroy if t["to_delete"] == true} @venue_management.venue_management_submission_fields.each{|t| t.destroy if t["to_delete"] == true}
redirect_to admin_venue_managements_path redirect_to admin_venue_managements_path
else else
venue_management_main_params = venue_management_params
if !venue_management_params['venue_management_links_attributes'].nil? if !venue_management_main_params['venue_management_links_attributes'].nil?
venue_management_params['venue_management_links_attributes'].each do |idx,link| venue_management_main_params['venue_management_links_attributes'].each do |idx,link|
venue_management_params['venue_management_links_attributes'].delete(idx.to_s) if link['url'].blank? venue_management_main_params['venue_management_links_attributes'].delete(idx.to_s) if link['url'].blank?
end end
end end
@venue_management.update_user_id = current_user.id @venue_management.update_user_id = current_user.id
if @venue_management.update_attributes(venue_management_params) if @venue_management.update_attributes(venue_management_main_params)
@venue_management.venue_management_signup_fields.each{|t| t.destroy if t["to_delete"] == true} @venue_management.venue_management_signup_fields.each{|t| t.destroy if t["to_delete"] == true}
redirect_to params['referer_url'] redirect_to params['referer_url']
else else
flash.now[:error] = t('update.error.category') flash.now[:error] = t('update.error.category')
render action: :edit flash.keep
redirect_to action: :edit, :id =>@venue_management.id.to_s
end end
end end
end end
def set_write_off def set_write_off
@venue_management.donation_write_off_status = true @venue_management.donation_write_off_status = true
@ -202,14 +263,14 @@ class Admin::VenueManagementsController < OrbitAdminController
def venue_management_signup_field def venue_management_signup_field
@field_name = 'venue_management_main' @field_name = 'venue_management_main'
@attribute = VenueManagementMain.find(params[:id]) @attribute = VenueManagementMain.find(params[:id])
@attribute_type = 'venue_management' @attribute_type = 'venue_management'
@class = 'venue_managements' @class = 'venue_managements'
end end
def venue_management_submission_field def venue_management_submission_field
@field_name = 'venue_management_main' @field_name = 'venue_management_main'
@attribute = VenueManagementMain.find(params[:id]) @attribute = VenueManagementMain.find(params[:id])
@attribute_type = 'venue_management' @attribute_type = 'venue_management'
@class = 'venue_managements' @class = 'venue_managements'
end end
@ -221,7 +282,7 @@ class Admin::VenueManagementsController < OrbitAdminController
else else
@venue_management_signups = VenueManagementSignup.where(:venue_management_main_id => @venue_management.id).page(params[:page]).per(10) @venue_management_signups = VenueManagementSignup.where(:venue_management_main_id => @venue_management.id).page(params[:page]).per(10)
end end
end end
def edit_venue_management_signup def edit_venue_management_signup
@ -230,7 +291,7 @@ class Admin::VenueManagementsController < OrbitAdminController
end end
def delete_venue_management_signup def delete_venue_management_signup
@venue_management_signup = VenueManagementSignup.find(params[:id]) @venue_management_signup = VenueManagementSignup.find(params[:id])
@venue_management_id = @venue_management_signup.venue_management_main_id @venue_management_id = @venue_management_signup.venue_management_main_id
@ -240,6 +301,205 @@ class Admin::VenueManagementsController < OrbitAdminController
redirect_to "/admin/venue_managements/@venue_management_id.to_s/venue_management_signup" redirect_to "/admin/venue_managements/@venue_management_id.to_s/venue_management_signup"
end end
def venue_management_invitings
@table_fields = [
'vm_inviting.case_no',
'vm_inviting.type',
'vm_inviting.publish_times',
'vm_inviting.start_end',
'vm_inviting.rents',
'vm_inviting.royalty',
'vm_inviting.house_land_tax_payer',
'vm_inviting.contractor_manager',
'vm_inviting.bid_result',
'vm_inviting.details'
]
filter_tags = params[:filters]["type"].to_a rescue []
@invitings = @venue_management.venue_management_invitings.with_tags(filter_tags).page(params[:page]).per(10)
@tags = @module_app.tags
@filter_fields = {}
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
@filter_fields['vm_inviting.start_end'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[start_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["start_date"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[end_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["end_date"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
start_date = DateTime.parse(params[:filters]["start_date"]) rescue 0
end_date = DateTime.parse(params[:filters]["end_date"]) rescue 0
if @invitings.nil?
if start_date != 0 && end_date != 0
@invitings = VenueManagementInviting.where(:start_date.gte=>start_date,:end_date.lte=>end_date).page(params[:page]).per(10)
elsif start_date != 0
@invitings = VenueManagementInviting.where(:start_date.gte=>start_date).page(params[:page]).per(10)
elsif end_date != 0
@invitings = VenueManagementInviting.where(:end_date.lte=>end_date).page(params[:page]).per(10)
end
else
if start_date != 0 && end_date != 0
@invitings = @invitings.where(:start_date.gte=>start_date,:end_date.lte=>end_date).page(params[:page]).per(10)
elsif start_date != 0
@invitings = @invitings.where(:start_date.gte=>start_date).page(params[:page]).per(10)
elsif end_date != 0
@invitings = @invitings.where(:end_date.lte=>end_date).page(params[:page]).per(10)
end
end
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial => 'admin/venue_management_invitings/index'
end
end
def venue_management_memorabilias
@table_fields = [
'vm_memorabilia.case_no',
'vm_memorabilia.event_date',
'vm_memorabilia.details',
]
@filter_fields = {}
@memorabilias = @venue_management.venue_management_memorabilias.page(params[:page]).per(10)
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
end
def venue_management_bills
@table_fields = [
"contractor",
"accounting_month",
"bill_type",
"caculation_basis",
"reason",
"total_amount",
"pay_date",
"pay_method",
"note"
]
@bills = @venue_management.venue_management_bills.page(params[:page]).per(10)
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
@categories = @module_app.categories.enabled
@filter_fields = filter_fields(@categories)
@tags = @module_app.tags
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
bill_type_select_str = "<div class=\"controls\">"
value_bill_typeA = params[:filters]["bill_typeA"] rescue "0"
value_bill_typeB = params[:filters]["bill_typeB"] rescue "0"
bill_type_select_str += render_html('<%= select_tag "filters[bill_typeA]", options_for_select(VenueManagementBill::BILLTYPE.keys.map { |k| [ I18n.t("vm_bill.#{k}"), k ] },value_bill_typeA) ,{:onchange=>"var $this=this;(function(){var obj=#{VenueManagementBill::BILLTYPE.map{|k,v| [k,v.map{|vv| [vv,I18n.t("vm_bill.#{vv}")]}.to_h]}.to_h.to_s.gsub(\'=>\',\':\')};$($this).siblings(\'select\').html($.map(obj[$this.value],function(v,k){return \'<option value=\"\'+k+\'\">\'+v+\'</option>\'}).join(\' \'))})()"} %>',{:value_bill_typeA=>value_bill_typeA})
bill_typeB = (params[:filters]["bill_typeA"].blank? rescue true) ? VenueManagementBill::BILLTYPE.values.first : VenueManagementBill::BILLTYPE[params[:filters]["bill_typeA"]]
bill_type_select_str += render_html('<%= select_tag "filters[bill_typeB]", options_for_select(bill_typeB.map { |v| [ I18n.t("vm_bill.#{v}"), v ] },value_bill_typeB) , {:onchange=> "var $this=this;(function(){if($this.value == \'other\') $(\'#bill_other_field\').removeClass(\'hidden\');else $(\'#bill_other_field\').addClass(\'hidden\');})()"} %>',{:bill_typeB=>bill_typeB,:value_bill_typeB=>value_bill_typeB})
bill_type_select_str += render_html('<%= submit_tag(I18n.t(\'venue_management.search\')) %>')
bill_type_select_str += "</div>"
@filter_fields['vm_bill.bill_type'] = bill_type_select_str
@filter_fields['vm_bill.accounting_month'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[accounting_month_start]", {:no_label => true, :format=>"yyyy/MM", :new_record=>false, :value=>(DateTime.parse(params[:filters]["accounting_month_start"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[accounting_month_end]", {:no_label => true, :format=>"yyyy/MM", :new_record=>false, :value=>(DateTime.parse(params[:filters]["accounting_month_end"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
filter_tags = params[:filters]["type"].to_a rescue []
@main_ids = nil
if !filter_tags.blank?
@main_ids = VenueManagementInviting.with_tags(filter_tags).pluck(:venue_management_main_id)
if !filters("category").blank?
@main_ids = VenueManagementMain.where(:id.in=>@main_ids).with_categories(filters("category")).pluck(:id)
end
elsif !filters("category").blank?
@main_ids = VenueManagementMain.all.with_categories(filters("category")).pluck(:id)
end
if ( !params[:filters]["bill_typeA"].blank? rescue false)
@bills = @bills.where(:bill_typeA=>params[:filters]["bill_typeA"],:bill_typeB=>params[:filters]["bill_typeB"]).page(params[:page]).per(10)
end
accounting_month_start = DateTime.parse(params[:filters]["accounting_month_start"]) rescue 0
accounting_month_end = DateTime.parse(params[:filters]["accounting_month_end"]) rescue 0
if(accounting_month_end != 0)
accounting_month_end = accounting_month_end + 1.month - 1.day
end
if accounting_month_start != 0 && accounting_month_end != 0
@bills = @bills.where(:accounting_month.gte=>accounting_month_start,:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
elsif accounting_month_start != 0
@bills = @bills.where(:accounting_month.gte=>accounting_month_start).page(params[:page]).per(10)
elsif accounting_month_end != 0
@bills = @bills.where(:accounting_month.lte=>accounting_month_end).page(params[:page]).per(10)
end
if !@main_ids.nil?
@bills = @bills.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
end
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial=> 'admin/venue_management_bills/index'
end
end
def venue_management_contracts
@table_fields = [
'vm_contract.case_no',
'vm_inviting.type',
'vm_contract.vendor',
'vm_inviting.rents',
'vm_inviting.royalty',
'vm_contract.start_end',
'vm_contract.deposit_amount_type_exp_date',
'vm_contract.renewal_permission',
'vm_contract.other_commitment',
'vm_contract.note'
]
@filter_fields = filter_fields(@categories)
@tags = @module_app.tags
@filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} }
@filter_fields['vm_contract.start_end'] = ('<div class="controls"><div style="float: left;">'+
(render_html('<%= org_datetime_picker("filters[contract_start_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["contract_start_date"]) rescue nil)}) %>')) +
"</div><span style=\"float: left;\">~</span><div style=\"float: left;\">" +
(render_html('<%= org_datetime_picker("filters[contract_end_date]", {:no_label => true, :format=>"yyyy/MM/dd", :new_record=>false, :value=>(DateTime.parse(params[:filters]["contract_end_date"]) rescue nil)}) %>' ) ) +
render_html("<%= submit_tag(I18n.t('venue_management.search')) %>") +
'</div></div>')
filter_tags = params[:filters]["type"].to_a rescue []
@main_ids = nil
@inviting_ids = nil
@contracts = @venue_management.venue_management_contracts.page(params[:page]).per(10)
if !filter_tags.blank?
@inviting_ids = VenueManagementInviting.with_tags(filter_tags).pluck(:id)
end
if !filters("category").blank?
@main_ids = VenueManagementMain.all.with_categories(filters("category")).pluck(:id)
end
contract_start_date = DateTime.parse(params[:filters]["contract_start_date"]) rescue 0
contract_end_date = DateTime.parse(params[:filters]["contract_end_date"]) rescue 0
if @contracts.nil?
if contract_start_date != 0 && contract_end_date != 0
@contracts = VenueManagementContract.where(:contract_start_date.gte=>contract_start_date,:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
elsif contract_start_date != 0
@contracts = VenueManagementContract.where(:contract_start_date.gte=>contract_start_date).page(params[:page]).per(10)
elsif contract_end_date != 0
@contracts = VenueManagementContract.where(:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
end
else
if contract_start_date != 0 && contract_end_date != 0
@contracts = @contracts.where(:contract_start_date.gte=>contract_start_date,:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
elsif contract_start_date != 0
@contracts = @contracts.where(:contract_start_date.gte=>contract_start_date).page(params[:page]).per(10)
elsif contract_end_date != 0
@contracts = @contracts.where(:contract_end_date.lte=>contract_end_date).page(params[:page]).per(10)
end
end
if !@main_ids.nil?
if @contracts.nil?
@contracts = VenueManagementContract.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
else
@contracts = @contracts.and(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
end
end
if @contracts.nil?
@contracts = VenueManagementContract.all.page(params[:page]).per(10)
end
if !@inviting_ids.nil?
@contracts = @contracts.where(:venue_management_inviting_id.in=>@inviting_ids)
end
@contracts = @contracts.order(updated_at: :desc)
@venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue ""
if request.xhr?
render :partial=> 'admin/venue_management_contracts/index'
end
end
def render_html(code,pass_variables={})
render_to_string(:inline=>code,:locals=>pass_variables)
end
private private
def set_venue_management def set_venue_management
@ -251,7 +511,7 @@ class Admin::VenueManagementsController < OrbitAdminController
end end
def create_set (save_flag) def create_set (save_flag)
VenueManagementSignup.attribute_names.each do |attr_signup| VenueManagementSignup.attribute_names.each do |attr_signup|
if !(['_id', 'created_at', 'updated_at','venue_management_main_id'].include? attr_signup) if !(['_id', 'created_at', 'updated_at','venue_management_main_id'].include? attr_signup)
signup_set = @venue_management.venue_management_signup_field_sets.select{|v| v.field_name==attr_signup } signup_set = @venue_management.venue_management_signup_field_sets.select{|v| v.field_name==attr_signup }
if signup_set.length==0 if signup_set.length==0
if ['status','name','tel','phone','email','password'].include? attr_signup if ['status','name','tel','phone','email','password'].include? attr_signup
@ -295,7 +555,7 @@ class Admin::VenueManagementsController < OrbitAdminController
end end
end end
VenueManagementSignupContribute.attribute_names.each do |attr_submission| VenueManagementSignupContribute.attribute_names.each do |attr_submission|
if !(['_id', 'created_at', 'updated_at','venue_management_signup_id'].include? attr_submission) if !(['_id', 'created_at', 'updated_at','venue_management_signup_id'].include? attr_submission)
signup_set = @venue_management.venue_management_submission_field_sets.select{|v| v.field_name==attr_submission } signup_set = @venue_management.venue_management_submission_field_sets.select{|v| v.field_name==attr_submission }
if signup_set.length==0 if signup_set.length==0
name1 = Hash.new name1 = Hash.new

View File

@ -70,12 +70,44 @@ class VenueManagementsController < ApplicationController
'contribute_action' => contribute_action, 'contribute_action' => contribute_action,
'time_now' => time_now, 'time_now' => time_now,
'contribute_time_range' => VenueManagementMain.time_range(venue_management.contribute_start_date, venue_management.contribute_end_date), 'contribute_time_range' => VenueManagementMain.time_range(venue_management.contribute_start_date, venue_management.contribute_end_date),
'sign_up_time_range' => VenueManagementMain.time_range(venue_management.signup_start_date, venue_management.signup_end_date), 'sign_up_time_range' => venue_management.display_signup_during,
'venue_management_time_range' => VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date) 'venue_management_time_range' => venue_management.display_event_during,
'params' => params
} }
end end
def show_inviting
params = OrbitHelper.params
venue_management_inviting = VenueManagementInviting.find(params[:uid]) rescue nil
{
'venue_management_inviting' => venue_management_inviting,
'params' => params
}
end
def show_memorabilia
params = OrbitHelper.params
venue_management_memorabilia = VenueManagementMemorabilia.find(params[:uid]) rescue nil
{
'venue_management_memorabilia' => venue_management_memorabilia,
'params' => params
}
end
def show_contract
params = OrbitHelper.params
venue_management_contract = VenueManagementContract.find(params[:uid]) rescue nil
{
'venue_management_contract' => venue_management_contract,
'params' => params
}
end
def show_bill
params = OrbitHelper.params
venue_management_bill = VenueManagementBill.find(params[:uid]) rescue nil
{
'venue_management_bill' => venue_management_bill,
'params' => params
}
end
def show def show
params = OrbitHelper.params params = OrbitHelper.params

View File

@ -0,0 +1,9 @@
module Admin::VenueManagementBillsHelper
def self.thead(field)
if field.include?(".")
return ("<th>"+I18n.t(field)+"</th>").html_safe
else
return ("<th>"+I18n.t("vm_bill.#{field}")+"</th>").html_safe
end
end
end

View File

@ -125,9 +125,9 @@ module Admin::VenueManagementsFieldHelper
concat (content_tag :span, :class => 'add-on clearDate' do concat (content_tag :span, :class => 'add-on clearDate' do
content_tag :i, nil, :class => 'icons-cross-3' content_tag :i, nil, :class => 'icons-cross-3'
end) end)
concat (content_tag :span, :class => 'add-on iconbtn' do # concat (content_tag :span, :class => 'add-on iconbtn' do
content_tag :i, nil, 'data-time-icon' => 'icons-clock', 'data-date-icon' => 'icons-calendar', :class=>"icons-calendar" # content_tag :i, nil, 'data-time-icon' => 'icons-clock', 'data-date-icon' => 'icons-calendar', :class=>"icons-calendar"
end) # end)
end end
end end

View File

@ -0,0 +1,47 @@
module VenueAdminHelper
include ActionView::Helpers::FormOptionsHelper
include OrbitFormHelper
alias :org_datetime_picker :datetime_picker
def datetime_picker(*arg,**args)
tp = org_datetime_picker(*arg,**args)
venue = @template.instance_variable_get(:@venue)
if !venue.nil?
module_pages = @template.instance_variable_get(:@module_pages)
base_name = self.object_name
calendar_types = @template.instance_variable_get(:@calendar_types)
style_attr = ''
calendar_show = !@object['calendar_dict'][arg[0]].nil?
hide_style = " style=\"display: none;\""
if !@object.send(arg[0].to_s+'_reminder')
style_attr = hide_style
end
style_attr2 = calendar_show ? '' : hide_style
onclick_func = "function reminder_switch(ele){
if ($(ele).prop('checked')){
$(ele).parents('.controls').find('.email_reminder').show()
}else{
$(ele).parents('.controls').find('.email_reminder').hide()
}
};reminder_switch(this)"
onclick_func1 = "function reminder_switch_calendar(ele){
if ($(ele).prop('checked')){
$(ele).parents('.controls').find('.calendar_div').show()
}else{
$(ele).parents('.controls').find('.calendar_div').hide()
}
};reminder_switch_calendar(this)"
tp2 = content_tag(:div, :style => "float: left;flex-wrap: wrap;display: inline-flex;margin-left: 1em;align-items: center;") do
self.check_box((arg[0].to_s+'_reminder').to_sym,:onclick => onclick_func) + "#{I18n.t('venue_management.send_email_reminder')}<div class=\"email_reminder\"#{style_attr}>:&nbsp;#{I18n.t('venue_management.before')}#{self.number_field((arg[0].to_s+'_reminder_day').to_sym, :class => 'input-mini')}#{I18n.t('venue_management.day_send_email')}</div>".html_safe
end
calendar_type_key = "#{base_name}[calendar_data][type][#{arg[0]}]"
calendar_type = @object['calendar_data']['type'][arg[0]] rescue nil
tp4 = select_tag("#{base_name}[calendar_data][page_id][#{arg[0]}]",options_for_select([["----- Select a page -----",nil]]+module_pages,(@object['calendar_data']['page_id'][arg[0]] rescue nil)))
tp3 = content_tag(:div, :style => "float: left;flex-wrap: wrap;display: inline-flex;margin-left: 1em;align-items: center;") do
check_box_tag("#{base_name}[calendar_data][key][]",arg[0],calendar_show,:onclick => onclick_func1) + "#{I18n.t('venue_management.add_to_calendar')}<div class=\"calendar_div\"#{style_attr2}>:&nbsp;#{select_tag(calendar_type_key,options_for_select(calendar_types,calendar_type))}#{tp4}</div>".html_safe
end
tp = content_tag(:div, tp , :style=>"float: left;")+ tp2 + tp3
end
tp
end
end

View File

@ -0,0 +1,107 @@
module VenueLinkFile
extend ActiveSupport::Concern
module VenueMethod
def get_trans(field)
class_name = self.class.to_s
if class_name == 'VenueManagementMain'
I18n.t("venue_management.#{field}")
else
class_name = class_name.underscore.gsub('venue_management','vm')
I18n.t("#{class_name}.#{field}")
end
end
end
included do
self.include VenueMethod
tmp = self.to_s.underscore.to_sym
VenueManagementFile.send(:belongs_to,tmp, :class_name => self.to_s, :foreign_key => "#{tmp}_id")
VenueManagementLink.send(:belongs_to,tmp, :class_name => self.to_s, :foreign_key => "#{tmp}_id")
VenueManagementReminder.send(:belongs_to,tmp, :class_name => self.to_s, :foreign_key => "#{tmp}_id")
self.has_many :venue_management_files, :autosave => true, :dependent => :destroy
self.accepts_nested_attributes_for :venue_management_files, :allow_destroy => true
self.has_many :venue_management_links, :autosave => true, :dependent => :destroy
self.accepts_nested_attributes_for :venue_management_links, :allow_destroy => true
self.has_many :venue_management_reminders, :autosave => true, :dependent => :destroy
self.accepts_nested_attributes_for :venue_management_reminders, :allow_destroy => true
self.fields.values.each do|v|
if v.type==Date || v.type==DateTime
self.field v.name+'_reminder', type: Boolean,default: false
self.field v.name+'_reminder_day', type: Integer
end
end
self.field :calendar_data,type: Hash,default: {type:{},key:[],page_id: {}}
self.field :calendar_dict,type: Hash,default: {}
def to_calendar_param
venue_main = self.class.to_s == 'VenueManagementMain' ? self : VenueManagementMain.find(self.venue_management_main_id)
self.case_no.to_s+'-'+self.id.to_s+'?method=show_'+self.class.to_s.underscore.gsub('venue_management_','').gsub('main','data')
end
def calendar_id(field)
self.calendar_dict[field]
end
self.has_many :venue_management_emails, :autosave => true, :dependent => :destroy
self.accepts_nested_attributes_for :venue_management_emails, :allow_destroy => true
VenueManagementEmail.send(:belongs_to,tmp, :class_name => self.to_s, :foreign_key => "#{tmp}_id")
self.before_save do
venue_main = self.class.to_s == 'VenueManagementMain' ? self : VenueManagementMain.find(self.venue_management_main_id)
calendar_keys = Array(self.calendar_data['key'])
(self.calendar_dict.keys - calendar_keys).each do |key_deleted|
event = Event.where(:id => self.calendar_dict[key_deleted]).first
event.model_class = nil
event.destroy
self.calendar_dict.delete(key_deleted)
end
if !calendar_keys.blank?
calendar_keys.each do |key|
key_id = self.calendar_id(key)
current_user_id = OrbitHelper.current_user.id rescue nil
in_use_locales = Site.first.in_use_locales
title_tp = {}
note_tp = {}
in_use_locales.each do |locale|
title_tp[locale] = venue_main['title'][locale] + ' ' + self.get_trans(key)
note_tp[locale] = self.case_no.blank? ? {} : I18n.t('vm_inviting.case_no') +': ' + self.case_no
end
update_dict = {key: key,model_class: self.class.to_s,model_id: self.id,update_user_id: current_user_id,calendar_type_id: calendar_data['type'][key],all_day: true,start: self.send(key),end: self.send(key),title_translations: title_tp,note_translations: note_tp,module_key: 'venue_management',model_page_id: calendar_data['page_id'][key]}
if key_id.nil?
self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id
else
calendar = Event.find(key_id)
calendar.update_attributes(update_dict)
end
end
end
self.venue_management_emails.each do |venue_mail|
email = venue_mail.email
if !email.nil?
email.destroy
end
end
self.venue_management_emails = []
manager_emails = venue_main.manager_emails
self.fields.values.each do|v|
if v.type==Date || v.type==DateTime
if self.send(v.name+'_reminder')
title = venue_main.title + ' ' + self.case_no.to_s + ' ' + self.get_trans(v.name)
send_time = self.send(v.name)-self.send(v.name+'_reminder_day').day rescue nil
send_time = DateTime.parse(send_time.strftime("%Y/%m/%d 00:00:00 %z")) rescue send_time
if !send_time.nil?
new_email = Email.create(mail_to: manager_emails,
module_app_key:"venue_management",
template:"email/reminder_email.html.erb",
mail_sentdate: send_time,
mail_subject: title,
template_data:{'title'=>title,'send_time'=>self.send(v.name),'locale'=>I18n.locale})
self.venue_management_emails << VenueManagementEmail.new(email_id: new_email.id)
end
end
end
end
end
Email.before_destroy do
email = VenueManagementEmail.where(:email_id=>self.id).first
if !email.nil?
email.destroy
end
end
end
end

View File

@ -0,0 +1,257 @@
require 'orbit_form_helper'
class VenueManagementBill
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Enum
BILLTYPE = {'venue_fee'=>["usage_fee", "royalties", "admin_fee", "land_rent"],'utility_bill'=>['electricity','water'],'tax'=>['house_tax','land_tax'],'prejudgment_interest'=>["usage_fee", "royalties", "admin_fee", "land_rent",'electricity','water','house_tax','land_tax','other'],'other'=>['penalty','other']}
NOTFIELDKEY = ['float','fields','clear','no_margin','unit','display_title','display_unit','option_select']
CACULATIONBASISTYPE = {'revenue'=>{'revenue'=>{},'level_0'=>{'fields'=>['field_value','percent']},'level_1'=>{'fields'=>['field_value','percent']},'level_2'=>{'fields'=>['field_value','percent']},'level_3'=>{'fields'=>['field_value','percent']},'level_4'=>{'fields'=>['field_value','percent']},'level_5'=>{'fields'=>['field_value','percent']}},
'degree'=>{'current_degree'=>{'float'=>'left'},'consumption'=>{'float'=>'left','clear'=>true,'no_margin'=>true},'level_0'=>{'fields'=>['field_value','dollar/degree']},'level_1'=>{'fields'=>['field_value','dollar/degree']},'level_2'=>{'fields'=>['field_value','dollar/degree']},'level_3'=>{'fields'=>['field_value','dollar/degree']},'add_and_subtract'=>{'unit'=>'add_and_subtract_hint'}},
'actual_bill'=>{'bill_amount'=>{}},
'fixed'=>{'amount'=>{}},
'taxable_present_value'=>{'present_value'=>{},'taxable_area'=>{'unit'=>'㎡'},'taxable_tax'=>{}},
'announced_land_values'=>{'land_values'=>{},'taxable_area'=>{'unit'=>'㎡'},'taxable_tax'=>{}},
'interest'=>{'bills_payable'=>{},'delay_in_days'=>{},'delay_in_days_level_1'=>{'day'=>{},'_interest'=>{'display_title'=>'front','unit'=>'%'},'interest_type'=>{'display_title'=>'none','option_select'=>['annual_interest','double_dividend','daily_interest'],'type'=>'radio'}},'delay_in_days_level_2'=>{'day'=>{},'_interest'=>{'display_title'=>'front','unit'=>'%'},'interest_type'=>{'display_title'=>'none','option_select'=>['annual_interest','double_dividend','daily_interest'],'type'=>'radio'}},'delay_in_days_level_3'=>{'day'=>{},'_interest'=>{'display_title'=>'front','unit'=>'%'},'interest_type'=>{'display_title'=>'none','option_select'=>['annual_interest','double_dividend','daily_interest'],'type'=>'radio'}},'add_and_subtract'=>{'unit'=>'add_and_subtract_hint'}},
'other'=>{'amount'=>{}}}
CACILATYIONFORMULA = {'revenue'=>"
i = find_insert_index(field_values,revenue)
field_values = field_values.slice(0,i)
percents = percents.slice(0,i)
field_values.push(revenue)
percents.push(0)
result = -inner_product(field_values,percents)
f=field_values.shift(1)
field_values.push(f[0])
result += inner_product(field_values,percents)
result = result / 100
if(result < 0){
result = 0
}",
"degree"=>"
i = find_insert_index(field_values,consumption)
field_values = field_values.slice(0,i)
dollardegrees = dollardegrees.slice(0,i)
field_values.push(consumption)
dollardegrees.push(0)
result = -inner_product(field_values,dollardegrees)
f=field_values.shift(1)
field_values.push(f[0])
result += inner_product(field_values,dollardegrees)
result += add_and_subtract
if(result < 0){
result = 0
}
",
"actual_bill"=>"
result = bill_amount
if(result < 0){
result = 0
}
",
"fixed"=>"
result = amount
if(result < 0){
result = 0
}
",
"taxable_present_value"=>"
result = taxable_tax
if(result < 0){
result = 0
}",
"announced_land_values"=>"
result = taxable_tax
if(result < 0){
result = 0
}",
"other"=>"
result = amount
if(result < 0){
result = 0
}",
'interest'=>"
i = find_insert_index(days,delay_in_days)
ref = JSON.parse(\"{\\\"annual_interest\\\": #{1/365.0},\\\"double_dividend\\\": #{1/2.0},\\\"daily_interest\\\": #{1/1.0}}\")
if(days[i-1] < delay_in_days && interest_types[i-1] != undefined ){
if(interest_types[i-1] == 'double_dividend'){
result = _interests[i - 1] * (delay_in_days * ref[interest_types[i-1]]).ceil()
}else{
result = _interests[i - 1] * (delay_in_days * ref[interest_types[i-1]])
}
}else{
if(i != 1 && days[i-2] < delay_in_days && interest_types[i-2] != undefined ){
if(interest_types[i-2] == 'double_dividend'){
result = _interests[i - 2] * (delay_in_days * ref[interest_types[i-2]]).ceil()
}else{
result = _interests[i - 2] * (delay_in_days * ref[interest_types[i-2]])
}
}else{
result = 0
}
}
result = result / 100
result = result * bills_payable
result += add_and_subtract
if(result < 0){
result = 0
}
",
'old_interest'=>"
i = find_insert_index(days,delay_in_days)
days = days.slice(0,i)
_interests = _interests.slice(0,i)
days.push(delay_in_days)
_interests.push(0)
result = inner_product_to_array(days,_interests)
result = array_multiply_scalar(result,-1)
f=days.shift(1)
days.push(f[0])
result2 = inner_product_to_array(days,_interests)
result = array_add(result,result2)
result = inner_product_to_array(result,interest_types,JSON.parse(\"{\\\"annual_interest\\\": #{1/365.0},\\\"double_dividend\\\": #{1/2.0},\\\"daily_interest\\\": #{1/1.0}}\"))
result = sum(result)
result = result / 100
result = result * bills_payable
result += add_and_subtract
if(result < 0)
result = 0
"
}
CACULATIONBASIS = {'revenue'=>"revenue",
"degree"=>"consumption",
"actual_bill" => "bill_amount",
"fixed"=>"amount",
"taxable_present_value"=>"present_value",
"announced_land_values"=>"land_values",
'interest'=>'bills_payable',
"other"=>"amount"
}
field :accounting_month, type: Date, default: Time.now
field :bill_typeA, type: String, default: ""
field :bill_typeB, type: String, default: ""
field :bill_other, type: String, default: "", localize: true
field :caculation_basis_type, type: String, default: ""
field :caculation_basis, type: String, default: ""
field :reason, type: String, default: "", localize: true
field :amount, type: Integer, default: 0
field :deadline, type: Date, default: Time.now
field :received_date, type: Date, default: Time.now
field :pay_method, type: String, default: "", localize: true
field :note, type: String, default: "", localize: true
field :revenue
field :bill_amount
field :level_0
field :level_1
field :level_2
field :level_3
field :level_4
field :level_5
field :delay_in_days_level_1
field :delay_in_days_level_2
field :delay_in_days_level_3
field :current_degree
field :consumption
field :tax_excluded, type: Boolean, default: false
field :total_amount
field :actual_amount
field :tax
field :present_value
field :taxable_area
field :land_values
field :taxable_tax
field :add_and_subtract
field :bills_payable
field :delay_in_days
belongs_to :venue_management_main
include VenueLinkFile
# after_initialize do |record|
# if record.caculation_basis_type == "degree"
# if record.caculation_basis != "" && record.consumption.blank?
# record.update(:consumption => record.caculation_basis)
# end
# elsif record.caculation_basis_type == "revenue"
# if record.caculation_basis != "" && record.revenue.blank?
# record.update(:revenue => record.caculation_basis)
# end
# end
# end
# after_save do |record|
# venue_management_main = record.venue_management_main
# if !venue_management_main.venue_management_bill_ids.include?(record.id)
# venue_management_main.update(venue_management_main.venue_management_bill_ids.push(record.id))
# end
# end
def display_note
html = self.note.to_s.split("\r\n").select{|s| !s.blank?}.first
return Nokogiri::HTML(html).css("body").text
end
def display_caculation_basis
caculation_basis_val = eval("#{self.class::CACULATIONBASIS[self.caculation_basis_type]}")
return "#{I18n.t("vm_bill.#{self.class::CACULATIONBASIS[self.caculation_basis_type]}")}: #{caculation_basis_val}"
end
def display_accounting_month
return (self.accounting_month.strftime("%Y-%m") rescue "")
end
def case_no
return (self.contractor.case_no rescue "")
end
def contractor
return self.venue_management_main.venue_management_contracts.where(:contract_start_date.lte=>self.accounting_month,:contract_end_date.gte=>self.accounting_month).first
end
def pay_date
return "#{self.deadline}/#{self.received_date}"
end
def inner_product(a,b,ref_val_for_b={})
result = 0
a.each.with_index{|v,i|
if ref_val_for_b.blank?
p = v*b[i] rescue nil;
else
p = v*ref_val_for_b[b[i]] rescue nil;
end
if(!p.nil?)
result += p;
end
}
return result
end
def inner_product_to_array(a,b)
result = []
a.each.with_index{|v,i|
p = v*b[i] rescue nil;
if(!p.nil?)
result.push(p);
end
}
return result
end
def array_multiply_scalar(arr,scalar)
result = [];
arr.each.with_index{|v,i|
p = v*scalar rescue nil;
if(!p.nil?)
result.push(p);
end
}
return result;
end
def array_add(arr1,arr2)
result = [];
arr1.each.with_index{|v,i|
p = v + arr2[i] rescue nil;
if(!p.nil?)
result.push(p);
end
}
return result;
end
def sum(arr)
result = 0;
arr.each.with_index{|v,i|
if(!v.nil?)
result += v;
end
}
return result;
end
end

View File

@ -0,0 +1,121 @@
# frozen_string_literal: true
require 'orbit_form_helper'
class VenueManagementContract
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Enum
PAYERS = [ :school, :vendor].freeze
BID_RESULTS = [ :failure, :abandoned, :qualified].freeze
# Copy from Inviting
field :renewal_permission, type: Boolean,default: false
field :renewal_deadline, type: Date
field :case_no, type: String
field :contractor_ids, type: Array,default: []
field :publish_times, type: Integer
field :start_date, type: Date, default: Time.now
field :end_date, type: Date
field :close_date, type: Date
field :bid_date, type: Date
field :evaluation_date, type: Date
field :early_rent, type: Integer
field :operation_rent, type: Integer
field :royalty, type: String
field :contractor_manager # save user_id
enum :house_tax_payer, PAYERS
enum :land_tax_payer, PAYERS
enum :bid_result, BID_RESULTS
field :details, localize: true
# Other fields
field :vendor # save user_id
field :contract_start_date, type: Date
field :contract_end_date, type: Date
field :construction_start_date, type: Date
field :construction_end_date, type: Date
field :operation_start_date, type: Date
field :operation_end_date, type: Date
field :free_period_start_date, type: Date
field :free_period_end_date, type: Date
field :renewal_permission, type: Boolean
field :sign_date, type: Date
field :handover_date, type: Date
field :deposit_amount, type: String
field :deposit_payment_date, type: Date
field :deposit_type, type: String
field :deposit_exp_date, type: Date
field :insurance_type, type: String
field :insurance_payment_deadline, type: Date
field :insurance_payment_date, type: Date
field :insurance_type2, type: String
field :insurance_payment_deadline2, type: Date
field :insurance_payment_date2, type: Date
field :insurance_type3, type: String
field :insurance_payment_deadline3, type: Date
field :insurance_payment_date3, type: Date
field :other_commitment, localize: true
field :note, localize: true
belongs_to :venue_management_main
belongs_to :venue_management_inviting
include VenueLinkFile
def deposit_amount_type_exp_date
return "#{self.deposit_amount}/#{self.deposit_type}/#{self.deposit_exp_date}"
end
def display_note
html = self.note.to_s.split("\r\n").select{|s| !s.blank?}.first
return Nokogiri::HTML(html).css("body").text
end
def display_other_commitment
html = self.other_commitment.to_s.split("\r\n").select{|s| !s.blank?}.first
return Nokogiri::HTML(html).css("body").text
end
def display_royalty
self.royalty.to_s.gsub("\r\n","<br>").html_safe
end
def update_inviting(inviting,check_inviting,org_contract=nil,save_flag=true)
if !inviting.nil?
%i(case_no publish_times start_date end_date close_date bid_date evaluation_date contractor_manager bid_result details).each do |attr_|
self[attr_] = inviting.send(attr_) rescue nil
end
else
self[:case_no] = nil
end
update_flag = true
if !org_contract.nil? && org_contract.venue_management_inviting_id == self.venue_management_inviting_id
%i(early_rent operation_rent royalty house_tax_payer land_tax_payer).each do |attr_|
if self[attr_] != (check_inviting.send(attr_) rescue nil)
update_flag = false
end
end
end
if update_flag && !inviting.nil?
%i(early_rent operation_rent royalty house_tax_payer land_tax_payer).each do |attr_|
self[attr_] = (inviting.send(attr_) rescue nil)
end
end
if save_flag
self.save
end
end
def contractors
return( MemberProfile.where(:id.in=>self.contractor_ids).to_a rescue [])
end
def display_contractors
return self.contractors.map{|m| m.name}.join(" , ")
end
def display_tags
self.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue ""
end
def display_case_no
return (self.case_no.blank? ? I18n.t(:empty) : self.case_no)
end
before_save do
org_contract = VenueManagementContract.find(self.id) rescue nil
inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil
update_inviting(inviting,inviting,org_contract,false)
end
end

View File

@ -0,0 +1,9 @@
class VenueManagementEmail
include Mongoid::Document
include Mongoid::Timestamps
field :email_id
def email
Email.find(self.email_id) rescue nil
end
end

View File

@ -8,7 +8,6 @@ class VenueManagementFile
field :description, localize: true field :description, localize: true
field :title, localize: true field :title, localize: true
#belongs_to :venue_management_main
belongs_to :venue_management_main #belongs_to :venue_management_contract
end end

View File

@ -0,0 +1,59 @@
# frozen_string_literal: true
require 'orbit_form_helper'
class VenueManagementInviting
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Enum
include OrbitTag::Taggable
PAYERS = [ :school, :vendor].freeze
BID_RESULTS = [ :empty ,:failure, :abandoned, :qualified].freeze
field :case_no, type: String
field :publish_times, type: Integer
field :start_date, type: Date, default: Time.now
field :end_date, type: Date
field :close_date, type: DateTime
field :bid_date, type: DateTime
field :evaluation_date, type: DateTime
field :early_rent, type: Integer
field :operation_rent, type: Integer
field :royalty, type: String
field :contractor_manager # save user_id
enum :house_tax_payer, PAYERS
enum :land_tax_payer, PAYERS
enum :bid_result, BID_RESULTS
field :details, localize: true
has_many :venue_management_contracts
has_many :venue_management_memorabilias, :class_name => 'VenueManagementMemorabilia', :foreign_key => "venue_management_memorabilia_ids"
belongs_to :venue_management_main
include VenueLinkFile
def display_royalty
self.royalty.to_s.gsub("\r\n","<br>").html_safe
end
def display_close_date
self.close_date.strftime("%Y/%m/%d %H:%M") rescue ""
end
def display_bid_date
self.bid_date.strftime("%Y/%m/%d %H:%M") rescue ""
end
def display_evaluation_date
self.evaluation_date.strftime("%Y/%m/%d %H:%M") rescue ""
end
def display_case_no
return (self.case_no.blank? ? I18n.t(:empty) : self.case_no)
end
def display_details
html = self.details.to_s.split("\r\n").select{|s| !s.blank?}.first
return Nokogiri::HTML(html).css("body").text
end
before_save do
contracts = self.venue_management_contracts
org_inviting = VenueManagementInviting.find(self.id) rescue nil
contracts.each do |contract|
contract.update_inviting(self,org_inviting,contract)
end
end
end

View File

@ -7,12 +7,11 @@ class VenueManagementLink
field :url field :url
field :title, localize: true field :title, localize: true
belongs_to :venue_management_main
before_validation :add_http before_validation :add_http
#belongs_to :venue_management_main
validates :url, :presence => true, :format => /\A(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?\Z/i #belongs_to :venue_management_contract
#validates :url, :presence => true, :format => /\A(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?\Z/i
protected protected

View File

@ -1,16 +1,17 @@
class VenueManagementMain class VenueManagementMain
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include OrbitModel::Impression include OrbitModel::Impression
# encoding: utf-8 # encoding: utf-8
include OrbitCategory::Categorizable include OrbitCategory::Categorizable
include Slug include Slug
field :title, as: :slug_title, type: String, localize: true field :title, as: :slug_title, type: String, localize: true
field :speaker, localize: true field :speaker, localize: true
field :content, localize: true field :content, localize: true
field :land_number, localize: true field :land_number, localize: true
field :land_area, localize: true
field :building_area, localize: true
field :area, localize: true field :area, localize: true
field :land_zoning, localize: true field :land_zoning, localize: true
field :act_place, localize: true field :act_place, localize: true
@ -25,7 +26,7 @@ class VenueManagementMain
field :contribute_start_date, :type => Date field :contribute_start_date, :type => Date
field :contribute_end_date, :type => Date field :contribute_end_date, :type => Date
field :contribute_file_count, type: String field :contribute_file_count, type: String
field :registration_status , :type => Array #C: 投稿者 G:一般 field :registration_status , :type => Array #C: 投稿者 G:一般
@ -35,8 +36,10 @@ class VenueManagementMain
belongs_to :venue_management_item belongs_to :venue_management_item
has_many :venue_management_links, :autosave => true, :dependent => :destroy has_many :venue_management_invitings, :autosave => true, :dependent => :destroy
has_many :venue_management_files, :autosave => true, :dependent => :destroy has_many :venue_management_memorabilias, :autosave => true, :dependent => :destroy
has_many :venue_management_bills, :autosave => true, :dependent => :destroy
has_many :venue_management_contracts, :autosave => true, :dependent => :destroy
has_many :venue_management_item_contents, :autosave => true, :dependent => :destroy has_many :venue_management_item_contents, :autosave => true, :dependent => :destroy
has_many :venue_management_signups, :autosave => true, :dependent => :destroy has_many :venue_management_signups, :autosave => true, :dependent => :destroy
has_many :venue_management_submission_fields, :autosave => true, :dependent => :destroy has_many :venue_management_submission_fields, :autosave => true, :dependent => :destroy
@ -46,8 +49,7 @@ class VenueManagementMain
has_many :venue_management_submission_field_sets, autosave: true, dependent: :destroy has_many :venue_management_submission_field_sets, autosave: true, dependent: :destroy
has_many :venue_management_email_sets, autosave: true, dependent: :destroy has_many :venue_management_email_sets, autosave: true, dependent: :destroy
has_many :venue_management_signup_field_customs, :autosave => true, :dependent => :destroy has_many :venue_management_signup_field_customs, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :venue_management_links, :allow_destroy => true accepts_nested_attributes_for :venue_management_memorabilias, :allow_destroy => true
accepts_nested_attributes_for :venue_management_files, :allow_destroy => true
accepts_nested_attributes_for :venue_management_item_contents, :allow_destroy => true accepts_nested_attributes_for :venue_management_item_contents, :allow_destroy => true
accepts_nested_attributes_for :venue_management_signups, :allow_destroy => true accepts_nested_attributes_for :venue_management_signups, :allow_destroy => true
accepts_nested_attributes_for :venue_management_submission_fields, :allow_destroy => true accepts_nested_attributes_for :venue_management_submission_fields, :allow_destroy => true
@ -57,22 +59,49 @@ class VenueManagementMain
accepts_nested_attributes_for :venue_management_submission_field_sets, :allow_destroy => true accepts_nested_attributes_for :venue_management_submission_field_sets, :allow_destroy => true
accepts_nested_attributes_for :venue_management_email_sets, :allow_destroy => true accepts_nested_attributes_for :venue_management_email_sets, :allow_destroy => true
accepts_nested_attributes_for :venue_management_signup_field_customs, :allow_destroy => true accepts_nested_attributes_for :venue_management_signup_field_customs, :allow_destroy => true
include VenueLinkFile
def self.time_range(date1 = null, date2 = null) def self.time_range(date1 = null, date2 = null)
if !date1.blank? if !date1.blank?
r = "#{date1.strftime('%Y-%m-%d')}" r = "#{date1.strftime('%Y-%m-%d')}"
if date2 if date2
r += " - #{date2.strftime('%Y-%m-%d')}" r += " - #{date2.strftime('%Y-%m-%d')}"
else else
r += " - #{I18n.t(:no_deadline)}" r += " - #{I18n.t(:no_deadline)}"
end end
r r
end end
end
def contractors
last_contract = self.venue_management_contracts.desc(:id).first
last_contract.contractors rescue []
end
def display_contractors
last_contract = self.venue_management_contracts.desc(:id).first
contractors = last_contract.contractors rescue []
contractors.map{|m| m.name}.join(" , ")
end
def display_tags
last_inviting = self.venue_management_invitings.desc(:id).first
last_inviting.tags.map{|t| t.name}.join(" , ") rescue ""
end
def display_event_during
last_contract = self.venue_management_contracts.desc(:id).first
if last_contract.nil?
"" #self.class.time_range(self.venue_management_start_date, self.venue_management_end_date)
else
self.class.time_range(last_contract.contract_start_date, last_contract.contract_end_date)
end
end
def display_signup_during
last_inviting = self.venue_management_invitings.desc(:id).first
if last_inviting.nil?
"" #self.class.time_range(self.signup_start_date, self.signup_end_date)
else
self.class.time_range(last_inviting.start_date, last_inviting.end_date)
end
end
def manager_emails
MemberProfile.where(:id.in => self.manager_ids).collect{|v| v.email}
end end
def get_attribute_value(attribute_field, signup_id) def get_attribute_value(attribute_field, signup_id)
@ -82,11 +111,18 @@ class VenueManagementMain
def get_attribute_values(attribute_type=nil) def get_attribute_values(attribute_type=nil)
@attribute_values = attribute_type.venue_management_signup_values rescue nil @attribute_values = attribute_type.venue_management_signup_values rescue nil
end end
def get_value_from_field_id(field_id,attribute_type=nil) def get_value_from_field_id(field_id,attribute_type=nil)
values = get_attribute_values(attribute_type) values = get_attribute_values(attribute_type)
value = values.detect {|value| value.venue_management_signup_field_id == field_id} rescue nil value = values.detect {|value| value.venue_management_signup_field_id == field_id} rescue nil
value ? value : nil value ? value : nil
end end
def case_no
''
end
def newest_case_no
last_contract = self.venue_management_contracts.desc(:id).first
newest_case_no = last_contract.venue_management_inviting.case_no rescue ""
return ( newest_case_no.blank? ? I18n.t(:empty) : newest_case_no)
end
end end

View File

@ -0,0 +1,23 @@
class VenueManagementMemorabilia
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Enum
field :event_date, type: Date, default: Time.now
field :details, localize: true
def case_no
inviting = self.venue_management_inviting
if !inviting.nil?
inviting.case_no
else
I18n.t("empty")
end
end
belongs_to :venue_management_inviting
belongs_to :venue_management_main
include VenueLinkFile
def display_details
html = self.details.to_s.split("\r\n").select{|s| !s.blank?}.first
return Nokogiri::HTML(html).css("body").text
end
end

View File

@ -0,0 +1,104 @@
# encoding: utf-8
class VenueManagementReminder
include Mongoid::Document
include Mongoid::Timestamps
field :description, localize: true
field :reminder_date, type: Date
field :reminder_date_reminder, type: Boolean,default: false
field :reminder_date_reminder_day, type: Integer
field :calendar_data,type: Hash,default: {type:{},key:[],page_id: {}}
field :calendar_dict,type: Hash,default: {}
has_many :venue_management_emails, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :venue_management_emails, :allow_destroy => true
def to_calendar_param
vm_contract = self.venue_management_contract rescue VenueManagementContract.all.select{|v| v.venue_management_reminder_ids.include? self.id}.first
venue_main = vm_contract.venue_management_main
self.description+'-'+vm_contract.id.to_s+'?method=show_contract'
end
def calendar_id(field)
self.calendar_dict[field]
end
before_save do
venue_main = self.venue_management_contract.venue_management_main rescue VenueManagementContract.all.select{|v| v.venue_management_reminder_ids.include? self.id}.first.venue_management_main
calendar_keys = Array(self.calendar_data['key'])
(self.calendar_dict.keys - calendar_keys).each do |key_deleted|
event = Event.where(:id => self.calendar_dict[key_deleted]).first
event.model_class = nil
event.destroy
self.calendar_dict.delete(key_deleted)
end
if !calendar_keys.blank?
calendar_keys.each do |key|
key_id = self.calendar_id(key)
current_user_id = OrbitHelper.current_user.id rescue nil
in_use_locales = Site.first.in_use_locales
title_tp = {}
note_tp = {}
titles = venue_main['title'].select{|k,v| v.present?}.to_h
notes = self.description_translations.select{|k,v| v.present?}.to_h
in_use_locales.each do |locale|
if titles[locale].nil?
title_tp[locale] = titles.values.first.to_s + " " + I18n.t("venue_management.reminder")
else
title_tp[locale] = venue_main['title'][locale].to_s + " " + I18n.t("venue_management.reminder")
end
note_tp[locale] = self.description_translations[locale].blank? ? I18n.t(:url_alt) +': ' + notes.values.first.to_s : I18n.t(:url_alt) +': ' + self.description_translations[locale]
end
update_dict = {key: key,model_class: self.class.to_s,model_id: self.id,update_user_id: current_user_id,calendar_type_id: calendar_data['type'][key],all_day: true,start: self.send(key),end: self.send(key),title_translations: title_tp,note_translations: note_tp,module_key: 'venue_management',model_page_id: calendar_data['page_id'][key]}
if key_id.nil?
self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id
else
calendar = Event.find(key_id) rescue nil
if calendar.nil?
self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id
else
calendar.update_attributes(update_dict)
end
end
end
end
self.venue_management_emails.each do |venue_mail|
email = venue_mail.email
if !email.nil?
email.destroy
end
end
self.venue_management_emails = []
manager_emails = venue_main.manager_emails
self.fields.values.each do|v|
if v.type==Date || v.type==DateTime
if self.send(v.name+'_reminder')
title = venue_main.title + ' ' + self.description.to_s + ' ' + get_trans(v.name)
send_time = self.send(v.name)-self.send(v.name+'_reminder_day').day rescue nil
if !send_time.nil?
new_email = Email.create(mail_to: manager_emails,
module_app_key:"venue_management",
template:"email/reminder_email.html.erb",
mail_sentdate: send_time,
mail_subject: title,
template_data:{'title'=>title,'send_time'=>self.send(v.name),'locale'=>I18n.locale})
self.venue_management_emails << VenueManagementEmail.new(email_id: new_email.id)
end
end
end
end
end
before_destroy do
calendar_keys = Array(self.calendar_data['key'])
calendar_keys.each do |key|
key_id = self.calendar_id(key)
event = Event.find(key_id) rescue nil
event.destroy
end
end
def get_trans(field)
class_name = self.class.to_s
if class_name == 'VenueManagementMain'
I18n.t("venue_management.#{field}")
else
class_name = class_name.underscore.gsub('venue_management','vm')
I18n.t("#{class_name}.#{field}")
end
end
end

View File

@ -0,0 +1,468 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<style type="text/css">
.unit{
font-size: initial;
font-weight: bold;
}
.normal{
font-size: initial;
}
.control-label.no_margin{
width: auto;
}
.controls.no_margin{
float: left;
margin: 0;
}
</style>
<!-- Input Area -->
<div class="input-area">
<% new_record = @venue_management_bill.new_record? && params["action"] != "copy" %>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<%= f.hidden_field :venue_management_main_id %>
<div class="control-group">
<label class="control-label muted"><%= t('vm_bill.accounting_month') %></label>
<div class="controls">
<%= f.org_datetime_picker :accounting_month, :no_label => true, :format=>"yyyy/MM", :new_record => new_record %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_bill.bill_type') %></label>
<div class="controls">
<%= f.select :bill_typeA, @venue_management_bill.class::BILLTYPE.keys.map { |k| [ I18n.t("vm_bill.#{k}"), k ] },{},{:onchange=>"var $this=this;(function(){var obj=#{@venue_management_bill.class::BILLTYPE.map{|k,v| [k,v.map{|vv| [vv,I18n.t("vm_bill.#{vv}")]}.to_h]}.to_h.to_s.gsub('=>',':')};$($this).siblings('select').html($.map(obj[$this.value],function(v,k){return \'<option value=\"\'+k+\'\">\'+v+\'</option>\'}).join(\' \'))})()"} %>
<% bill_typeB = new_record ? @venue_management_bill.class::BILLTYPE.values.first : @venue_management_bill.class::BILLTYPE[@venue_management_bill.bill_typeA] %>
<%= f.select :bill_typeB, bill_typeB.map { |v| [ I18n.t("vm_bill.#{v}"), v ] }, {}, {:onchange=> "var $this=this;(function(){if($this.value == 'other') $('#bill_other_field').removeClass('hidden');else $('#bill_other_field').addClass('hidden');})()"} %>
<div id="bill_other_field" class="tab-content language-area <%=@venue_management_bill.bill_typeB == 'other' ? '' : 'hidden'%>">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>" id="bill_other_<%=locale%>">
<!-- Bill other -->
<div class="add-input address-input">
<%= f.fields_for :bill_other_translations do |f| %>
<%= f.text_field locale , class: "input-block-level", :value => (@venue_management_bill.bill_other_translations[locale] rescue nil), :placeholder=> t('vm_bill.bill_other') %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= (i == 0 ? 'active' : '') %> last" href="#bill_other_<%=locale%>" data-toggle="tab"><%=t(locale)%></a>
<% end %>
</div>
</div>
</div>
</div>
</div>
<% cbt = @venue_management_bill.class::CACULATIONBASISTYPE %>
<div class="control-group">
<label class="control-label muted"><%= t('vm_bill.caculation_basis') %></label>
<div class="controls">
<%= f.select :caculation_basis_type, cbt.keys.map { |k| [ I18n.t("vm_bill.#{k}"), k ] }, {}, :id=>'caculation_basis_type' %>
</div>
</div>
<% caculation_basis_type = (new_record ? cbt.keys.first : @venue_management_bill.caculation_basis_type) %>
<div id="caculation_basis_content">
<% cbt[caculation_basis_type].each do |k,v| %>
<% no_margin = (v['no_margin'] rescue false) ? 'no_margin' : '' %>
<div class="control-group" <%= (v['float'].blank? rescue true) ? '' : "style=\"float: #{v['float']};\"".html_safe %>>
<label class="control-label <%=no_margin%>"><%= t("vm_bill.#{k}") %></label>
<div class="controls <%=no_margin%>">
<% other_keys = (v.keys - @venue_management_bill.class::NOTFIELDKEY) rescue [] %>
<% if ( v['fields'].blank? rescue true) %>
<%= f.text_field k if other_keys.blank? %>
<% else %>
<% v['fields'].each do |field_key| %>
<%= f.fields_for k do |f|%>
<%= f.text_field field_key,:value => (@venue_management_bill.send(k)[field_key] rescue "") %>
<%= t("vm_bill.#{field_key}") if field_key != 'field_value' %>
<% end %>
<% end %>
<% end %>
<% if other_keys.present? %>
<% other_keys.each do |field_key| %>
<%= f.fields_for k do |f|%>
<%= t("vm_bill.#{field_key}") if v[field_key]['display_title'] == 'front' %>
<% if v[field_key]['option_select'].blank? %>
<%= f.text_field field_key,:value => (@venue_management_bill.send(k)[field_key] rescue "") %>
<% else %>
<% if v[field_key]['type'].nil? || v[field_key]['type'] == 'select' %>
<%= f.select field_key , options_for_select(v[field_key]['option_select'].map{|o| [t("vm_bill.#{o}"),o]} ,(@venue_management_bill.send(k)[field_key] rescue "")) %>
<% else %>
<% value = (@venue_management_bill.send(k)[field_key] rescue "") %>
<% v[field_key]['option_select'].each do |o| %>
<span>
<input type="<%=v[field_key]['type']%>" name="<%= f.object_name %>[<%=field_key%>]<%= ((v[field_key]['type'] == 'checkbox') ? '[]' : '')%>" value="<%= o %>" <%= (value == o || (value.include?(o) rescue false)) ? 'checked' : '' %> />
<%= t("vm_bill.#{o}") %>
</span>
<% end %>
<% end %>
<% end %>
<%= t("vm_bill.#{field_key}") if (field_key != 'field_value' && !v[field_key].has_key?('display_title') ) %>
<span class="unit">
<% if ( t("vm_bill")[v[field_key]['unit'].to_sym].nil? rescue true) %>
<%= (v[field_key]['unit'].to_s rescue "") %>
<% else %>
<%= (t("vm_bill.#{v[field_key]['unit'].to_s}") rescue "") %>
<% end %>
</span>
<% end %>
<% end %>
<% end %>
<span class="unit">
<% if ( t("vm_bill")[v['unit'].to_sym].nil? rescue true) %>
<%= (v['unit'].to_s rescue "") %>
<% else %>
<%= (t("vm_bill.#{v['unit'].to_s}") rescue "") %>
<% end %>
</span>
</div>
</div>
<% if(v['clear'] rescue false) %>
<div style="clear: both;"></div>
<% end %>
<% end %>
</div>
<div style="clear: both;"></div>
<div class="control-group">
<div class="control-label muted normal"><%=f.check_box :tax_excluded, :id=>"tax_excluded" %></div>
<div class="controls normal">
<%=t('vm_bill.tax_excluded')%>
</div>
</div>
<% fields = ['total_amount' ,'actual_amount','tax'] %>
<% fields.each_with_index do |field,i| %>
<div class="control-group" style="float: left;">
<div class="control-label normal <%= ( (i == 0) ? '' : 'no_margin')%>"><%=t("vm_bill.#{field}") %></div>
<div class="controls normal <%= ( (i == 0) ? '' : 'no_margin')%>">
<%= f.text_field field, :id=>field, :size=>'15', :style=>"width: auto;" %>
</div>
</div>
<% end %>
<div style="clear: both;"></div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_bill.deadline') %></label>
<div class="controls">
<%= f.datetime_picker :deadline, :no_label => true, :format=>"yyyy/MM/dd", :new_record => new_record %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_bill.received_date') %></label>
<div class="controls">
<%= f.datetime_picker :received_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => new_record %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<% translations_fields = {"reason"=>"text_field","pay_method"=>"text_field","note"=>"cktext_area"} %>
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Content -->
<% translations_fields.each do |field,type| %>
<div class="control-group input-content">
<label class="control-label muted"><%= t("vm_bill.#{field}") %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for "#{field}_translations" do |f1| %>
<%= f1.send(type, locale, rows: 5, class: "input-block-level", :value => (@venue_management_bill.send("#{field}_translations")[locale] rescue nil)) %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
<% end %>
<%= render partial: 'admin/venue_shared/venue_file_link',locals: {venue: @venue_management_bill,f: f} %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= get_referer_url[:venue_managemention] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% if !params[:id].nil? %>
<input type="hidden" name="referer_url" value="<%= venue_management_bills_admin_venue_management_path(params[:id]) %>">
<% else %>
<input type="hidden" name="referer_url" value="<%= get_referer_url %>">
<% end %>
<%= link_to t('cancel'), venue_management_memorabilias_admin_venue_management_path(id: @venue_management.id), :class=>"btn" %>
</div>
<script type="text/javascript">
<% cbt_html = {}
cbt.each do |kk,vv|
html = ""
vv.each do |k,v|
no_margin = (v['no_margin'] rescue false) ? 'no_margin' : ''
html += "<div class=\"control-group\" #{(v['float'].blank? rescue true) ? '' : "style=\"float: #{v['float']};\""}><label class=\"control-label #{no_margin}\">#{t("vm_bill.#{k}")}</label><div class=\"controls #{no_margin}\">"
other_keys = (v.keys - @venue_management_bill.class::NOTFIELDKEY) rescue []
if ( v['fields'].blank? rescue true)
html += f.text_field(k) if other_keys.blank?
else
v['fields'].each do |field_key|
f.fields_for k do |f|
html += f.text_field(field_key,:value => (@venue_management_bill.send(k)[field_key] rescue ""))
html += t("vm_bill.#{field_key}") if field_key != 'field_value'
end
end
end
if other_keys.present?
other_keys.each do |field_key|
f.fields_for k do |f|
html += t("vm_bill.#{field_key}") if v[field_key]['display_title'] == 'front'
if v[field_key]['option_select'].blank?
html += f.text_field(field_key,:value => (@venue_management_bill.send(k)[field_key] rescue ""))
else
if v[field_key]['type'].nil? || v[field_key]['type'] == 'select'
html += f.select(field_key , options_for_select(v[field_key]['option_select'].map{|o| [t("vm_bill.#{o}"),o]} ,(@venue_management_bill.send(k)[field_key] rescue "")))
else
value = (@venue_management_bill.send(k)[field_key] rescue "")
v[field_key]['option_select'].each do |o|
html += '<span>'
html += "<input type=\"#{v[field_key]['type']}\" name=\"#{f.object_name}[#{field_key}]#{((v[field_key]['type'] == 'checkbox') ? '[]' : '')}\" value=\"#{o}\" #{(value == o || (value.include?(o) rescue false)) ? 'checked' : ''} />"
html += t("vm_bill.#{o}")
html += '</span>'
end
end
end
html += t("vm_bill.#{field_key}") if (field_key != 'field_value' && !v[field_key].has_key?('display_title') )
html += '<span class="unit">'
if ( t("vm_bill")[v[field_key]['unit'].to_sym].nil? rescue true)
html += (v[field_key]['unit'].to_s rescue "")
else
html += (t("vm_bill.#{v[field_key]['unit'].to_s}") rescue "")
end
html += '</span>'
end
end
end
html += "<span class=\"unit\"> "
if ( t("vm_bill")[v['unit'].to_sym].nil? rescue true)
html += (v['unit'].to_s rescue "")
else
html += (t("vm_bill.#{v['unit'].to_s}") rescue "")
end
html += "</span>"
html += "</div></div>"
if(v['clear'] rescue false)
html += "<div style=\"clear: both;\"></div>"
end
end
cbt_html[kk] = html
end
%>
var cbt_html = <%=cbt_html.to_s.gsub('=>',':').html_safe %>;
//var cbt_init_func = <%#=cbt.map{|k,v| [k,v.map{|kk,vv| (vv["fields"].blank? rescue true) ? ("#{kk}=0") : (vv["fields"].map{|field| "#{field.gsub('/','')}s=[]"}.join(";")) }.join(";")]}.to_h.to_s.gsub('=>',':').html_safe %>;
<%=cbt.map{|k,v| v.map{|kk,vv| fields=vv["fields"].to_a;other_keys = (vv.keys - @venue_management_bill.class::NOTFIELDKEY) rescue [];fields.concat(other_keys);(fields.blank? rescue true) ? ("#{kk}=0") : (fields.map{|field| "#{field.gsub('/','')}s={}"}.join(";")) }.join(";")}.join(";").to_s.gsub('=>',':').html_safe %>
$("#caculation_basis_type").on('change',function(){
$("#caculation_basis_content").html(cbt_html[this.value]);
update_result();
$("#caculation_basis_content input").off("input").on("input",function(){
update_result();
})
})
<% cbt_fields = cbt.map{|k,v| [k,v.flat_map{|kk,vv| fields=vv["fields"].to_a;other_keys = (vv.keys - @venue_management_bill.class::NOTFIELDKEY) rescue [];fields.concat(other_keys);fields.map{|f| f.gsub('/','')+"s"}}.select{|f| f != "s"}.uniq] }.to_h %>
var cbt = <%= cbt_fields.to_s.gsub('=>',':').html_safe%>;
Number.prototype.ceil = function(){
return Math.ceil(this)
}
function inner_product(a,b){
var result = 0;
$.each(a,function(i,v){
var p = v*b[i];
if(!isNaN(p)){
result += p;
}
})
return result;
}
function inner_product_to_array(a,b,ref_val_for_b={}){
var result = [];
$.each(a,function(i,v){
var p;
if(Object.keys(ref_val_for_b).length == 0)
p = v*b[i];
else
p = v*ref_val_for_b[b[i]];
if(!isNaN(p)){
result.push(p);
}
})
return result;
}
function array_multiply_scalar(arr,scalar){
var result = [];
$.each(arr,function(i,v){
var p = v*scalar;
if(!isNaN(p)){
result.push(p);
}
})
return result;
}
function array_add(arr1,arr2){
var result = [];
$.each(arr1,function(i,v){
var p = v + arr2[i];
if(!isNaN(p)){
result.push(p);
}
})
return result;
}
function sum(arr){
var result = 0;
$.each(arr,function(i,v){
if(!isNaN(v)){
result += v;
}
})
return result;
}
function find_insert_index(arr,val){
var index = 0;
arr.forEach(function(v){
if(val >= v){
index++;
}else{
return index;
}
})
return index;
}
function update_result(){
var formula = CACILATYIONFORMULA[calculate_type].replace('f[0]','f');
//(function(){eval.call(this,cbt_init_func[calculate_type])})();
<%=cbt.map{|k,v| v.map{|kk,vv| fields=vv["fields"].to_a;other_keys = (vv.keys - @venue_management_bill.class::NOTFIELDKEY) rescue [];fields.concat(other_keys);(fields.blank? rescue true) ? ("#{kk}=0") : (fields.map{|field| "#{field.gsub('/','')}s={}"}.join(";")) }.join(";")}.join(";").to_s.gsub('=>',':').html_safe %>
$("#caculation_basis_content input").each(function(i,input){
var name = input.name;
name = name.replace('venue_management_bill','');
if(name.split('[').length == 2){
name = name.replace('[','').replace(']','');
window[name] = Number(input.value);
}else{
var temp_arr = name.split("[").slice(1)
field_name = temp_arr[0].replace(']','');
name = temp_arr.last().replace(']','') + 's';
var arr_flag = false;
if(name == "s"){
name = temp_arr[temp_arr.length - 2].replace(']','') + 's';
arr_flag = true;
}
name = name.replace("/","")
if(input.value != ""){
var val = Number(input.value);
if( Number.isNaN(val) && input.value != "" )
val = input.value;
if(arr_flag){
if(window[name][field_name] == undefined)
window[name][field_name] = [];
if(input.checked && window[name][field_name].indexOf(val) == -1)
window[name][field_name].push(val);
}
else{
if(input.type == 'radio' || input.type == 'checkbox' ){
if( input.checked )
window[name][field_name] = val;
}
else
window[name][field_name] = val;
}
}
else
window[name][field_name] = null;
}
})
var ks = cbt[calculate_type];
var value_name = cbt[calculate_type][0];
<%= ('switch (calculate_type) {
'+
cbt_fields.map{|k,fields|
(fields[0].blank? ? "" : "case '#{k}':
if(#{fields[0].blank? ? "undefined" : fields[0]} != undefined){"+
fields[1..-1].to_a.map{|f|
"$.each(#{fields[0]},function(k,v){
if(v == null){
delete #{f}[k];
}
})
#{f} = Object.values(#{f});
"
}.join(";") +
"var fields_to_delete = [];
$.each(#{fields[0]},function(k,v){
if(v == null){
fields_to_delete.push(k);
}
})
fields_to_delete.forEach(function(f){
delete #{fields[0]}[f];
})
#{fields[0]} = Object.values(#{fields[0]});"+
"}
break;
")
}.select{|s| s.present?}.join(" ")+
'default:'+
'
break;}').html_safe
%>
eval.call(window,formula);
if($("#tax_excluded").prop("checked")){
$("#total_amount").val(Math.round(result*1.05));
$("#actual_amount").val(Math.round(result));
$("#tax").val(Math.round(result*0.05));
}else{
$("#total_amount").val(Math.round(result));
$("#actual_amount").val(Math.round(result/1.05));
$("#tax").val(Math.round(result*0.05/1.05));
}
}
var CACILATYIONFORMULA = <%=@venue_management_bill.class::CACILATYIONFORMULA.to_s.gsub('=>',':').html_safe %>;
var calculate_type = $("#caculation_basis_type").val();
$("#caculation_basis_type").click(function(){
calculate_type = this.value;
update_result();
})
$("#tax_excluded").click(function(){
update_result();
})
$("#caculation_basis_content input").off("input").on("input",function(){
update_result();
})
$(document).ready(function(){
update_result();
})
</script>

View File

@ -0,0 +1,91 @@
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<% end %>
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<% if 'venue_management_bills' == params[:action] %>
<h4><%= @venue_management.title %></h4>
<% end %>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= Admin::VenueManagementBillsHelper.thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @bills.each do |bill| %>
<tr>
<% if 'venue_management_bills' != params[:action] %>
<td><%= bill.venue_management_main.title %></td>
<% end %>
<td>
<% contractors = bill.contractor.display_contractors rescue "" %>
<% contractors = t(:empty) if contractors.blank? %>
<%= link_to contractors, (@venue_management_page_url.blank? ? "#" : "/#{I18n.locale}"+@venue_management_page_url+"/#{contractors.to_s.strip}-#{bill.id}?method=show_bill"), :target => '_self' %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@venue_management || bill.venue_management_main) %>
<li><%= link_to t(:edit), edit_admin_venue_management_bill_path(bill.id) %></li>
<li><%= link_to t(:copy), copy_admin_venue_management_bills_path(:id=>bill.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_bills/<%=bill.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</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.display_note %></td>
</tr>
<% end %>
</tbody>
</table>
<% filter_url = request.fullpath.split("?")[1..-1].join("?") %>
<% if @venue_management.present? %>
<% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
<!-- footer -->
<div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination-centered" do %>
<%= paginate(@bills) %>
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_bills_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank' %>
<% if can_edit_or_delete?(@venue_management) %>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_venue_management_bill_path(id: @venue_management.id), class: "btn btn-primary" %>
<% end %>
</div>
<% end %>
</div>
<!-- footer:end -->
<% else %>
<%=
content_tag :div, class: "bottomnav clearfix" do
(content_tag(:div, class: "pagination-centered") do
paginate(@bills)
end) +
('<div class="action pull-right">'.html_safe +
link_to(content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_bills_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank') +
'</div>'.html_safe)
end
%>
<% end %>
<style type="text/css">
.pagination-centered .pagination{
width: calc(100% - 18em);
padding-left: 6em;
float: left;
}
.main-list {
margin-bottom: 30px;
}
</style>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_bill, url: admin_venue_management_bills_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_bill, url: admin_venue_management_bill_path(@venue_management_bill), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,44 @@
# encoding: utf-8
wb = xlsx_package.workbook
wb.add_worksheet(name: t('restful_actions.venue_management_bills')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('venue_management.contractor')
row << t('vm_bill.accounting_month')
row << t('vm_bill.bill_type')
row << t('vm_bill.caculation_basis')
row << t('vm_bill.total_amount')
row << t('vm_bill.pay_date')
row << t('vm_bill.reason')
row << t('vm_bill.pay_method')
row << t('vm_bill.note')
row << t("link")
row << t("link") + " " + t("url_alt")
row << t("file_")
row << t("file_") + " " + t("description")
row << t("file_") + " " + t("alternative")
sheet.add_row row
@bills.each do |bill|
row2 = []
row2 << bill.venue_management_main.title if @id.blank?
row2 << (bill.contractor.display_contractors rescue "")
row2 << bill.display_accounting_month
row2 << "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}"
row2 << bill.display_caculation_basis
row2 << bill.total_amount
row2 << bill.pay_date
row2 << bill.reason
row2 << bill.pay_method
row2 << bill.note
row2 << bill.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
row2 << bill.venue_management_links.map{|l| l.title.to_s.strip}.join(";")
row2 << bill.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
row2 << bill.venue_management_files.map{|f| f.description.to_s.strip}.join(";")
row2 << bill.venue_management_files.map{|f| f.title.to_s.strip}.join(";")
sheet.add_row row2
end
end

View File

@ -0,0 +1,9 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_bill, url: admin_venue_management_bills_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,329 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<!-- Input Area -->
<div class="input-area">
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<%= f.hidden_field :venue_management_main_id %>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.case_no') %></label>
<div class="controls">
<%= f.select :venue_management_inviting_id, @venue_management.venue_management_invitings.map { |i| [ i.case_no, i.id ] }, :include_blank => true %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.type') %></label>
<div class="controls">
<div id="vm_inviting_type" style="padding-top: 0.3em;"><%= @venue_management_contract.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue "" %></div>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('venue_management.contractor') %></label>
<div class="controls">
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_contract[contractor_ids][]', email_members:Array(@venue_management_contract.contractors), index:'2',select_name:'contractors'} %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.early_rent') %></label>
<div class="controls">
<%= f.number_field :early_rent %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.operation_rent') %></label>
<div class="controls">
<%= f.number_field :operation_rent %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.royalty') %></label>
<div class="controls">
<%= f.text_area :royalty %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.house_tax_payer') %></label>
<div class="controls">
<%= f.select :house_tax_payer, VenueManagementInviting::PAYERS.map { |p| [t("vm_inviting.enums.#{p}"), p] } %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.land_tax_payer') %></label>
<div class="controls">
<%= f.select :land_tax_payer, VenueManagementInviting::PAYERS.map { |p| [t("vm_inviting.enums.#{p}"), p] } %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.contract_start_date') %></label>
<div class="controls">
<%= f.datetime_picker :contract_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.contract_end_date') %></label>
<div class="controls">
<%= f.datetime_picker :contract_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.free_period_start_date') %></label>
<div class="controls">
<%= f.datetime_picker :free_period_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.free_period_end_date') %></label>
<div class="controls">
<%= f.datetime_picker :free_period_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.construction_start_date') %></label>
<div class="controls">
<%= f.datetime_picker :construction_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.construction_end_date') %></label>
<div class="controls">
<%= f.datetime_picker :construction_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.operation_start_date') %></label>
<div class="controls">
<%= f.datetime_picker :operation_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.operation_end_date') %></label>
<div class="controls">
<%= f.datetime_picker :operation_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.sign_date') %></label>
<div class="controls">
<%= f.datetime_picker :sign_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.handover_date') %></label>
<div class="controls">
<%= f.datetime_picker :handover_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.deposit_amount') %></label>
<div class="controls">
<%= f.text_field :deposit_amount %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.deposit_payment_date') %></label>
<div class="controls">
<%= f.datetime_picker :deposit_payment_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.deposit_type') %></label>
<div class="controls">
<% select_fields = ["現金(支票)","設定質權之金融機構定期存款單","銀行書面連帶保證","其他(可填入資料)"] %>
<%= f.select :deposit_type, options_for_select(select_fields,(select_fields.include?(@venue_management_contract.deposit_type) ? @venue_management_contract.deposit_type : "其他(可填入資料)")) %>
<%= f.text_field :deposit_type , :value => (select_fields.include?(@venue_management_contract.deposit_type) ? "" : @venue_management_contract.deposit_type) ,:style => (select_fields.include?(@venue_management_contract.deposit_type) ? "display:none" : "") , :id => 'venue_management_contract_deposit_type_text' %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.deposit_exp_date') %></label>
<div class="controls">
<%= f.datetime_picker :deposit_exp_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_type') %></label>
<div class="controls">
<%= f.text_field :insurance_type %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_deadline') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_deadline, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_date') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_type2') %></label>
<div class="controls">
<%= f.text_field :insurance_type2 %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_deadline2') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_deadline2, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_date2') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_date2, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_type3') %></label>
<div class="controls">
<%= f.text_field :insurance_type3 %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_deadline3') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_deadline3, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.insurance_payment_date3') %></label>
<div class="controls">
<%= f.datetime_picker :insurance_payment_date3, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_contract.renewal_permission') %></label>
<div class="controls">
<%= f.check_box :renewal_permission,:id => 'renewal_permission' %>
</div>
</div>
<div class="control-group" id="renewal_deadline" style="<%= 'display:none' if !@venue_management_contract.renewal_permission %>">
<label class="control-label muted"><%= t('vm_contract.renewal_deadline') %></label>
<div class="controls">
<%= f.datetime_picker :renewal_deadline, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_contract.new_record? %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Content -->
<div class="control-group input-content">
<label class="control-label muted"><%= t('vm_contract.other_commitment') %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :other_commitment_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@venue_management_contract.other_commitment_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<div class="control-group input-content">
<label class="control-label muted"><%= t('vm_contract.note') %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :note_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@venue_management_contract.note_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<%= render partial: 'admin/venue_shared/venue_file_link_reminder',locals: {venue: @venue_management_contract,f: f} %>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= get_referer_url[:venue_managemention] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% if !params[:id].nil? %>
<input type="hidden" name="referer_url" value="<%= venue_management_contracts_admin_venue_management_path(params[:id]) %>">
<% else %>
<input type="hidden" name="referer_url" value="<%= get_referer_url %>">
<% end %>
<%= link_to t('cancel'), venue_management_contracts_admin_venue_management_path(id: @venue_management.id), :class=>"btn" %>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#renewal_permission').change(function(){
if ($(this).prop('checked')){
$('#renewal_deadline').show()
}else{
$('#renewal_deadline').hide()
}
})
$('#venue_management_contract_venue_management_inviting_id').change(function(){
$.ajax({
url : "/admin/venue_management_contracts/fetch_inviting",
data : {"id" : $(this).val()},
dataType : "json",
type : "post",
success : function(data){
$.each(data,function(k,v){
$('*[name="venue_management_contract['+k+']"]').val(v)
})
}
})
})
var venue_management_inviting_tags_relations = JSON.parse('<%=VenueManagementInviting.all.select{|v| !v.case_no.blank?}.map{|v| [v.id.to_s,(v.tags.map{|t| t.name}.join(" , ") rescue "")]}.to_h.to_json.html_safe %>');
$('[name="venue_management_contract[venue_management_inviting_id]"]').click(function(){
var tag_names = venue_management_inviting_tags_relations[$(this).val()];
if(tag_names != undefined){
$("#vm_inviting_type").html(tag_names);
}else{
$("#vm_inviting_type").html("");
}
})
$('select[name="venue_management_contract[deposit_type]"]').click(function(){
var select_index = $(this).find('option[value="'+$(this).val()+'"]').index();
if(select_index == $(this).find("option").eq(-1).index()){
$("#venue_management_contract_deposit_type_text").css("display",'');
}else{
$("#venue_management_contract_deposit_type_text").css("display",'none');
}
})
$(".wrap-inner form").submit(function(){
var $select = $('select[name="venue_management_contract[deposit_type]"]');
var select_index = $select.find('option[value="'+$select.val()+'"]').index();
if(select_index != $select.find("option").eq(-1).index()){
$("#venue_management_contract_deposit_type_text").remove();
}
})
})
</script>

View File

@ -0,0 +1,87 @@
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<% if 'venue_management_contracts' == params[:action] %>
<h4><%= @venue_management.title %></h4>
<% end %>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @contracts.each do |contract| %>
<tr>
<% if 'venue_management_contracts' != params[:action] %>
<td><%= contract.venue_management_main.title %></td>
<% end %>
<td>
<% case_no = (contract.case_no.nil? ? t(:empty) : contract.case_no) %>
<%= link_to case_no, (@venue_management_page_url.blank? ? "#" : "/#{I18n.locale}"+@venue_management_page_url+"/#{case_no.to_s.strip}-#{contract.id}?method=show_contract"), :target => '_self' %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@venue_management || contract.venue_management_main) %>
<li><%= link_to t(:edit), edit_admin_venue_management_contract_path(contract.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_contracts/<%=contract.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= contract.display_tags %></td>
<td><%= contract.display_contractors %></td>
<td><%= "#{contract.early_rent} / #{contract.operation_rent}" %></td>
<td><%= contract.display_royalty %></td>
<td><%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %></td>
<td><%= contract.deposit_amount_type_exp_date %></td>
<td><%= contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false") %></td>
<td><%= contract.display_other_commitment %></td>
<td><%= contract.display_note %></td>
</tr>
<% end %>
</tbody>
</table>
<% filter_url = request.fullpath.split("?")[1..-1].join("?") %>
<% if @venue_management.present? %>
<% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
<!-- footer -->
<div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination-centered" do %>
<%= paginate(@contracts) %>
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_contracts_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank' %>
<% if can_edit_or_delete?(@venue_management) %>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_venue_management_contract_path(id: @venue_management.id), class: "btn btn-primary" %>
<% end %>
</div>
<% end %>
</div>
<!-- footer:end -->
<% else %>
<%=
content_tag :div, class: "bottomnav clearfix" do
(content_tag(:div, class: "pagination-centered") do
paginate(@contracts)
end) +
('<div class="action pull-right">'.html_safe +
link_to(content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_contracts_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank') +
'</div>'.html_safe)
end
%>
<% end %>
<style type="text/css">
.pagination-centered .pagination{
width: calc(100% - 6em);
float: left;
}
.main-list {
margin-bottom: 30px;
}
</style>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_contract, url: admin_venue_management_contract_path(@venue_management_contract), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,87 @@
# encoding: utf-8
wb = xlsx_package.workbook
wb.add_worksheet(name: t('restful_actions.venue_management_contracts')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('vm_contract.case_no')
row << t('vm_inviting.type')
row << t('venue_management.contractor')
row << t('vm_inviting.rents')
row << t('vm_inviting.royalty')
row << t('vm_inviting.house_land_tax_payer')
row << t('vm_contract.renewal_permission')
row << t('vm_contract.start_end')
row << t('vm_contract.construction_start_end')
row << t('vm_contract.operation_start_end')
row << t('vm_contract.free_period_start_end')
row << t('vm_contract.sign_date')
row << t('vm_contract.handover_date')
row << t('vm_contract.deposit_payment_date')
row << t('vm_contract.deposit_type')
row << t('vm_contract.deposit_exp_date')
row << t('vm_contract.insurance_type')
row << t('vm_contract.insurance_payment_deadline')
row << t('vm_contract.insurance_payment_date')
@site_in_use_locales.each do |locale|
row << t('vm_contract.other_commitment') + " - " + t(locale)
end
@site_in_use_locales.each do |locale|
row << t('vm_contract.note') + " - " + t(locale)
end
row << t("link")
@site_in_use_locales.each do |locale|
row << t("link") + " " + t("url_alt") + " - " + t(locale)
end
row << t("file_")
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("description") + " - " + t(locale)
end
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("alternative") + " - " + t(locale)
end
sheet.add_row row
@contracts.each do |contract|
row2 = []
row2 << contract.venue_management_main.title if @id.blank?
row2 << contract.case_no
row2 << contract.display_tags
row2 << contract.display_contractors
row2 << "#{contract.early_rent} / #{contract.operation_rent}"
row2 << contract.royalty
row2 << t("vm_inviting.enums.#{contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{contract.land_tax_payer}")
row2 << contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false")
row2 << "#{contract.contract_start_date} ~ #{contract.contract_end_date}"
row2 << "#{contract.construction_start_date} ~ #{contract.construction_end_date}"
row2 << "#{contract.operation_start_date} ~ #{contract.operation_end_date}"
row2 << "#{contract.free_period_start_date} ~ #{contract.free_period_end_date}"
row2 << contract.sign_date
row2 << contract.handover_date
row2 << contract.deposit_payment_date
row2 << contract.deposit_type
row2 << contract.deposit_exp_date
row2 << contract.insurance_type
row2 << contract.insurance_payment_deadline
row2 << contract.insurance_payment_date
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(contract.other_commitment_translations[locale].to_s).css("body").text
end
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(contract.note_translations[locale].to_s).css("body").text
end
row2 << contract.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_links.map{|l| l.title_translations[locale].to_s.strip}.join(";")
end
row2 << contract.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_files.map{|f| f.description_translations[locale].to_s.strip}.join(";")
end
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_files.map{|f| f.title_translations[locale].to_s.strip}.join(";")
end
sheet.add_row row2
end
end

View File

@ -0,0 +1,9 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_contract, url: admin_venue_management_contracts_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,153 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<!-- Input Area -->
<div class="input-area">
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<!-- Tag Module -->
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.type') %></label>
<%= select_tags(f, @module_app) %>
</div>
<%= f.hidden_field :venue_management_main_id %>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.case_no') %></label>
<div class="controls">
<%= f.text_field :case_no %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.publish_times') %></label>
<div class="controls">
<%= f.number_field :publish_times %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.start_date') %></label>
<div class="controls">
<%= f.datetime_picker :start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_inviting.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.end_date') %></label>
<div class="controls">
<%= f.datetime_picker :end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_inviting.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.close_date') %></label>
<div class="controls">
<%= f.datetime_picker :close_date, :no_label => true, :format=>"yyyy/MM/dd HH:mm", :new_record => @venue_management_inviting.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.bid_date') %></label>
<div class="controls">
<%= f.datetime_picker :bid_date, :no_label => true, :format=>"yyyy/MM/dd HH:mm", :new_record => @venue_management_inviting.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.evaluation_date') %></label>
<div class="controls">
<%= f.datetime_picker :evaluation_date, :no_label => true, :format=>"yyyy/MM/dd HH:mm", :new_record => @venue_management_inviting.new_record? %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.early_rent') %></label>
<div class="controls">
<%= f.number_field :early_rent %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.operation_rent') %></label>
<div class="controls">
<%= f.number_field :operation_rent %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.royalty') %></label>
<div class="controls">
<%= f.text_area :royalty %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.house_tax_payer') %></label>
<div class="controls">
<%= f.select :house_tax_payer, options_for_select(VenueManagementInviting::PAYERS.map { |p| [t("vm_inviting.enums.#{p}"), p] },(@venue_management_inviting.new_record? ? VenueManagementInviting::PAYERS.last : @venue_management_inviting.house_tax_payer)) %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.land_tax_payer') %></label>
<div class="controls">
<%= f.select :land_tax_payer, options_for_select(VenueManagementInviting::PAYERS.map { |p| [t("vm_inviting.enums.#{p}"), p] },(@venue_management_inviting.new_record? ? VenueManagementInviting::PAYERS.last : @venue_management_inviting.land_tax_payer)) %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_inviting.bid_result') %></label>
<div class="controls">
<%= f.select :bid_result, VenueManagementInviting::BID_RESULTS.map { |p| [t("vm_inviting.enums.bid_result.#{p}"), p] } %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Content -->
<div class="control-group input-content">
<label class="control-label muted"><%= t('vm_inviting.details') %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :details_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@venue_management_inviting.details_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<%= render partial: 'admin/venue_shared/venue_file_link',locals: {venue: @venue_management_inviting,f: f} %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= get_referer_url[:venue_managemention] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% if !params[:id].nil? %>
<input type="hidden" name="referer_url" value="<%= venue_management_invitings_admin_venue_management_path(params[:id]) %>">
<% else %>
<input type="hidden" name="referer_url" value="<%= get_referer_url %>">
<% end %>
<%= link_to t('cancel'), venue_management_invitings_admin_venue_management_path(id: @venue_management.id), :class=>"btn" %>
</div>

View File

@ -0,0 +1,82 @@
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<% if 'venue_management_invitings' == params[:action] %>
<h4><%= @venue_management.title %></h4>
<% end %>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @invitings.each do |inviting| %>
<tr>
<% if 'venue_management_invitings' != params[:action] %>
<td><%= inviting.venue_management_main.title %></td>
<% end %>
<td>
<%= link_to inviting.display_case_no, (@venue_management_page_url.blank? ? "#" : "/#{I18n.locale}"+@venue_management_page_url+"/#{inviting.display_case_no.strip}-#{inviting.id}?method=show_inviting"), :target => '_self' %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@venue_management || inviting.venue_management_main) %>
<li><%= link_to t(:edit), edit_admin_venue_management_inviting_path(inviting.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_invitings/<%=inviting.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= inviting.tags.map{|t| t.name}.join(" , ") rescue "" %></td>
<td><%= inviting.publish_times %></td>
<td><%= inviting.start_date.to_s + "/" + inviting.end_date.to_s %></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>
<td><%= inviting.display_details %></td>
</tr>
<% end %>
</tbody>
</table>
<% filter_url = request.fullpath.split("?")[1..-1].join("?") %>
<% if @venue_management.present? %>
<% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
<!-- footer -->
<div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination-centered" do %>
<%= paginate(@invitings) %>
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_invitings_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank' %>
<% if can_edit_or_delete?(@venue_management) %>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_venue_management_inviting_path(id: @venue_management.id), class: "btn btn-primary" %>
<% end %>
</div>
<% end %>
</div>
<!-- footer:end -->
<% else %>
<%=
content_tag :div, class: "bottomnav clearfix" do
(content_tag(:div, class: "pagination-centered") do
paginate(@invitings)
end) +
('<div class="action pull-right">'.html_safe +
link_to(content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_invitings_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank') +
'</div>'.html_safe)
end
%>
<% end %>
<style type="text/css">
.pagination-centered .pagination{
width: calc(100% - 6em);
float: left;
}
.main-list {
margin-bottom: 30px;
}
</style>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_inviting, url: admin_venue_management_inviting_path(@venue_management_inviting), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,60 @@
# encoding: utf-8
wb = xlsx_package.workbook
wb.add_worksheet(name: t('restful_actions.venue_management_invitings')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('vm_inviting.type')
row << t('vm_inviting.case_no')
row << t('vm_inviting.publish_times')
row << t('vm_inviting.rents')
row << t('vm_inviting.royalty')
row << t('vm_inviting.house_land_tax_payer')
row << t('vm_inviting.contractor_manager')
row << t('vm_inviting.bid_result')
@site_in_use_locales.each do |locale|
row << t('vm_inviting.details') + "-" + t(locale)
end
row << t("link")
@site_in_use_locales.each do |locale|
row << t("link") + " " + t("url_alt") + " - " + t(locale)
end
row << t("file_")
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("description") + " - " + t(locale)
end
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("alternative") + " - " + t(locale)
end
sheet.add_row row
@invitings.each do |inviting|
row2 = []
row2 << inviting.venue_management_main.title if @id.blank?
row2 << inviting.tags.map{|t| t.name}.join(" , ")
row2 << inviting.case_no
row2 << inviting.publish_times
row2 << "#{inviting.early_rent} / #{inviting.operation_rent}"
row2 << inviting.royalty
row2 << t("vm_inviting.enums.#{inviting.house_tax_payer}")+"/"+t("vm_inviting.enums.#{inviting.land_tax_payer}")
row2 << inviting.contractor_manager
row2 << t("vm_inviting.enums.bid_result.#{inviting.bid_result}")
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(inviting.details_translations[locale].to_s).css("body").text
end
row2 << inviting.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_links.map{|l| l.title_translations[locale].to_s.strip}.join(";")
end
row2 << inviting.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_files.map{|f| f.description_translations[locale].to_s.strip}.join(";")
end
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_files.map{|f| f.title_translations[locale].to_s.strip}.join(";")
end
sheet.add_row row2
end
end

View File

@ -0,0 +1,9 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_inviting, url: admin_venue_management_invitings_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,80 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<!-- Input Area -->
<div class="input-area">
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<%= f.hidden_field :venue_management_main_id %>
<div class="control-group">
<label class="control-label muted"><%= t('vm_memorabilia.case_no') %></label>
<div class="controls">
<%= f.select :venue_management_inviting_id, @venue_management.venue_management_invitings.map { |i| [ i.case_no, i.id ] }, :include_blank => true %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t('vm_memorabilia.event_date') %></label>
<div class="controls">
<%= f.datetime_picker :event_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management_memorabilia.new_record? %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Content -->
<div class="control-group input-content">
<label class="control-label muted"><%= t('vm_memorabilia.details') %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :details_translations do |f1| %>
<%= f1.cktext_area locale, rows: 5, class: "input-block-level", :value => (@venue_management_memorabilia.details_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<%= render partial: 'admin/venue_shared/venue_file_link',locals: {venue: @venue_management_memorabilia,f: f} %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= get_referer_url[:venue_managemention] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% if !params[:id].nil? %>
<input type="hidden" name="referer_url" value="<%= venue_management_memorabilias_admin_venue_management_path(params[:id]) %>">
<% else %>
<input type="hidden" name="referer_url" value="<%= get_referer_url %>">
<% end %>
<%= link_to t('cancel'), venue_management_memorabilias_admin_venue_management_path(id: @venue_management.id), :class=>"btn" %>
</div>

View File

@ -0,0 +1,66 @@
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<% if 'venue_management_memorabilias' == params[:action] %>
<h4><%= @venue_management.title %></h4>
<% end %>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @memorabilias.each do |memorabilia| %>
<tr>
<% if 'venue_management_memorabilias' != params[:action] %>
<td><%= memorabilia.venue_management_main.title %></td>
<% end %>
<td>
<%= link_to (memorabilia.case_no.blank? ? t("empty") : @venue_management_page_url.blank? ? "" : memorabilia.case_no), ("/#{I18n.locale}"+@venue_management_page_url+"/#{memorabilia.case_no.to_s.strip}-#{memorabilia.id}?method=show_memorabilia") , :target => '_blank' %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@venue_management || memorabilia.venue_management_main) %>
<li><%= link_to t(:edit), edit_admin_venue_management_memorabilia_path(memorabilia.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_memorabilias/<%=memorabilia.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= memorabilia.event_date %></td>
<td><%= memorabilia.display_details %></td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@memorabilias), class: "pagination pagination-centered"
end
%>
<% if @venue_management.present? %>
<!-- footer -->
<div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination pagination-centered" do %>
<%= paginate(@memorabilias) %>
<% if can_edit_or_delete?(@venue_management) %>
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_venue_management_memorabilia_path(id: @venue_management.id), class: "btn btn-primary" %>
</div>
<% end %>
<% end %>
</div>
<!-- footer:end -->
<% end %>
<style type="text/css">
.pagination-centered .pagination{
width: calc(100% - 6em);
float: left;
}
.main-list {
margin-bottom: 30px;
}
</style>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_memorabilia, url: admin_venue_management_memorabilia_path(@venue_management_memorabilia), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,9 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,5 @@
<%= form_for @venue_management_memorabilia, url: admin_venue_management_memorabilias_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render :partial => 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -11,7 +11,7 @@
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "lib/module-area" %>
<% end %> <% end %>
<style type="text/css"> <style type="text/css">
.col-sm-10.controls{ .col-sm-10.controls{
@ -20,24 +20,44 @@
.input-append input{ .input-append input{
width: 150px; width: 150px;
} }
.display_infos{
padding-top: 0.3em;
}
.venue_managementive-title-field{
font-size: 14px;
font-weight: normal;
}
.venue_managementive-title-value{
display: block;
}
tr.control-group{
display: block;
}
</style> </style>
<!-- Input Area --> <!-- Input Area -->
<div class="input-area"> <div class="input-area">
<!-- Module Tabs --> <!-- Module Tabs -->
<% flash.each do |type, msg| %>
<div class="alert alert-danger">
<%= msg %>
</div>
<% end %>
<div class="nav-name"><strong><%= t(:module) %></strong></div> <div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav"> <ul class="nav nav-pills module-nav">
<li class="active"><a href="#basic" data-toggle="tab"><%= t(:basic) %></a></li> <li class="active"><a href="#basic" data-toggle="tab"><%= t(:basic) %></a></li>
<li><a href="#signup" data-toggle="tab"><%= t('venue_management.signup') %></a></li>
<!-- <!--
<li><a href="#review" data-toggle="tab"><%# t('venue_management.review') %></a></li> <li><a href="#review" data-toggle="tab"><%# t('venue_management.review') %></a></li>
--> -->
<!-- <!--
<li><a href="#signup_set" data-toggle="tab"><%# t('venue_management.signup_set') %></a></li> <li><a href="#signup_set" data-toggle="tab"><%# t('venue_management.signup_set') %></a></li>
<li><a href="#submission_set" data-toggle="tab"><%# t('venue_management.submission_set') %></a></li> <li><a href="#submission_set" data-toggle="tab"><%# t('venue_management.submission_set') %></a></li>
--> -->
<!--
<li><a href="#custom_set" data-toggle="tab"><%= t('venue_management.custom_set') %></a></li> <li><a href="#custom_set" data-toggle="tab"><%= t('venue_management.custom_set') %></a></li>
<li><a href="#auto_send_email_set" data-toggle="tab"><%= t('venue_management.auto_send_email_set') %></a></li> <li><a href="#auto_send_email_set" data-toggle="tab"><%= t('venue_management.auto_send_email_set') %></a></li>
-->
</ul> </ul>
<!-- Module --> <!-- Module -->
@ -62,92 +82,129 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t('venue_management.contractor') %></label> <label class="control-label muted"><%= t('venue_management.event_during') %></label>
<div class="controls"> <div class="controls display_infos">
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_main[contractor_ids][]', email_members:Array(@contractors), index:'2',select_name:'contractors'} %> <%= f.object.display_event_during %>
</div> </div>
</div> </div>
<!-- VenueManagement Date Time Picker -->
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t('venue_management.venue_management_start_date') %></label> <label class="control-label muted"><%= t('venue_management.signup_during') %></label>
<div class="controls"> <div class="controls display_infos">
<%= f.datetime_picker :venue_management_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <%= f.object.display_signup_during %>
</div> </div>
</div> </div>
<% @venue_management_contract = f.object.venue_management_contracts.desc(:id).first %>
<div class="control-group"> <% if !@venue_management_contract.nil? %>
<label class="control-label muted"><%= t('venue_management.venue_management_end_date') %></label> <table>
<div class="controls"> <tbody>
<%= f.datetime_picker :venue_management_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <tr class="control-group">
</div> <th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.case_no') %></th>
</div> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management.newest_case_no %></td>
</tr>
</div> <tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.type') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.display_tags %></td>
<!-- Sign up Module --> </tr>
<div class="tab-pane fade in " id="signup"> <tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><%= t('venue_management.contractor') %></th>
<!-- host --> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.display_contractors %></td>
<!-- </tr>
<div class="control-group"> <tr class="control-group">
<label class="control-label muted"><%# t("venue_management.registration_status") %></label> <th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.rents') %></th>
<div class="controls"> <td class="venue_managementive-title-value controls display_infos"><%= "#{@venue_management_contract.early_rent} / #{@venue_management_contract.operation_rent}" %></td>
<%# ['G','C'].each do |t| %> </tr>
<label class="checkbox inline"> <tr class="control-group">
<input type="checkbox" name="venue_management_main[registration_status][]" value="<%#=t%>" <%#=(!@venue_management.registration_status.blank? and @venue_management.registration_status.include?(t)) ? "checked" : "" %> ><%# t("venue_management.registration_status_#{t}") %> <th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.royalty') %></th>
</label> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.royalty %></td>
<%# end %> </tr>
</div> <tr class="control-group">
</div> <tr class="control-group">
--> <th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.house_land_tax_payer') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= t("vm_inviting.enums.#{@venue_management_contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_contract.land_tax_payer}") %></td>
<div class="control-group"> </tr>
<label class="control-label muted"><%= t('venue_management.coordinator') %></label> <tr class="control-group">
<div class="controls"> <th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.renewal_permission') %></th>
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_main[coordinator_ids][]', email_members:Array(@coordinators), index:'3',select_name:'coordinators'} %> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.renewal_permission.present? ? t("vm_contract.renewal.#{@venue_management_contract.renewal_permission}") : t("vm_contract.renewal.false") %></td>
</div> </tr>
</div> <tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.start_end') %></th>
<!-- Sign up Date Time Picker --> <td class="venue_managementive-title-value controls display_infos"><%= "#{@venue_management_contract.contract_start_date} ~ #{@venue_management_contract.contract_end_date}" %></td>
<div class="control-group"> </tr>
<label class="control-label muted"><%= t('venue_management.signup_start_date') %></label> <tr class="control-group">
<div class="controls"> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.construction_start_end') %></th>
<%= f.datetime_picker :signup_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <td class="venue_managementive-title-value controls display_infos"><%= "#{@venue_management_contract.construction_start_date} ~ #{@venue_management_contract.construction_end_date}" %></td>
</div> </tr>
</div> <tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.operation_start_end') %></th>
<div class="control-group"> <td class="venue_managementive-title-value controls display_infos"><%= "#{@venue_management_contract.operation_start_date} ~ #{@venue_management_contract.operation_end_date}" %></td>
<label class="control-label muted"><%= t('venue_management.signup_end_date') %></label> </tr>
<div class="controls"> <tr class="control-group">
<%= f.datetime_picker :signup_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.free_period_start_end') %></th>
</div> <td class="venue_managementive-title-value controls display_infos"><%= "#{@venue_management_contract.free_period_start_date} ~ #{@venue_management_contract.free_period_end_date}" %></td>
</div> </tr>
<tr class="control-group">
<!-- Contribute Date Time Picker --> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.sign_date') %></th>
<div class="control-group"> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.sign_date %></td>
<label class="control-label muted"><%= t('venue_management.contribute_start_date') %></label> </tr>
<div class="controls"> <tr class="control-group">
<%= f.datetime_picker :contribute_start_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.handover_date') %></th>
</div> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.handover_date %></td>
</div> </tr>
<tr class="control-group">
<div class="control-group"> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.deposit_payment_date') %></th>
<label class="control-label muted"><%= t('venue_management.contribute_end_date') %></label> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.deposit_payment_date %></td>
<div class="controls"> </tr>
<%= f.datetime_picker :contribute_end_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => @venue_management.new_record? %> <tr class="control-group">
</div> <th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.deposit_type') %></th>
</div> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.deposit_type %></td>
</tr>
<div class="control-group"> <tr class="control-group">
<label class="control-label muted"><%= t('venue_management.contribute_file_count') %></label> <th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.deposit_exp_date') %></th>
<div class="controls"> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.deposit_exp_date %></td>
<%= f.text_field :contribute_file_count %> </tr>
(<%= t('venue_management.blank_no_limit') %>) <tr class="control-group">
</div> <th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.insurance_type') %></th>
</div> <td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.insurance_type %></td>
</tr>
<tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_deadline') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.insurance_payment_deadline %></td>
</tr>
<tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_date') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.insurance_payment_date %></td>
</tr>
<tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.other_commitment') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.other_commitment.to_s.html_safe %></td>
</tr>
<tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.note') %></th>
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.note %></td>
</tr>
<% if !@venue_management_contract.venue_management_files.blank? %>
<tr class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-fw fa-paperclip"></i><%= t(:file_) %></th>
<td class="venue_managementive-title-value controls display_infos">
<% @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 class="control-group">
<th class="venue_managementive-title-field control-label muted"><i class="fa fa-fw fa-link"></i><%= t(:link) %></th>
<td class="venue_managementive-title-value controls display_infos">
<% @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 %>
</tbody>
</table>
<% end %>
</div> </div>
<!-- Review Module --> <!-- Review Module -->
<!-- <!--
@ -162,7 +219,7 @@
<%# render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_main[venue_management_reviews_attributes][0][reviewer_id][]', email_members:[]} %> <%# render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_main[venue_management_reviews_attributes][0][reviewer_id][]', email_members:[]} %>
<%# end %> <%# end %>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label muted"><%= t('venue_management.review_start_date') %></label> <label class="control-label muted"><%= t('venue_management.review_start_date') %></label>
<div class="controls"> <div class="controls">
@ -191,7 +248,7 @@
</thead> </thead>
<tbody> <tbody>
<%# @signup_sets.each_with_index do |attr_signup,signup_index| %> <%# @signup_sets.each_with_index do |attr_signup,signup_index| %>
<tr> <tr class="control-group">
<td> <td>
<%#= t("venue_management_signup.#{attr_signup.field_name}") %> <%#= t("venue_management_signup.#{attr_signup.field_name}") %>
</td> </td>
@ -216,7 +273,7 @@
<%# end %> <%# end %>
</tbody> </tbody>
</table> </table>
</div> </div>
--> -->
<!-- Submission Set Module --> <!-- Submission Set Module -->
@ -232,7 +289,7 @@
</thead> </thead>
<tbody> <tbody>
<%# @submission_set.each_with_index do |attr_signup,submission_index| %> <%# @submission_set.each_with_index do |attr_signup,submission_index| %>
<tr> <tr class="control-group">
<td> <td>
<%#= t("venue_management_signup.#{attr_signup.field_name}") %> <%#= t("venue_management_signup.#{attr_signup.field_name}") %>
</td> </td>
@ -266,7 +323,7 @@
</thead> </thead>
<tbody> <tbody>
<% @custom_set.each_with_index do |attr_custom,custom_index| %> <% @custom_set.each_with_index do |attr_custom,custom_index| %>
<tr> <tr class="control-group">
<td> <td>
<%= VenueManagementSignupField.where(id:attr_custom.venue_management_signup_field_id).first.title rescue '' %> <%= VenueManagementSignupField.where(id:attr_custom.venue_management_signup_field_id).first.title rescue '' %>
</td> </td>
@ -310,7 +367,7 @@
<div class="tab-pane<%= active_email_set %>" id="email_set<%= index1 %>" style="padding: 1.2em;"> <div class="tab-pane<%= active_email_set %>" id="email_set<%= index1 %>" style="padding: 1.2em;">
<table style="width:100%;"> <table style="width:100%;">
<tbody> <tbody>
<tr> <tr class="control-group">
<td> <td>
<%= t('venue_management.disable') %> <%= t('venue_management.disable') %>
</td> </td>
@ -319,7 +376,7 @@
<%= check_box_tag("venue_management_main[venue_management_email_sets][#{index1}][disabled]", true ,@email_set[index1].disabled) %> <%= check_box_tag("venue_management_main[venue_management_email_sets][#{index1}][disabled]", true ,@email_set[index1].disabled) %>
</td> </td>
</tr> </tr>
<tr> <tr class="control-group">
<td> <td>
<%= t('venue_management.email_title') %> <%= t('venue_management.email_title') %>
</td> </td>
@ -327,7 +384,7 @@
<%= venue_method.show_set_field(@email_set[index1],'venue_management_email_sets',index1,'title','text_field') %> <%= venue_method.show_set_field(@email_set[index1],'venue_management_email_sets',index1,'title','text_field') %>
</td> </td>
</tr> </tr>
<tr> <tr class="control-group">
<td> <td>
<%= t('venue_management.email_content') %> <%= t('venue_management.email_content') %>
</td> </td>
@ -338,7 +395,7 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<% end %> <% end %>
@ -360,7 +417,7 @@
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Title--> <!-- Title-->
@ -373,7 +430,7 @@
</div> </div>
</div> </div>
<!-- Speaker --> <!-- Address -->
<div class="control-group input-title"> <div class="control-group input-title">
<label class="control-label muted"><%= t('venue_management.speaker') %></label> <label class="control-label muted"><%= t('venue_management.speaker') %></label>
<div class="controls"> <div class="controls">
@ -393,18 +450,19 @@
</div> </div>
</div> </div>
</div> </div>
<% areas = ['land_area','building_area','area'] %>
<div class="control-group input-content"> <% areas.each do |area| %>
<label class="control-label muted"><%= t('venue_management.area') %></label> <div class="control-group input-content">
<div class="controls"> <label class="control-label muted"><%= t("venue_management.#{area}") %></label>
<div class="textarea"> <div class="controls">
<%= f.fields_for :area_translations do |f| %> <div class="textarea">
<%= f.text_field locale, class: "input-block-level", :value => (@venue_management.area_translations[locale] rescue nil),placeholder: t('venue_management.area') %> <%= f.fields_for :area_translations do |f| %>
<% end %> <%= f.text_field locale, class: "input-block-level", :value => (@venue_management.send("#{area}_translations")[locale] rescue nil),placeholder: t("venue_management.#{area}") %>
<% end %>
</div>
</div> </div>
</div> </div>
</div> <% end %>
<div class="control-group input-content"> <div class="control-group input-content">
<label class="control-label muted"><%= t('venue_management.land_zoning') %></label> <label class="control-label muted"><%= t('venue_management.land_zoning') %></label>
<div class="controls"> <div class="controls">
@ -442,63 +500,8 @@
</div> </div>
<% end %> <% end %>
<%= render partial: 'admin/venue_shared/venue_file_link',locals: {venue: @venue_management,f: f} %>
<!-- Link -->
<div class="control-group">
<label class="control-label muted"><%= t(:link) %></label>
<div class="controls add-input">
<!-- Exist -->
<% if @venue_management && !@venue_management.venue_management_links.blank? %>
<div class="exist">
<% @venue_management.venue_management_links.each_with_index do |venue_management_link, i| %>
<%= f.fields_for :venue_management_links, venue_management_link do |f| %>
<%= render :partial => 'form_link', :object => venue_management_link, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_link_field_count', @venue_management.venue_management_links.count %>
<a id="add_link" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if @venue_management && !@venue_management.venue_management_files.blank? %>
<div class="exist">
<% @venue_management.venue_management_files.each_with_index do |venue_management_file, i| %>
<%= f.fields_for :venue_management_files, venue_management_file do |f| %>
<%= render :partial => 'form_file', :object => venue_management_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_file_field_count', @venue_management.venue_management_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
</div> </div>
</div> </div>
@ -508,49 +511,5 @@
<%= get_referer_url[:venue_managemention] rescue "" %> <%= get_referer_url[:venue_managemention] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<input type="hidden" name="referer_url" value="<%= get_referer_url %>"> <input type="hidden" name="referer_url" value="<%= get_referer_url %>">
<%= link_to t('cancel'), admin_venue_managements_path, :class=>"btn" %> <%= link_to t('cancel'), admin_venue_managements_path, :class=>"btn" %>
</div> </div>
<% content_for :page_specific_javascript do %>
<script>
$(function() {
$("#main-wrap").after("");
$(document).on('click', '#add_link', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_links", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_link', f, :venue_management_links) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.tab-content').children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
formTip();
});
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :venue_management_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
formTip();
});
$(document).on('click', '.delete_link', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
});
</script>
<% end %>

View File

@ -17,7 +17,9 @@
<tbody> <tbody>
<% @venue_managements.each do |venue_management| %> <% @venue_managements.each do |venue_management| %>
<tr> <tr>
<td><%= venue_management.category.title %></td> <td><%= venue_management.category.title %></td>
<td><%= venue_management.display_tags %></td>
<td> <td>
<a href="<%= page_for_venue_management(venue_management) %>?method=show_data" target="_blank"><%= venue_management.title %></a> <a href="<%= page_for_venue_management(venue_management) %>?method=show_data" target="_blank"><%= venue_management.title %></a>
<div class="quick-edit"> <div class="quick-edit">
@ -25,18 +27,31 @@
<% if can_edit_or_delete?(venue_management) %> <% if can_edit_or_delete?(venue_management) %>
<li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/edit"><%= t(:edit) %></a></li> <li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a href="<%= admin_venue_management_item_contents_path(:venue_management_main_id=>venue_management.id.to_s) %>"><%= t('venue_management.set_venue_management_item_content') %></a></li> <li><a href="<%= admin_venue_management_item_contents_path(:venue_management_main_id=>venue_management.id.to_s) %>"><%= t('venue_management.set_venue_management_item_content') %></a></li>
<!--
<li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/venue_management_signup_field"><%= t('venue_management.set_venue_management_signup_field') %></a></li> <li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/venue_management_signup_field"><%= t('venue_management.set_venue_management_signup_field') %></a></li>
<li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/venue_management_submission_field"><%= t('venue_management.set_venue_management_submission_field') %></a></li> <li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/venue_management_submission_field"><%= t('venue_management.set_venue_management_submission_field') %></a></li>
-->
<li><a href="#" class="delete text-error" rel="/admin/venue_managements/<%=venue_management.id.to_s%>"><%= t(:delete_) %></a></li> <li><a href="#" class="delete text-error" rel="/admin/venue_managements/<%=venue_management.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %> <% end %>
<li><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/print_pdf"><%= t("venue_management.print_pdf") %></a></li>
</ul> </ul>
</div> </div>
</td> </td>
<td><%= VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date) %></td> <td><%= venue_management.display_contractors %></td>
<td><%= VenueManagementMain.time_range(venue_management.signup_start_date, venue_management.signup_end_date) %></td> <td><%= venue_management.display_event_during %></td>
<td><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/venue_management_signup"><%= venue_management.venue_management_signups.count %></a></td> <td><%= venue_management.display_signup_during %></td>
<td><a href="#">0</a></td> <td>
<td><a href="#">0</a></td> <%= link_to venue_management.venue_management_invitings.count, venue_management_invitings_admin_venue_management_path(venue_management.id) %>
</td>
<td>
<%= link_to venue_management.venue_management_contracts.count, venue_management_contracts_admin_venue_management_path(venue_management.id) %>
</td>
<td>
<%= link_to venue_management.venue_management_memorabilias.count, venue_management_memorabilias_admin_venue_management_path(venue_management.id) %>
</td>
<td>
<%= link_to venue_management.venue_management_bills.count, venue_management_bills_admin_venue_management_path(venue_management.id) %>
</td>
<td><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/export?format=xlsx" target="_blank"><%= t('venue_management.export') %></a></td> <td><a href="/admin/venue_managements/<%=venue_management.id.to_s%>/export?format=xlsx" target="_blank"><%= t('venue_management.export') %></a></td>
</tr> </tr>
<% end %> <% end %>
@ -47,4 +62,4 @@
content_tag :div, class: "bottomnav clearfix" do content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@venue_managements), class: "pagination pagination-centered" content_tag :div, paginate(@venue_managements), class: "pagination pagination-centered"
end end
%> %>

View File

@ -2,65 +2,223 @@
wb = xlsx_package.workbook wb = xlsx_package.workbook
wb.add_worksheet(name: (@venue_management.title.to_s[0..27]+'...')) do |sheet| wb.add_worksheet(name: t('restful_actions.venue_management_contracts')) do |sheet|
row = []
row = [t('venue_management_signup.signup_time')] row << t('venue_management.title') if @id.blank?
row << t('vm_contract.case_no')
row << t('venue_management_signup.name') row << t('vm_inviting.type')
row << t('venue_management.contractor')
row << t('venue_management_signup.unit') row << t('vm_inviting.rents')
row << t('vm_inviting.royalty')
row << t('venue_management_signup.tel') row << t('vm_inviting.house_land_tax_payer')
row << t('vm_contract.renewal_permission')
row << t('venue_management_signup.phone') row << t('vm_contract.start_end')
row << t('vm_contract.construction_start_end')
row << t('venue_management_signup.fax') row << t('vm_contract.operation_start_end')
row << t('vm_contract.free_period_start_end')
row << t('venue_management_signup.address') row << t('vm_contract.sign_date')
row << t('vm_contract.handover_date')
row << t(:email) row << t('vm_contract.deposit_payment_date')
row << t('vm_contract.deposit_type')
row << t('venue_management_signup.note') row << t('vm_contract.deposit_exp_date')
row << t('vm_contract.insurance_type')
@venue_management.venue_management_signup_fields.asc(:_id).each do |rf| row << t('vm_contract.insurance_payment_deadline')
if rf.can_muti_lang_input? row << t('vm_contract.insurance_payment_date')
@site_in_use_locales.each do |l| @site_in_use_locales.each do |locale|
row << rf.title + " (#{t(l.to_s)})" row << t('vm_contract.other_commitment') + " - " + t(locale)
end
else
row << rf.title
end end
end @site_in_use_locales.each do |locale|
row << t('vm_contract.note') + " - " + t(locale)
sheet.add_row row end
row << t("link")
@venue_management.venue_management_signups.each do |signup| @site_in_use_locales.each do |locale|
row << t("link") + " " + t("url_alt") + " - " + t(locale)
row2 = [] end
row << t("file_")
row2 << "#{signup.created_at} " @site_in_use_locales.each do |locale|
row2 << "#{signup[:name]} " row << t("file_") + " " + t("description") + " - " + t(locale)
row2 << "#{signup.unit} " end
row2 << "#{signup[:tel]} " @site_in_use_locales.each do |locale|
row2 << "#{signup[:phone]} " row << t("file_") + " " + t("alternative") + " - " + t(locale)
row2 << "#{signup[:fax]} " end
row2 << "#{signup.address} " sheet.add_row row
row2 << "#{signup[:email]} " @venue_management.venue_management_contracts.each do |contract|
row2 << "#{signup.note} " row2 = []
row2 << contract.venue_management_main.title if @id.blank?
@venue_management.venue_management_signup_fields.asc(:_id).each do |rf| row2 << contract.case_no
if rf.can_muti_lang_input? row2 << contract.display_tags
@site_in_use_locales.each do |l| row2 << contract.display_contractors
row2 << nl2br(show_attribute_value(@venue_management.get_attribute_value(rf,signup.id).get_value_by_locale(l))) rescue ' ' row2 << "#{contract.early_rent} / #{contract.operation_rent}"
row2 << contract.royalty
row2 << t("vm_inviting.enums.#{contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{contract.land_tax_payer}")
row2 << contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false")
row2 << "#{contract.contract_start_date} ~ #{contract.contract_end_date}"
row2 << "#{contract.construction_start_date} ~ #{contract.construction_end_date}"
row2 << "#{contract.operation_start_date} ~ #{contract.operation_end_date}"
row2 << "#{contract.free_period_start_date} ~ #{contract.free_period_end_date}"
row2 << contract.sign_date
row2 << contract.handover_date
row2 << contract.deposit_payment_date
row2 << contract.deposit_type
row2 << contract.deposit_exp_date
row2 << contract.insurance_type
row2 << contract.insurance_payment_deadline
row2 << contract.insurance_payment_date
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(contract.other_commitment_translations[locale].to_s).css("body").text
end end
else @site_in_use_locales.each do |locale|
row2 << nl2br(show_attribute_value(@venue_management.get_attribute_value(rf,signup.id).get_value_by_locale(I18n.locale))) rescue ' ' row2 << Nokogiri::HTML(contract.note_translations[locale].to_s).css("body").text
end end
row2 << contract.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_links.map{|l| l.title_translations[locale].to_s.strip}.join(";")
end
row2 << contract.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_files.map{|f| f.description_translations[locale].to_s.strip}.join(";")
end
@site_in_use_locales.each do |locale|
row2 << contract.venue_management_files.map{|f| f.title_translations[locale].to_s.strip}.join(";")
end
sheet.add_row row2
end end
sheet.add_row row2
end
end end
wb.add_worksheet(name: t('restful_actions.venue_management_invitings')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('vm_inviting.type')
row << t('vm_inviting.case_no')
row << t('vm_inviting.publish_times')
row << t('vm_inviting.rents')
row << t('vm_inviting.royalty')
row << t('vm_inviting.house_land_tax_payer')
row << t('vm_inviting.contractor_manager')
row << t('vm_inviting.bid_result')
@site_in_use_locales.each do |locale|
row << t('vm_inviting.details') + "-" + t(locale)
end
row << t("link")
@site_in_use_locales.each do |locale|
row << t("link") + " " + t("url_alt") + " - " + t(locale)
end
row << t("file_")
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("description") + " - " + t(locale)
end
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("alternative") + " - " + t(locale)
end
sheet.add_row row
@venue_management.venue_management_invitings.each do |inviting|
row2 = []
row2 << inviting.venue_management_main.title if @id.blank?
row2 << inviting.tags.map{|t| t.name}.join(" , ")
row2 << inviting.case_no
row2 << inviting.publish_times
row2 << "#{inviting.early_rent} / #{inviting.operation_rent}"
row2 << inviting.royalty
row2 << t("vm_inviting.enums.#{inviting.house_tax_payer}")+"/"+t("vm_inviting.enums.#{inviting.land_tax_payer}")
row2 << inviting.contractor_manager
row2 << t("vm_inviting.enums.bid_result.#{inviting.bid_result}")
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(inviting.details_translations[locale].to_s).css("body").text
end
row2 << inviting.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_links.map{|l| l.title_translations[locale].to_s.strip}.join(";")
end
row2 << inviting.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_files.map{|f| f.description_translations[locale].to_s.strip}.join(";")
end
@site_in_use_locales.each do |locale|
row2 << inviting.venue_management_files.map{|f| f.title_translations[locale].to_s.strip}.join(";")
end
sheet.add_row row2
end
end
wb.add_worksheet(name: t('restful_actions.venue_management_memorabilias')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('vm_memorabilia.case_no')
row << t('vm_memorabilia.event_date')
@site_in_use_locales.each do |locale|
row << t('vm_memorabilia.details') + "-" + t(locale)
end
row << t("link")
@site_in_use_locales.each do |locale|
row << t("link") + " " + t("url_alt") + " - " + t(locale)
end
row << t("file_")
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("description") + " - " + t(locale)
end
@site_in_use_locales.each do |locale|
row << t("file_") + " " + t("alternative") + " - " + t(locale)
end
sheet.add_row row
@venue_management.venue_management_memorabilias.each do |memorabilia|
row2 = []
row2 << memorabilia.venue_management_main.title if @id.blank?
row2 << memorabilia.case_no
row2 << memorabilia.event_date
@site_in_use_locales.each do |locale|
row2 << Nokogiri::HTML(memorabilia.details_translations[locale].to_s).css("body").text
end
row2 << memorabilia.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
@site_in_use_locales.each do |locale|
row2 << memorabilia.venue_management_links.map{|l| l.title_translations[locale].to_s.strip}.join(";")
end
row2 << memorabilia.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
@site_in_use_locales.each do |locale|
row2 << memorabilia.venue_management_files.map{|f| f.description_translations[locale].to_s.strip}.join(";")
end
@site_in_use_locales.each do |locale|
row2 << memorabilia.venue_management_files.map{|f| f.title_translations[locale].to_s.strip}.join(";")
end
sheet.add_row row2
end
end
wb.add_worksheet(name: t('restful_actions.venue_management_bills')) do |sheet|
row = []
row << t('venue_management.title') if @id.blank?
row << t('venue_management.contractor')
row << t('vm_bill.accounting_month')
row << t('vm_bill.bill_type')
row << t('vm_bill.caculation_basis')
row << t('vm_bill.total_amount')
row << t('vm_bill.pay_date')
row << t('vm_bill.reason')
row << t('vm_bill.pay_method')
row << t('vm_bill.note')
row << t("link")
row << t("link") + " " + t("url_alt")
row << t("file_")
row << t("file_") + " " + t("description")
row << t("file_") + " " + t("alternative")
sheet.add_row row
@venue_management.venue_management_bills.each do |bill|
row2 = []
row2 << bill.venue_management_main.title if @id.blank?
row2 << (bill.contractor.display_contractors rescue "")
row2 << bill.display_accounting_month
row2 << "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}"
row2 << bill.display_caculation_basis
row2 << bill.total_amount
row2 << bill.pay_date
row2 << bill.reason
row2 << bill.pay_method
row2 << bill.note
row2 << bill.venue_management_links.map{|l| l.url.to_s.strip}.join(";")
row2 << bill.venue_management_links.map{|l| l.title.to_s.strip}.join(";")
row2 << bill.venue_management_files.map{|f| @host + f.file.url rescue nil}.select{|s| !s.nil?}.join(";")
row2 << bill.venue_management_files.map{|f| f.description.to_s.strip}.join(";")
row2 << bill.venue_management_files.map{|f| f.title.to_s.strip}.join(";")
sheet.add_row row2
end
end

View File

@ -0,0 +1,386 @@
<% # encoding: utf-8 %>
<% if params[:type] == "print" %>
<!DOCTYPE html>
<html>
<head>
<title><%= @venue_management.title %></title>
<link rel="stylesheet" type="text/css" media="all" href="//stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<%= stylesheet_link_tag "bootstrap/bootstrap.min.css" ,:media => "all" %>
</head>
<body>
<style type="text/css">
.no-print, .no-print *
{
display: none;
}
@media print {
a[href]:after {
content: none !important;
}
}
</style>
<style type="text/css" media="print">
@page
{
size: auto;
margin: 0mm;
}
</style>
<% end %>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script>
<%= javascript_include_tag "jspdf.min" %>
<style>
#print_btn {
outline: 0;
border-radius: 1.3em;
background: #d9e4f7;
font-weight: bold;
outline: 0;
}
#print_btn:hover {
background: #be8a8a;
}
.print_text{
padding: 2em;
width: 650px;
margin: auto;
}
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
<% @save_name = @venue_management.title %>
<div class="no-print" style="text-align: center;">
<a class="btn no-print" href="?type=print" id="print_btn"><%= I18n.t('venue_management.print_pdf') %></a>
</div>
<div class="print_text">
<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? %>
<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.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_contract.venue_management_inviting.case_no %></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.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 />
<% if params[:type] != "print" %>
<ul class="venue_management-plugins nav nav-pills" role="tablist" data-list="plugins" data-level="0">
<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="#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=""><a href="#memorabilia" role="tab" data-toggle="tab" title="<%=t('venue_management.memorabilia')%>" aria-expanded="false"><%=t('venue_management.memorabilia')%></a></li>
</ul>
<% end %>
<div class="tab-content" data-list="plugins" data-level="0">
<% if params[:type] == "print" %>
<h3><%=t('venue_management.contract_history')%></h3>
<% end %>
<div class="<%= (params[:type] == "print") ? "" : "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.case_no, "/#{I18n.locale}"+@venue_management_page_url+"/#{contract.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>
<% if params[:type] == "print" %>
<h3><%=t('venue_management.inviting_history')%></h3>
<% end %>
<div class="<%= (params[:type] == "print") ? "" : "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}"+@venue_management_page_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>
<% if params[:type] == "print" %>
<h3><%=t('venue_management.memorabilia')%></h3>
<% end %>
<div class="<%= (params[:type] == "print") ? "" : "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.case_no, "/#{I18n.locale}"+@venue_management_page_url+"/#{inviting.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.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>
</div>
<% if params[:type] == "print" %>
<script type="text/javascript">
document.onreadystatechange = window.print();
</script>
</body>
</html>
<% end %>

View File

@ -0,0 +1,12 @@
<form>
<%= render_filter @filter_fields, "index_table" %>
</form>
<span id="index_table">
<%= render 'admin/venue_management_bills/index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,10 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'admin/venue_management_contracts/index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,10 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'admin/venue_management_invitings/index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,10 @@
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'admin/venue_management_memorabilias/index' %>
</span>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
var $form = $("<form><form>");
$(".filter-group.accordion-group").before($form).appendTo($form);
</script>

View File

@ -0,0 +1,55 @@
<% if form_file.nil? || form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<% else %>
<div class="fileupload fileupload-exists start-line" data-provides="fileupload">
<% if form_file.file.blank? %>
<%= t(:no_file) %>
<% else %>
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<% end %>
<% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.nil? || form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
<span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :description_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
</span>
<% if form_file.nil? || form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -0,0 +1,26 @@
<div class="input-prepend input-append start-line">
<span class="add-on icons-link" title="<%= t(:url) %>"></span>
<%= f.text_field :url, class: "input-large", placeholder: t(:url) %>
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
<% if form_link.nil? || form_link.new_record? %>
<span class="delete_link add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>

View File

@ -0,0 +1,110 @@
<div class="start-line">
<div style="float: left;">
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>" style="float: left;"></span>
<span class="tab-content" style="float: left;">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :description_translations do |f| %>
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_reminder.description_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
</div>
<%= f.datetime_picker :reminder_date, :no_label => true, :format=>"yyyy/MM/dd", :new_record => (form_reminder.nil? || form_reminder.new_record?) %>
<% if form_reminder.nil? || form_reminder.new_record? %>
<span class="delete_link add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
<script type="text/javascript">
if ($('.default_picker,.time_picker,.date_picker,.datetimepick').find('input').length!=0){
$('.default_picker,.time_picker,.date_picker,.datetimepick').find('.iconbtn').css('display','none')
$('.default_picker,.date_picker,.datetimepick').each(function(i,v){
v = $(v).find('input')[0]
$(v).attr('autocomplete','off')
var org_format = $(v).data('format') || $(v).attr('placeholder')
var format = org_format.toLowerCase().replace(/yyyy/,'yy')
var H_flag = false
if (org_format.search(/tt|H/)!= null ){
H_flag = true
}
var M_flag = false
if (org_format.match(/[hH].*M/)!=null){
M_flag = true
}
if (format.search(/h/)!= -1){
var result = format.match(/\W+[?=h]/)
if (result == null){
result = format.match(/h/)
}
var indice = result.index
var dateformat = format.slice(0,8)
var time_format_start = format.search(/h/)
var time_format = format.slice(time_format_start)
if (H_flag){
time_format = time_format.replace(/h/g,'H')
}
if (M_flag){
time_format = time_format.replace(/m/g,'M')
}
$(v).ui_datetimepicker({
dateFormat: dateformat,
controlType: 'select',
timeInput: true,
oneLine: true,
timeFormat: time_format
})
}else{
var show_view = ''
if (format.split(/\W/).slice(-1)[0].slice(-1)[0]=='m'){
show_view = 'month'
}
if (format.split(/\W/).slice(-1)[0].slice(-1)[0]=='y'){
show_view = 'year'
}
$(v).ui_datepicker({dateFormat: format,show_view: show_view})
}
})
$('.default_picker,.time_picker,.date_picker').find('.clearDate').click(function(){
$(this).parents('.default_picker,.time_picker,.date_picker').eq(-1).find('input').val('')
$(this).parents('.default_picker,.time_picker,.date_picker').eq(-1).find('input').trigger('change')
})
$('.time_picker input').each(function(i,v){
$(v).ui_timepicker({timeFormat: $(v).data('format'),
controlType: 'select',
timeInput: true,
oneLine: true})
})
$('.separated_picker').find('.date_picker,.time_picker').find('input').change(function(){
var parent_div = $(this).parents('.separated_picker').eq(-1)
var date_picker_value = parent_div.find('.date_picker>input').val()
var time_picker_value = parent_div.find('.time_picker>input').val()
if (date_picker_value == '' || time_picker_value == ''){
parent_div.children('input[type=hidden]').val('')
}
else{
parent_div.children('input[type=hidden]').val(date_picker_value+' '+time_picker_value)
}
})
}
$('.simple-date-picker').find('input[type="text"],select').change(function(){
var parent_div = $(this).parents('.simple-date-picker').eq(-1)
var year = parent_div.find('.span3').val()
var month = parent_div.find('.span2').val()
var day = parent_div.find('.span1').val()
if (year != '' && month != '' && day != ''){
parent_div.find('input[type="hidden"]').eq(-1).val(year+'-'+month+'-'+day)
}
})
$(document).on('click', '.delete_link', function(){
$(this).parents('.start-line').remove();
});
</script>

View File

@ -0,0 +1,94 @@
<!-- Link -->
<div class="control-group">
<label class="control-label muted"><%= t(:link) %></label>
<div class="controls add-input">
<!-- Exist -->
<% if !venue.nil? && !venue.venue_management_links.blank? %>
<div class="exist">
<% venue.venue_management_links.each_with_index do |venue_management_link, i| %>
<%= f.fields_for :venue_management_links, venue_management_link do |f| %>
<%= render :partial => 'admin/venue_shared/form_link', :locals => {:f => f, :i => i,form_link: venue_management_link} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_link_field_count', venue.venue_management_links.count %>
<a id="add_link" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if !venue.nil? && !venue.venue_management_files.blank? %>
<div class="exist">
<% venue.venue_management_files.each_with_index do |venue_management_file, i| %>
<%= f.fields_for :venue_management_files, venue_management_file do |f| %>
<%= render :partial => 'admin/venue_shared/form_file', :locals => {:f => f, :i => i,form_file: venue_management_file} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_file_field_count', venue.venue_management_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$(document).on('click', '#add_link', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_links", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'admin/venue_shared/form_link', f, :venue_management_links) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.tab-content').children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
formTip();
});
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'admin/venue_shared/form_file', f, :venue_management_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
formTip();
});
$(document).on('click', '.delete_link', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
});
</script>

View File

@ -0,0 +1,131 @@
<!-- Link -->
<div class="control-group">
<label class="control-label muted"><%= t(:link) %></label>
<div class="controls add-input">
<!-- Exist -->
<% if !venue.nil? && !venue.venue_management_links.blank? %>
<div class="exist">
<% venue.venue_management_links.each_with_index do |venue_management_link, i| %>
<%= f.fields_for :venue_management_links, venue_management_link do |f| %>
<%= render :partial => 'admin/venue_shared/form_link', :locals => {:f => f, :i => i,form_link: venue_management_link} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_link_field_count', venue.venue_management_links.count %>
<a id="add_link" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if !venue.nil? && !venue.venue_management_files.blank? %>
<div class="exist">
<% venue.venue_management_files.each_with_index do |venue_management_file, i| %>
<%= f.fields_for :venue_management_files, venue_management_file do |f| %>
<%= render :partial => 'admin/venue_shared/form_file', :locals => {:f => f, :i => i,form_file: venue_management_file} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_file_field_count', venue.venue_management_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
<!-- Reminder -->
<div class="control-group">
<label class="control-label muted"><%= t("venue_management.reminder") %></label>
<div class="controls">
<!-- Exist -->
<% if !venue.nil? && !venue.venue_management_reminders.blank? %>
<div class="exist">
<% venue.venue_management_reminders.each_with_index do |venue_management_reminder, i| %>
<%= f.fields_for :venue_management_reminders, venue_management_reminder do |f| %>
<%= render :partial => 'admin/venue_shared/form_reminder', :locals => {:f => f, :i => i,form_reminder: venue_management_reminder} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'venue_management_reminder_field_count', venue.venue_management_reminders.count %>
<a id="add_reminder" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$(document).on('click', '#add_reminder', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_reminders", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'admin/venue_shared/form_reminder', f, :venue_management_reminders) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.tab-content').children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
formTip();
});
$(document).on('click', '#add_link', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_links", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'admin/venue_shared/form_link', f, :venue_management_links) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.tab-content').children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
formTip();
});
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_venue_management_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'admin/venue_shared/form_file', f, :venue_management_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
formTip();
});
$(document).on('click', '.delete_link', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
});
</script>

View File

@ -0,0 +1,3 @@
<%= @data['title'] %>
<br>
<%= @data['send_time'].strftime("%Y/%m/%d") %>

View File

@ -13,10 +13,11 @@
<thead> <thead>
<tr> <tr>
<th class="col-md-2"><%= t(:category) %></th> <th class="col-md-2"><%= t(:category) %></th>
<th class="col-md-2"><%= t('vm_inviting.type') %></th>
<th class="col-md-3"><%= t('venue_management.title') %></th> <th class="col-md-3"><%= t('venue_management.title') %></th>
<th class="col-md-2"><%= t('venue_management_signup.time') %></th> <th class="col-md-3"><%= t('venue_management.contractor') %></th>
<th class="col-md-2"><%= t('venue_management_signup.place') %></th> <th class="col-md-3"><%= t('venue_management.event_during') %></th>
<th class="col-md-2"><%= t('venue_management.signup') %></th> <th class="col-md-3"><%= t('venue_management.signup_during') %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -34,28 +35,16 @@
end end
%> %>
<tr> <tr>
<td><%= venue_management.category.title %></td>
<td><%= ('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=show_data" target="_blank">' + venue_management.title + '</a>').html_safe %></td> <td><%= venue_management.category.title %></td>
<td><%= VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date) %></td> <td><%= venue_management.display_tags %></td>
<td><%= venue_management.act_place %></td> <td>
<td> <a href="<%= page_for_venue_management(venue_management) %>?method=show_data" target="_blank"><%= venue_management.title %></a>
<%= sign_up %> <br /> </td>
<td><%= venue_management.display_contractors %></td>
<%= <td><%= venue_management.display_event_during %></td>
if !venue_management.registration_status.blank? and venue_management.registration_status.include?('C') and venue_management.contribute_start_date <= @time_now and ( venue_management.contribute_end_date.nil? or venue_management.contribute_end_date+1 >= @time_now ) <td><%= venue_management.display_signup_during %></td>
if !session[:venue_management_signup_id].blank? </tr>
if session[:venue_management_main_id] == venue_management.id
('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_upload">' + t('venue_management_signup.uploads') + '</a>').html_safe
else
('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_login">' + t('venue_management_signup.con_login') + '</a>').html_safe
end
else
('<a href="'+ OrbitHelper.url_to_show(venue_management.to_param) + '?method=con_login">' + t('venue_management_signup.con_login') + '</a>').html_safe
end
end
%>
</td>
</tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@ -0,0 +1,83 @@
<% # encoding: utf-8 %>
<% @@session = session %>
<%= yield %>
<%
data = action_data
@venue_management_bill = data["venue_management_bill"]
@params = data['params']
%>
<table class="table table-striped venue_managementive-show-table">
<tbody>
<tr>
<th class="venue_managementive-title-field"><%= t('venue_management.title') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.venue_management_main.title %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.contractor') %></th>
<td class="venue_managementive-title-value">
<% contractors = @venue_management_bill.contractor.display_contractors rescue "" %>
<% contractors = t(:empty) if contractors.blank? %>
<%= contractors %>
</td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.accounting_month') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.display_accounting_month %></td>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.bill_type') %></th>
<td class="venue_managementive-title-value"><%= "#{t("vm_bill.#{@venue_management_bill.bill_typeA}")}/#{t("vm_bill.#{@venue_management_bill.bill_typeB}")}" %>
<% if @venue_management_bill.bill_typeB == 'other' && @venue_management_bill.bill_other.present? %>
-<%=@venue_management_bill.bill_other%>
<% end %>
</td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.caculation_basis') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.display_caculation_basis %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.reason') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.reason %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.total_amount') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.total_amount %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.pay_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.pay_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.pay_method') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.pay_method %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_bill.note') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_bill.note.to_s.html_safe %></td>
</tr>
<% if !@venue_management_bill.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_bill.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_bill.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_bill.venue_management_links.map do |link| %>
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br />
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>

View File

@ -0,0 +1,153 @@
<% # encoding: utf-8 %>
<% @@session = session %>
<%= yield %>
<%
data = action_data
@venue_management_contract = data["venue_management_contract"]
@params = data['params']
%>
<table class="table table-striped venue_managementive-show-table">
<tbody>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.case_no') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_case_no %></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-money fa-fw"></i><%= t('vm_contract.deposit_amount') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.deposit_amount %></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>
<% if @venue_management_contract.insurance_type2.present? %>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.insurance_type2') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_type2 %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_deadline2') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_deadline2 %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_date2') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_date2 %></td>
</tr>
<% end %>
<% if @venue_management_contract.insurance_type3.present? %>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.insurance_type3') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_type3 %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_deadline3') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_deadline3 %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('vm_contract.insurance_payment_date3') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.insurance_payment_date3 %></td>
</tr>
<% end %>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.other_commitment') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.other_commitment.to_s.html_safe %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.note') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.note.to_s.html_safe %></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 %>
</tbody>
</table>
<br />
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>

View File

@ -9,6 +9,7 @@
@venue_management_time_range = data["venue_management_time_range"] @venue_management_time_range = data["venue_management_time_range"]
@contribute_time_range = data["contribute_time_range"] @contribute_time_range = data["contribute_time_range"]
@contribute_action = data["contribute_action"] @contribute_action = data["contribute_action"]
@params = data['params']
%> %>
@ -26,12 +27,34 @@
<th class="venue_managementive-title-field"><%= t('venue_management.title') %></th> <th class="venue_managementive-title-field"><%= t('venue_management.title') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.title %></td> <td class="venue_managementive-title-value"><%= @venue_management.title %></td>
</tr> </tr>
<% if !@venue_management.speaker.blank? %> <% if !@venue_management.speaker.blank? #address %>
<tr> <tr>
<th class="venue_managementive-title-field"><%= t('venue_management.speaker') %></th> <th class="venue_managementive-title-field"><%= t('venue_management.speaker') %></th>
<td class="venue_managementive-title-value"><%= @venue_management.speaker %></td> <td class="venue_managementive-title-value"><%= @venue_management.speaker %></td>
</tr> </tr>
<% end %> <% 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? %> <% if !@venue_management.content.blank? %>
<tr> <tr>
<th class="venue_managementive-title-field"><%= t('venue_management.content') %></th> <th class="venue_managementive-title-field"><%= t('venue_management.content') %></th>
@ -84,9 +107,297 @@
<td class="venue_managementive-title-value"><%= item_content.content.html_safe %></td> <td class="venue_managementive-title-value"><%= item_content.content.html_safe %></td>
</tr> </tr>
<% end %> <% 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.to_s.html_safe %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_contract.note') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_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> </tbody>
</table> </table>
<br /> <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.other_commitment',
'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.display_other_commitment %></td>
<td><%= contract.display_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.display_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',
'vm_inviting.details'
]
@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>
<td><%= inviting.display_details %></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' %> <%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>

View File

@ -0,0 +1,88 @@
<% # encoding: utf-8 %>
<% @@session = session %>
<%= yield %>
<%
data = action_data
@venue_management_inviting = data["venue_management_inviting"]
@params = data['params']
%>
<table class="table table-striped venue_managementive-show-table">
<tbody>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.tags.map{|t| t.name}.join(" , ") %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.case_no') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_case_no %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.publish_times') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.publish_times %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.start_end') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.start_date.to_s + "/" + @venue_management_inviting.end_date.to_s %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.close_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_close_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.bid_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_bid_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.evaluation_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_evaluation_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.rents') %></th>
<td class="venue_managementive-title-value"><%= "#{@venue_management_inviting.early_rent} / #{@venue_management_inviting.operation_rent}" %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.royalty') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_royalty %></td>
</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_inviting.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_inviting.land_tax_payer}") %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.contractor_manager') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.contractor_manager %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.bid_result') %></th>
<td class="venue_managementive-title-value"><%= t("vm_inviting.enums.bid_result.#{@venue_management_inviting.bid_result}") %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_inviting.details') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_inviting.details.to_s.html_safe %></td>
</tr>
<% if !@venue_management_inviting.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_inviting.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_inviting.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_inviting.venue_management_links.map do |link| %>
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br />
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>

View File

@ -0,0 +1,47 @@
<% # encoding: utf-8 %>
<% @@session = session %>
<%= yield %>
<%
data = action_data
@venue_management_memorabilia = data["venue_management_memorabilia"]
@params = data['params']
%>
<table class="table table-striped venue_managementive-show-table">
<tbody>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_memorabilia.case_no') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_memorabilia.case_no %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_memorabilia.event_date') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_memorabilia.event_date %></td>
</tr>
<tr>
<th class="venue_managementive-title-field"><%= t('vm_memorabilia.details') %></th>
<td class="venue_managementive-title-value"><%= @venue_management_memorabilia.details.to_s.html_safe %></td>
</tr>
<% if !@venue_management_memorabilia.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_memorabilia.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_memorabilia.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_memorabilia.venue_management_links.map do |link| %>
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br />
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>

View File

@ -1,14 +1,19 @@
en: en:
copy: Copy
simple_captcha: simple_captcha:
placeholder: "" placeholder: ""
label: "" label: ""
empty: none
restful_actions: restful_actions:
print_pdf: Print
act_signup: Sign Up Info #報名資料 act_signup: Sign Up Info #報名資料
venue_management_submission_field: VenueManagement Submission Field venue_management_submission_field: VenueManagement Submission Field
venue_management_signup_field: VenueManagement Signup Field venue_management_signup_field: VenueManagement Signup Field
venue_management_signup: Signup Analyze venue_management_signup: Signup Analyze
venue_management_memorabilias: Memorabilia
venue_management_bills: Bills
venue_management_invitings: Inviting History
venue_management_contracts: Contract History
module_name: module_name:
venue_management: Outsourced Venue Management #場地管理系統 venue_management: Outsourced Venue Management #場地管理系統
@ -17,10 +22,20 @@ en:
verification_failed: Verification Failed #驗證碼錯誤 verification_failed: Verification Failed #驗證碼錯誤
venue_management: venue_management:
search: Search
reminder: Reminder
print_pdf: Print
send_email_reminder: Send email reminder
before: Before
day_send_email: day send email
add_to_calendar: Add to calendar
manager: Manager manager: Manager
contractor: Contractor contractor: Contractor
land_number: Land number land_number: Land number
area: Area area: Other Area
land_area: Land Area
building_area: Building Area
other_area: Other Area
land_zoning: Land zoning land_zoning: Land zoning
coordinator: Coordinator coordinator: Coordinator
email_signup_success: Contract end date reminder email_signup_success: Contract end date reminder
@ -78,15 +93,21 @@ en:
event_during: Current contract period #活動期間 event_during: Current contract period #活動期間
contribute_during: Contribute During #投稿期間 contribute_during: Contribute During #投稿期間
signup_during: Inviting contractor period #報名期間 signup_during: Inviting contractor period #報名期間
signup_count: Contract history #報名人數 signup_count: Inviting contractor count
inviting_hostory: Inviting history contract_history: Contract history
inviting_history: Inviting history
memorabilia: Memorabilia memorabilia: Memorabilia
bills: Bills
signup: Inviting Contractor signup: Inviting Contractor
export: Export #匯出 export: Export #匯出
set_venue_management_items: Items #項目 set_venue_management_items: Items #項目
set_venue_management_submission_field: Set Submission Field set_venue_management_submission_field: Set Submission Field
set_venue_management_signup_field: Set Sign Up Field #圈選設定 set_venue_management_signup_field: Set Sign Up Field #圈選設定
set_venue_management_item_content: Set Item Content #項目設定 set_venue_management_item_content: Set Item Content #項目設定
set_venue_management_contracts: Contract History
set_venue_management_invitings: Inviting History
set_venue_management_memorabilias: Memorabilia
set_venue_management_bills: Bills
set_venue_management_agreements: Personal Data Usage Agreements #個資宣告設定 set_venue_management_agreements: Personal Data Usage Agreements #個資宣告設定
venue_management_agreements_content: Content of Personal Data Usage Agreements #個資宣告內容 venue_management_agreements_content: Content of Personal Data Usage Agreements #個資宣告內容
to_require: Should Be Filled? #是否必填 to_require: Should Be Filled? #是否必填
@ -137,3 +158,141 @@ en:
logout: Log Out #登出 logout: Log Out #登出
logouting: Logging Out #登出中 logouting: Logging Out #登出中
success_message: 'Registration successful, thank you.' success_message: 'Registration successful, thank you.'
vm_inviting:
type: Type
case_no: 'Case No.'
publish_times: Publish Times
start_date: Start Date
end_date: End Date
close_date: Close Date
bid_date: Bid Date
evaluation_date: Evaluation Date
rents: 'Early / Operation Rent'
early_rent: Early
operation_rent: Operation Rent
royalty: Royalty
house_tax_payer: House Tax Payer
land_tax_payer: Land Tax Payer
house_land_tax_payer: House Tax/Land Tax Payer
start_end: Start/End Date
contractor_manager: Contractor Manager
bid_result: Bid Result
details: Details
enums:
school: School
vendor: Vendor
bid_result:
empty: ''
failure: Failure
abandoned: Abandoned
qualified: Qualified
vm_memorabilia:
case_no: 'Case No.'
event_date: Event Date
details: Details
vm_bill:
delay_in_days_level_1: Delay in days level 1
delay_in_days_level_2: Delay in days level 2
delay_in_days_level_3: Delay in days level 3
bills_payable: bills_payable
delay_in_days: Delay in days
day: Day
_interest: ', Interest'
interest: Interest
annual_interest: Annual interest
double_dividend: Double Dividend
daily_interest: Daily interest
add_and_subtract_hint: Please add a minus sign before the number if it's minus!
add_and_subtract: Add and subtract
contractor: Contractor
accounting_month: Accounting month
bill_type: Bill type
caculation_basis: Caculation basis
reason: Reason
amount: Amount
deadline: Deadline
received_date: Received date
pay_date: Deadline / Received date
pay_method: Method
note: Note
venue_fee: Venue fee
usage_fee: Usage fee
royalties: Royalties
admin_fee: Admin fee
land_rent: Land rent
utility_bill: Utility bill
electricity: Electricity
water: Water
tax: Tax
house_tax: House tax
land_tax: Land tax
other: Other
bill_other: Other item
penalty: Penalty
revenue: Revenue
degree: Degree
actual_bill: Actual bill
fixed: Fixed
bill_amount: Bill amount
level_0: Level 0
level_1: Level 1
level_2: Level 2
level_3: Level 3
level_4: Level 4
level_5: Level 5
current_degree: Current degree
consumption: Consumption
tax_excluded: Tax excluded
total_amount: Total amount
actual_amount: Actual amount
tax: Tax
taxable_tax: Tax
dollar/degree: $/degree
taxable_present_value: Taxable present value
announced_land_values: Announced land values
land_values: Land values
present_value: Present value
taxable_area: Taxable area
percent:
prejudgment_interest: Prejudgment interest
vm_contract:
renewal_permission: Renewal permission
renewal_deadline: Renewal deadline
case_no: 'Case No.'
vendor: Vendor
start_end: Contract Duration
contract_start_date: Contract Start
contract_end_date: Contract End
construction_start_date: Construction Start
construction_end_date: Construction End
construction_start_end: Construction Duration
operation_start_date: Operation Start
operation_end_date: Operation End
operation_start_end: Operation Duration
free_period_start_date: Free Period Start
free_period_end_date: Free Period End
free_period_start_end: Free Period Duration
renewal_permission: Renewal Permission
renewal:
'true': 'Yes'
'false': 'No'
sign_date: Sign Date
handover_date: Handover Date
deposit_amount_type_exp_date: 'Deposit amount/Type/EXP Date'
deposit_amount: Deposit amount
deposit_payment_date: Deposit Payment Date
deposit_type: Deposit Type
deposit_exp_date: Deposit EXP Date
insurance_type: Insurance 1
insurance_payment_deadline: Insurance 1 Expiry Date
insurance_payment_date: Insurance 1 Payment Date
insurance_type2: Insurance 2
insurance_payment_deadline2: Insurance 2 Expiry Date
insurance_payment_date2: Insurance 2 Payment Date
insurance_type3: Insurance 3
insurance_payment_deadline3: Insurance 3 Expiry Date
insurance_payment_date3: Insurance 3 Payment Date
other_commitment: Other Commitments
note: Note

View File

@ -1,14 +1,19 @@
zh_tw: zh_tw:
copy: 複製
simple_captcha: simple_captcha:
placeholder: "" placeholder: ""
label: "" label: ""
empty:
restful_actions: restful_actions:
print_pdf: 列印
act_signup: 報名資料 act_signup: 報名資料
venue_management_submission_field: 上傳介面欄位 venue_management_submission_field: 上傳介面欄位
venue_management_signup_field: 報名欄位 venue_management_signup_field: 報名欄位
venue_management_signup: 報名統計 venue_management_signup: 報名統計
venue_management_memorabilias: 大事記
venue_management_bills: 費用管理
venue_management_invitings: 招商公告
venue_management_contracts: 履約記錄
module_name: module_name:
venue_management: 場地管理系統 venue_management: 場地管理系統
@ -17,10 +22,20 @@ zh_tw:
verification_failed: 驗證碼錯誤 verification_failed: 驗證碼錯誤
venue_management: venue_management:
search: 查詢
reminder: 提醒
print_pdf: 列印
send_email_reminder: 寄送Email提醒
before: 提前
day_send_email: 天寄送
add_to_calendar: 加入行事曆
manager: 管理人 manager: 管理人
contractor: 廠商 contractor: 廠商
land_number: 地號 land_number: 地號
area: 面積 area: 其他面積
land_area: 土地面積
building_area: 建物/營業面積
other_area: 其他面積
land_zoning: 土地使用分區 land_zoning: 土地使用分區
coordinator: 承辦人 coordinator: 承辦人
email_signup_success: 履約期限 email_signup_success: 履約期限
@ -54,7 +69,7 @@ zh_tw:
signup_set: 報名欄位設定 signup_set: 報名欄位設定
reviewer: 審查委員 reviewer: 審查委員
review_end_date: 審查結束日期 review_end_date: 審查結束日期
review_start_date: 審查開始日期 review_start_date: 審查開始日期
review: 審稿 review: 審稿
blank_no_limit: 空白無限制 blank_no_limit: 空白無限制
export_csv: 匯出CSV export_csv: 匯出CSV
@ -75,19 +90,25 @@ zh_tw:
signup_end_date: 招商結束日期 signup_end_date: 招商結束日期
contribute_start_date: 投稿開始時間 contribute_start_date: 投稿開始時間
contribute_end_date: 投稿結束時間 contribute_end_date: 投稿結束時間
event_during: 合約期間 event_during: 合約期間
contribute_during: 投稿期間 contribute_during: 投稿期間
signup_during: 招商期間 signup_during: 招商期間
signup_count: 履約紀錄 signup_count: 招商次數
inviting_hostory: 招商公告 contract_history: 履約紀錄
inviting_history: 招商公告
memorabilia: 大事記 memorabilia: 大事記
bills: 費用管理
signup: 招商 signup: 招商
export: 匯出 export: 匯出
set_venue_management_items: 項目 set_venue_management_items: 項目
set_venue_management_submission_field: 上傳介面欄位設定 set_venue_management_submission_field: 上傳介面欄位設定
set_venue_management_signup_field: 圈選設定 set_venue_management_signup_field: 圈選設定
set_venue_management_item_content: 項目設定 set_venue_management_item_content: 項目設定
set_venue_management_agreements: 個資宣告設定 set_venue_management_contracts: 履約紀錄
set_venue_management_invitings: 招商公告
set_venue_management_memorabilias: 大事記
set_venue_management_bills: 費用管理
set_venue_management_agreements: 個資宣告設定
venue_management_agreements_content: 個資宣告內容 venue_management_agreements_content: 個資宣告內容
to_require: 是否必填 to_require: 是否必填
sign_up_not_yet: 報名時間未開始 sign_up_not_yet: 報名時間未開始
@ -119,7 +140,7 @@ zh_tw:
phone: 行動電話 phone: 行動電話
fax: 傳真 fax: 傳真
address: 地址 address: 地址
email: e-mail信箱 email: e-mail信箱
password: 密碼 password: 密碼
password_message: '( 此密碼為下次投稿上傳檔案時必須輸入的密碼。 )' password_message: '( 此密碼為下次投稿上傳檔案時必須輸入的密碼。 )'
note: 註解 note: 註解
@ -137,3 +158,141 @@ zh_tw:
logout: 登出 logout: 登出
logouting: 登出中 logouting: 登出中
success_message: '您的報名已成功,感謝您的參與。' success_message: '您的報名已成功,感謝您的參與。'
vm_inviting:
type: 招商形式
case_no: 案號
publish_times: 公告次數
start_date: 公告開始
end_date: 公告結束
close_date: 截止收件
bid_date: 開標日期
evaluation_date: 評選時間
rents: '興建期/營運期租金'
early_rent: 興建期租金
operation_rent: 營運期租金
royalty: 權利金
house_tax_payer: 房屋稅負擔方
land_tax_payer: 地價稅負擔方
house_land_tax_payer: 房屋稅/地價稅負擔方
start_end: 公告開始/結束日期
contractor_manager: 招商承辦人
bid_result: 開標結果
details: 其他說明
enums:
school: 學校
vendor: 廠商
bid_result:
empty: ''
failure: 流標
abandoned: 廢標
qualified: 決標
vm_memorabilia:
case_no: 相關案號
event_date: 事件日期
details: 事件內容
vm_bill:
delay_in_days_level_1: 延遲天數級距一
delay_in_days_level_2: 延遲天數級距二
delay_in_days_level_3: 延遲天數級距三
bills_payable: 應繳費用
delay_in_days: 延遲天數
day:
annual_interest: 年息
double_dividend: 雙日息
daily_interest: 日息
_interest: ',利息'
interest: 利息
add_and_subtract_hint: 若為扣除金額請於數字前方填寫減號 ( - )
add_and_subtract: 加減金額
contractor: 廠商
accounting_month: 列帳年月
bill_type: 費用別
caculation_basis: 計算基礎
reason: 說明
amount: 金額
deadline: 繳交期限
received_date: 繳交日期
pay_date: 繳交期限 / 繳交日期
pay_method: 繳交方式
note: 備註
venue_fee: 場地收入
usage_fee: 使用費
royalties: 權利金
admin_fee: 管理費(清潔費)
land_rent: 土地租金
utility_bill: 水電費
electricity: 電費
water: 水費
tax:
house_tax: 房屋稅
land_tax: 地價稅
other: 其他
bill_other: 其他項目
penalty: 罰款
revenue: 營業額
degree: 度數
actual_bill: 實際帳單
fixed: 定額
bill_amount: 帳單金額
level_0: 起始值
level_1: 級距一
level_2: 級距二
level_3: 級距三
level_4: 級距四
level_5: 級距五
current_degree: 本期錶數
consumption: 使用度數
tax_excluded: 應繳金額稅外加
total_amount: 應繳金額
actual_amount: 銷售額
tax: 稅額
taxable_tax: 稅額
dollar/degree: 元/度
taxable_present_value: 課稅現值
announced_land_values: 公告地價
land_values: 地價
present_value: 現值
taxable_area: 課稅⾯積
percent:
prejudgment_interest: 遲延利息
vm_contract:
renewal_permission: 是否得續約
renewal_deadline: 續約申請期限
case_no: 案號
vendor: 廠商
start_end: 契約期間
contract_start_date: 契約期間開始
contract_end_date: 契約期間結束
construction_start_date: 興建期間開始
construction_end_date: 興建期間結束
construction_start_end: 興建期間
operation_start_date: 營運期間開始
operation_end_date: 營運期間結束
operation_start_end: 營運期間
free_period_start_date: 免費期間開始
free_period_end_date: 免費期間結束
free_period_start_end: 免費期間
renewal_permission: 是否得續約
renewal:
'true':
'false':
sign_date: 簽約日期
handover_date: 點交日期
deposit_amount_type_exp_date: '履約保證金額/形式/效期'
deposit_amount: 履約保證金額
deposit_payment_date: 履約保證金繳交日期
deposit_type: 履約保證金繳交形式
deposit_exp_date: 履約保證金效期
insurance_type: 保險一
insurance_payment_deadline: 保險一有效期限
insurance_payment_date: 保險一繳交日期
insurance_type2: 保險二
insurance_payment_deadline2: 保險二有效期限
insurance_payment_date2: 保險二繳交日期
insurance_type3: 保險三
insurance_payment_deadline3: 保險三有效期限
insurance_payment_date3: 保險三繳交日期
other_commitment: 其他回饋或承諾事項
note: 備註

View File

@ -1,7 +1,7 @@
Rails.application.routes.draw do Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales locales = Site.first.in_use_locales rescue I18n.available_locales
scope "(:locale)", locale: Regexp.new(locales.join("|")) do scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do namespace :admin do
resources :venue_managements do resources :venue_managements do
@ -12,6 +12,11 @@ Rails.application.routes.draw do
get 'venue_management_item_content' get 'venue_management_item_content'
get 'venue_management_signup_field' get 'venue_management_signup_field'
get 'venue_management_submission_field' get 'venue_management_submission_field'
get 'venue_management_invitings'
get 'venue_management_memorabilias'
get 'venue_management_bills'
get 'venue_management_contracts'
get 'print_pdf'
end end
end end
resources :venue_management_items do resources :venue_management_items do
@ -22,6 +27,26 @@ Rails.application.routes.draw do
resources :venue_management_agreements resources :venue_management_agreements
resources :venue_management_signups resources :venue_management_signups
resources :venue_management_item_contents resources :venue_management_item_contents
resources :venue_management_invitings do
collection do
get 'export'
end
end
resources :venue_management_memorabilias
resources :venue_management_bills do
collection do
scope "(:id)" do
get 'copy', to: 'venue_management_bills#copy'
end
get 'export'
end
end
resources :venue_management_contracts do
collection do
post 'fetch_inviting'
get 'export'
end
end
end end
resources :venue_managements do resources :venue_managements do
@ -36,5 +61,5 @@ Rails.application.routes.draw do
end end
end end
end end

View File

@ -1,17 +1,18 @@
module VenueManagement module VenueManagement
class Engine < ::Rails::Engine class Engine < ::Rails::Engine
initializer "venue_management" do initializer "venue_management" do
OrbitApp.registration "VenueManagement", :type => "ModuleApp" do OrbitApp.registration "VenueManagement", :type => "ModuleApp" do
module_label "venue_management.venue_management" module_label "venue_management.venue_management"
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
authorizable authorizable
categorizable categorizable
taggable "VenueManagementInviting"
frontend_enabled frontend_enabled
data_count 1..20 data_count 1..20
side_bar do side_bar do
head_label_i18n 'venue_management.venue_management', icon_class: "icon-globe" head_label_i18n 'venue_management.venue_management', icon_class: "icon-globe"
available_for "managers" available_for "sub_managers"
active_for_controllers (['admin/venue_managements']) active_for_controllers (['admin/venue_managements'])
head_link_path "admin_venue_managements_path" head_link_path "admin_venue_managements_path"
@ -19,32 +20,58 @@ module VenueManagement
:link_path=>"admin_venue_managements_path" , :link_path=>"admin_venue_managements_path" ,
:priority=>1, :priority=>1,
:active_for_action=>{'admin/venue_managements'=>'index'}, :active_for_action=>{'admin/venue_managements'=>'index'},
:available_for => 'managers' :available_for => 'sub_managers'
context_link 'new_', context_link 'new_',
:link_path=>"new_admin_venue_management_path" , :link_path=>"new_admin_venue_management_path" ,
:priority=>2, :priority=>2,
:active_for_action=>{'admin/venue_managements'=>'new'}, :active_for_action=>{'admin/venue_managements'=>'new'},
:available_for => 'managers' :available_for => 'sub_managers'
context_link 'categories', context_link 'categories',
:link_path=>"admin_module_app_categories_path" , :link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'venue_management').id}", :link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'venue_management').id}",
:priority=>3, :priority=>3,
:active_for_action=>{'admin/venue_managements'=>'categories'}, :active_for_action=>{'admin/venue_managements'=>'categories'},
:active_for_category => 'VenueManagement', :active_for_category => 'VenueManagement',
:available_for => 'managers' :available_for => 'sub_managers'
context_link 'tags',
:link_path=>"admin_module_app_tags_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'venue_management').id}",
:priority=>4,
:active_for_action=>{'admin/venue_managements'=>'tags'},
:active_for_tag => 'VenueManagement',
:available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_items', context_link 'venue_management.set_venue_management_items',
:link_path=>"admin_venue_management_items_path" , :link_path=>"admin_venue_management_items_path" ,
:priority=>3, :priority=>5,
:active_for_action=>{'admin/venue_managements'=>'venue_management_items'}, :active_for_action=>{'admin/venue_managements'=>'venue_management_items'},
:available_for => 'managers' :available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_agreements', context_link 'venue_management.set_venue_management_agreements',
:link_path=>"admin_venue_management_agreements_path" , :link_path=>"admin_venue_management_agreements_path" ,
:priority=>3, :priority=>6,
:active_for_action=>{'admin/venue_managements'=>'venue_management_agreements'}, :active_for_action=>{'admin/venue_managements'=>'venue_management_agreements'},
:available_for => 'managers' :available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_invitings',
:link_path => 'admin_venue_management_invitings_path',
:priority => 7,
:active_for_action => { 'admin/venue_managements' => 'venue_management_invitings' },
:available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_memorabilias',
:link_path => 'admin_venue_management_memorabilias_path',
:priority => 8,
:active_for_action => { 'admin/venue_managements' => 'venue_management_memorabilias' },
:available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_bills',
:link_path => 'admin_venue_management_bills_path',
:priority => 8,
:active_for_action => { 'admin/venue_managements' => 'venue_management_bills' },
:available_for => 'sub_managers'
context_link 'venue_management.set_venue_management_contracts',
:link_path => 'admin_venue_management_contracts_path',
:priority => 9,
:active_for_action => { 'admin/venue_managements' => 'venue_management_contracts' },
:available_for => 'sub_managers'
end end
end end
end end
end end
end end