List of sim Managements <%= link_to "Download as CSV", download_csv_sim_managements_path(:format => "csv"), class: "pull-right",style: "border-top:1000px" %>

<%= form_for :PurchaseOrders, url: change_plan_purchase_orders_path, :html => {class: "form-horizontal"} do |f| %>
<%(@sim_managements || []).each do |x|%> <%end%>
<%= check_box_tag("select_all", nil, nil, :class => "table-select-all") %> SIM ICCID Organisation Purchased On Plan Type Plan Name Status Organisation Name
<%= check_box_tag("sim_ids[]",x.id,nil,:class => "sim-select table-row-check") %> <%= x.iccid %> <% org = x.organisation %><%= org.try(:organisation_name) %> - <%= org.users.where(is_admin: "true").first.try(:email) if org.present? %> <%= x.activated_on.present? ? x.activated_on : "-" %> <% if x.purchase_orders.completed.last.present? %> <% if x.purchase_orders.completed.last.sim_rate_plan.present? %> <%= x.purchase_orders.completed.last.sim_rate_plan.plan_type%> <% else %> <%= "-"%> <% end %> <% else %> <%= "- "%> <% end %> <% if x.purchase_orders.completed.last.present? %> <% if x.sim_rate_plan.present? %>
<%= x.sim_rate_plan.data_plan %>
<% else %> <%= "-"%> <% end %> <% else %> <%= "- "%> <% end %>
<%# if x.purchase_orders.completed.last.present? %> <%# if x.purchase_orders.completed.last.payment_invoices.present? %> <%# if x.purchase_orders.completed.last.payment_invoices.to_a.first.payment_status == "success" && x.is_active == "true" %> <%#= link_to 'Active', "#", :class=>"label label-success "%> <%# else %> <%#= link_to 'New', "#", :class=>"label label-info "%> <%# end %> <%# else %> <%#= link_to 'New', "#", :class=>"label label-info "%> <%# end %> <%# else %> <%#= link_to 'New', "#", :class=>"label label-info "%> <%# end %> <%= x.current_status%> <%if x.organisation.present? %> <%= x.organisation.organisation_name.try(:humanize)%> - <%= x.organisation.users.to_a.first.try(:email) if x.organisation.users.to_a.first.try(:is_admin) == "true"%> <%end%>
<% end %>