<% begin %>
<%= render "layouts/header" %>
<%= render "layouts/sidebar" %>
Catering List
<%= render "layouts/breadcrumbs" %>
<% if flash[:error] %>
× <%= flash[:error] %>
<% end %>
<%= form_tag({:action=>'index'},:multipart=>true,:id=>'myForms') do %>

<%end%>

Open

<%= @open_count %>

Mild

<%= @mild_count.present? ? @mild_count : 0 %>

Warm

<%= @warm_count.present? ? @warm_count : 0 %>

Hot

<%= @hot_count.present? ? @hot_count : 0 %>

Closed With Us

<%= @closed_count.present? ? @closed_count : 0 %>

Dead <%= @dead_count.present? ? @dead_count : 0 %>

Waste <%= @waste_count.present? ? @waste_count : 0 %>

<% pagestart = params[:page].present? ? params[:page].to_i : 1 %> <% i = pagestart <= 1 ? 1 : ((pagestart - 1) * 10) + 1 %> <% if @information_list && @information_list.length>0 %> <% @information_list.each do |information| fis_details = get_fis_details_function(information.fis_entryno) venue_details = get_fis_venue_details_function(information.fis_entryno) %> <% i += 1 %> <% end %> <% else %> <% i = pagestart <= 1 ? 1 : ((pagestart - 1) * 10) + 1 %> <% if @CateringList.length>0 %> <% @CateringList.each do |catering| functiontype= "" functiobj = get_catering_details(catering.ch_compcode,catering.ch_entry_no) if functiobj functiontype=functiobj.chd_function datetype = functiobj.chd_date datetime = functiobj.chd_time remakrs = functiobj.chd_remarks veneu1 = functiobj.chd_venue1 veneu2 = functiobj.chd_venue2 end venue1="" venue1obj= get_venue1_name(veneu1) if venue1obj venue1 = venue1obj.vnu_name end username= "" userobj = user_detail(catering.ch_cater_entryby) if userobj username = userobj.firstname end funcnam = "" funcobj = get_function_type_name(functiontype) if funcobj funcnam = funcobj.func_type end priority_class = case catering.ch_priority when 'Silver' 'badge-silver' when 'Gold' 'badge-gold' when 'Platinum' 'badge-platinum' else '' end %> <% i += 1 %> <% end %> <% end %> <% end %>
Action S.No Guest Details Function Details Catering Lead Source Follow-up Details
<%=i%> <%= information.fis_guest_name%>
<%= information.fis_client_mobile%>
<% if fis_details && fis_details.present? %> <% colors = ['#fdf4e3', '#e8f5e9', '#e3f2fd', '#fce4ec'] %> <% fis_details.each_with_index do |details, index| %>
Function: <%= details.fisd_function_type %> (<%= formatted_date(details.fisd_function_date) %>)
Venue/Location: <%= get_venue_name(details.fisd_venue_id) %> / <%= get_location_name(details.fisd_location_id) %>
Catering Value: <%= details.fisd_menu_value.present? ? details.fisd_menu_value : 'N/A' %>
<% end %> <% else %>
No Functions
<% end %>
<% if fis_details && fis_details.present? %> <% colors = ['#fdf4e3', '#e8f5e9', '#e3f2fd', '#fce4ec'] %> <% fis_details.each_with_index do |details, index| %>
Lumpsum Amount: <%= details.fisd_decoration_lumpsum.present? ? details.fisd_decoration_lumpsum : 'N/A' %>
Remarks: <%= details.fisd_decoration_remarks.present? ? details.fisd_decoration_remarks : 'No remarks' %>
<% if details.fisd_decoration_contract == 'Y' %> Contract Required <% end %>
<% end %> <% else %>
No Functions
<% end %>
<% if fis_details && fis_details.present? %> <% colors = ['#fdf4e3', '#e8f5e9', '#e3f2fd', '#fce4ec'] %> <% fis_details.each_with_index do |details, index| %>
Lumpsum Amount: <%= details.fisd_entertainment_lumpsum.present? ? details.fisd_entertainment_lumpsum : 'N/A' %>
Remarks: <%= details.fisd_entertainment_remarks.present? ? details.fisd_entertainment_remarks : 'No remarks' %>
<% if details.fisd_entertainment_contract == 'Y' %> Contract Required <% end %>
<% end %> <% else %>
No Functions
<% end %>
<% if information.present? && information.fis_status != 'confirm' %> <% end %>
<%=i%> <%=catering.ch_guest_name%>
<%=catering.ch_contact_no%>
<%=funcnam%>
<%=formatted_date(datetype)%>
<%=datetime%>
<%=venue1%><%=veneu2%>
<%=catering.ch_priority%>
<%=catering.ch_enquiry_mode%> <% latest_followup = get_latest_followup(catering.id, 'C') %> <% if latest_followup.present? %> Follow-up on <%= formatted_date(latest_followup.FLLW_Next_Date) %> at <%= format_time(latest_followup.FLLW_Next_Time) %>
with remarks: <%= latest_followup.FLLW_Next_Remarks.presence || "No remarks" %>. Status: <%= latest_followup.FLLW_Status %>. <% if latest_followup.present? && latest_followup.FLLW_Next_Remarks != 'Auto-generated follow-up'%> ')"> <% end %> <% else %> No Follow-up Details. <% end %>
<% message = "" rescue ActiveRecord::RecordNotFound => e # Handle the specific exception when the record is not found message = "Record not found "##{e.message} isFlags = false rescue ActiveRecord::StatementInvalid => e # Handle SQL syntax errors or invalid queries message = "Unknown error #{e.message}" # isFlags = false rescue StandardError => e # Handle any other errors message = "An error occurred" ##{e.message} isFlags = false end %> <%=message%>