Fix bugs.
This commit is contained in:
parent
84bdf0c9f1
commit
7a1de22911
|
@ -19,6 +19,9 @@ class VenueManagementBill
|
||||||
field :note, type: String, default: "", localize: true
|
field :note, type: String, default: "", localize: true
|
||||||
belongs_to :venue_management_main
|
belongs_to :venue_management_main
|
||||||
include VenueLinkFile
|
include VenueLinkFile
|
||||||
|
def display_accounting_month
|
||||||
|
return (self.accounting_month.strftime("%Y-%m") rescue "")
|
||||||
|
end
|
||||||
def case_no
|
def case_no
|
||||||
return (self.contractor.case_no rescue "")
|
return (self.contractor.case_no rescue "")
|
||||||
end
|
end
|
||||||
|
|
|
@ -89,6 +89,9 @@ class VenueManagementContract
|
||||||
def display_tags
|
def display_tags
|
||||||
self.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue ""
|
self.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue ""
|
||||||
end
|
end
|
||||||
|
def display_case_no
|
||||||
|
return (self.case_no.blank? ? I18n.t(:empty) : self.case_no)
|
||||||
|
end
|
||||||
before_save do
|
before_save do
|
||||||
org_contract = VenueManagementContract.find(self.id) rescue nil
|
org_contract = VenueManagementContract.find(self.id) rescue nil
|
||||||
inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil
|
inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil
|
||||||
|
|
|
@ -30,6 +30,9 @@ class VenueManagementInviting
|
||||||
has_many :venue_management_memorabilias, :class_name => 'VenueManagementMemorabilia', :foreign_key => "venue_management_memorabilia_ids"
|
has_many :venue_management_memorabilias, :class_name => 'VenueManagementMemorabilia', :foreign_key => "venue_management_memorabilia_ids"
|
||||||
belongs_to :venue_management_main
|
belongs_to :venue_management_main
|
||||||
include VenueLinkFile
|
include VenueLinkFile
|
||||||
|
def display_case_no
|
||||||
|
return (self.case_no.blank? ? I18n.t(:empty) : self.case_no)
|
||||||
|
end
|
||||||
before_save do
|
before_save do
|
||||||
contracts = self.venue_management_contracts
|
contracts = self.venue_management_contracts
|
||||||
org_inviting = VenueManagementInviting.find(self.id) rescue nil
|
org_inviting = VenueManagementInviting.find(self.id) rescue nil
|
||||||
|
|
|
@ -118,4 +118,9 @@ class VenueManagementMain
|
||||||
def case_no
|
def case_no
|
||||||
''
|
''
|
||||||
end
|
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
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= bill.accounting_month.strftime("%Y-%m") %></td>
|
<td><%= bill.display_accounting_month %></td>
|
||||||
<td><%= "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}" %>
|
<td><%= "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}" %>
|
||||||
<% if bill.bill_typeB == 'other' && bill.bill_other.present? %>
|
<% if bill.bill_typeB == 'other' && bill.bill_other.present? %>
|
||||||
-<%=bill.bill_other%>
|
-<%=bill.bill_other%>
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="control-group">
|
<tr class="control-group">
|
||||||
<th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.case_no') %></th>
|
<th class="venue_managementive-title-field control-label muted"><%= t('vm_contract.case_no') %></th>
|
||||||
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management_contract.venue_management_inviting.case_no %></td>
|
<td class="venue_managementive-title-value controls display_infos"><%= @venue_management.newest_case_no %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="control-group">
|
<tr class="control-group">
|
||||||
<th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.type') %></th>
|
<th class="venue_managementive-title-field control-label muted"><%= t('vm_inviting.type') %></th>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_bill.accounting_month') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_bill.accounting_month') %></th>
|
||||||
<td class="venue_managementive-title-value"><%= @venue_management_bill.accounting_month.strftime("%Y-%m") %></td>
|
<td class="venue_managementive-title-value"><%= @venue_management_bill.display_accounting_month %></td>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_bill.bill_type') %></th>
|
<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}")}" %>
|
<td class="venue_managementive-title-value"><%= "#{t("vm_bill.#{@venue_management_bill.bill_typeA}")}/#{t("vm_bill.#{@venue_management_bill.bill_typeB}")}" %>
|
||||||
|
|
|
@ -11,8 +11,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_contract.case_no') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_contract.case_no') %></th>
|
||||||
<% case_no = (@venue_management_contract.case_no.nil? ? t(:empty) : @venue_management_contract.case_no) %>
|
<td class="venue_managementive-title-value"><%= @venue_management_contract.display_case_no %></td>
|
||||||
<td class="venue_managementive-title-value"><%= case_no %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<% if !@venue_management_contract.nil? %>
|
<% if !@venue_management_contract.nil? %>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_contract.case_no') %></th>
|
<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>
|
<td class="venue_managementive-title-value"><%= @venue_management.newest_case_no rescue "" %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_inviting.type') %></th>
|
||||||
|
@ -230,7 +230,7 @@
|
||||||
<% @contracts.each do |contract| %>
|
<% @contracts.each do |contract| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to contract.case_no, "/#{I18n.locale}"+@params[:url]+"/#{contract.case_no.strip}-#{contract.id}?method=show_contract" , :target => '_blank' %>
|
<%= 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>
|
||||||
<td><%= contract.display_contractors %></td>
|
<td><%= contract.display_contractors %></td>
|
||||||
<td><%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %></td>
|
<td><%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %></td>
|
||||||
|
@ -306,7 +306,7 @@
|
||||||
<% @invitings.each do |inviting| %>
|
<% @invitings.each do |inviting| %>
|
||||||
<tr data-level="2" data-list="pd_datas">
|
<tr data-level="2" data-list="pd_datas">
|
||||||
<td>
|
<td>
|
||||||
<%= link_to inviting.case_no, "/#{I18n.locale}"+@params[:url]+"/#{inviting.case_no.strip}-#{inviting.id}?method=show_inviting", :target => '_blank' %>
|
<%= link_to inviting.display_case_no, "/#{I18n.locale}"+@params[:url]+"/#{inviting.display_case_no.strip}-#{inviting.id}?method=show_inviting", :target => '_blank' %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= inviting.publish_times %></td>
|
<td><%= inviting.publish_times %></td>
|
||||||
<td><%= "#{inviting.early_rent} / #{inviting.operation_rent}" %></td>
|
<td><%= "#{inviting.early_rent} / #{inviting.operation_rent}" %></td>
|
||||||
|
@ -355,7 +355,7 @@
|
||||||
<% contractors = t(:empty) if contractors.blank? %>
|
<% contractors = t(:empty) if contractors.blank? %>
|
||||||
<%= link_to contractors, "/#{I18n.locale}"+@params[:url]+"/#{contractors.to_s.strip}-#{bill.id}?method=show_bill", :target => '_blank' %>
|
<%= link_to contractors, "/#{I18n.locale}"+@params[:url]+"/#{contractors.to_s.strip}-#{bill.id}?method=show_bill", :target => '_blank' %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= bill.accounting_month.strftime("%Y-%m") %></td>
|
<td><%= bill.display_accounting_month %></td>
|
||||||
<td><%= "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}" %>
|
<td><%= "#{t("vm_bill.#{bill.bill_typeA}")}/#{t("vm_bill.#{bill.bill_typeB}")}" %>
|
||||||
<% if bill.bill_typeB == 'other' && bill.bill_other.present? %>
|
<% if bill.bill_typeB == 'other' && bill.bill_other.present? %>
|
||||||
-<%=bill.bill_other%>
|
-<%=bill.bill_other%>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_inviting.case_no') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_inviting.case_no') %></th>
|
||||||
<td class="venue_managementive-title-value"><%= @venue_management_inviting.case_no %></td>
|
<td class="venue_managementive-title-value"><%= @venue_management_inviting.display_case_no %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="venue_managementive-title-field"><%= t('vm_inviting.publish_times') %></th>
|
<th class="venue_managementive-title-field"><%= t('vm_inviting.publish_times') %></th>
|
||||||
|
|
Loading…
Reference in New Issue