SIM Dashboard


<%#= link_to 'Bulk Purchase', new_purchase_order_path, :class=>"btn btn-success bulk_checkbox", :id =>"show_bulk", :style=>"margin-right: 10px; display:none;" %>


<%= form_for :PurchaseOrders, url: new_purchase_order_path, :html => {class: "form-horizontal"} do |f| %> <% @sim_router_inventories.map{|a| puts a } %> <%= f.submit 'Bulk Purchase', :class=>"btn btn-success", :style=>"margin-right: 10px; margin-left:16px;display:none;", :id =>"bulk_purchase"%>
<%(@sim_router_inventories || []).each do |x|%> <%end%>
Select SIM ICCID Purchased On Plan Type Plan Name Status Action
<% 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" %> <%#= check_box_tag "sim_router_inventories_ids[]", x.id %> <% else %> <%= check_box_tag "sim_router_inventories_ids[]", x.id %> <% end %> <% else %> <%= check_box_tag "sim_router_inventories_ids[]", x.id %> <% end %> <% else %> <%= check_box_tag "sim_router_inventories_ids[]", x.id %> <% end %> <%= x.iccid %> <%= 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.purchase_orders.completed.last.sim_rate_plan.present? %>
<%= x.purchase_orders.completed.last.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 %> <% 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" %> <% else %> <% if x.purchase_orders.completed.last.payment_invoices.to_a.first.payment_status != "success" %> <%= link_to 'Purchase Plan', new_purchase_order_path(:sim_router_inventories_ids => "#{x.id}"), :class=>"label label-primary "%> <% else %> <%= link_to 'Activate Now', activated_plans_payment_invoice_index_path(:invoice =>x.purchase_orders.completed.last.payment_invoices.to_a.first.invoice_number), :class=>"label label-warning "%> <% end %> <% end %> <% else %> <%= link_to 'Activate', new_purchase_order_path(:sim_router_inventories_ids => "#{x.id}"), :class=>"label label-primary "%> <% end %> <% else %> <%= link_to 'Activate', new_purchase_order_path(:sim_router_inventories_ids => "#{x.id}"), :class=>"label label-primary "%> <% end %>
<% end %>
<%= render :partial => "monitoring/top_bar" %>