<% if subscriptions.present? && !subscriptions.nil? %> <% subscriptions.each do |sub| %> <% end %> <% end %>
Product category Product name Start date Charged through date Notes Actions
<%= sub.product_category.downcase.capitalize if sub.product_category.present? %> <%= sub.product_name.downcase.capitalize if sub.product_name.present? %> <%= sub.billing_period.downcase.capitalize if sub.billing_period.present? %> <% if sub.price_list.present? && sub.price_list.upcase != "DEFAULT" %> ( <%= sub.price_list.downcase.capitalize %> pricelist ) <% end %> <%= format_date(sub.start_date).html_safe if sub.start_date.present? %> <%= format_date(sub.charged_through_date).html_safe if sub.charged_through_date.present? %> <% if sub.canceled_date.present? && !sub.canceled_date.nil? %> <% if Time.parse(sub.canceled_date) > Time.now %> <%= "Pending cancellation on " %> <% else %> <%= "Canceled on " %> <% end %> <%= format_date(sub.canceled_date).html_safe %> <% end %> <% if sub.product_category == 'BASE' %> <% if sub.canceled_date.present? && Time.parse(sub.canceled_date) > Time.now %> <%= link_to "Reinstate", kaui_engine.reinstate_subscription_path(:id => sub.subscription_id), :method => :put, :class => "btn btn-mini" %> <% elsif !sub.canceled_date.present? %> <%= link_to "Change", kaui_engine.edit_subscription_path(sub.subscription_id), :class => "btn btn-mini" %> <%= link_to "Cancel", kaui_engine.subscription_path(:id => sub.subscription_id), :method => :delete, :class => "btn btn-mini" %> <%= link_to "Add Addons", kaui_engine.new_subscription_path(:params => { :bundle_id => sub.bundle_id, :base_subscription => sub.product_name }), :class => "btn btn-mini" %> <% end%> <% else %> <% end %> <% if sub.product_category == 'ADD_ON' %> <%= link_to "Cancel", kaui_engine.subscription_path(:id => sub.subscription_id), :method => :delete, :class => "btn btn-mini" unless sub.canceled_date.present? %> <% if sub.canceled_date.present? && Time.parse(sub.canceled_date) > Time.now %> <%= link_to "Reinstate", kaui_engine.reinstate_subscription_path(:id => sub.subscription_id), :method => :put, :class => "btn btn-mini" %> <% end %> <% end %>