<% if @account.present? %>
Id:
<%= @account.account_id %> 
Name:
<%= @account.name %> 
Email:
<%= @account.email %> 
Bill cycle day:
<% if @account.bill_cycle_day %>
<%= @account.bill_cycle_day %> (user timezone)
<% else %>
<%=t :unknown_bcd %>
<% end %>
Currency:
<%= @account.currency %> 
Timezone:
<%= @account.timezone %> 
Address 1:
<%= @account.address1 %> 
Address 2:
<%= @account.address2 %> 
Company:
<%= @account.company %> 
State:
<%= @account.state %> 
Country:
<%= @account.country %> 
Phone:
<%= @account.phone %> 
External key:
<%= @account.external_key %> 
Overdue status:
<% if @overdue_state.nil? %>
unknown
<% elsif @overdue_state.clear_state %>
Good
<% else %>
<%= @overdue_state.name %>
<% end %>
Account balance:
<% if @account.balance.nil? %>
unknown
<% elsif @account.balance <= 0 %>
<%= humanized_money_with_symbol @account.balance_to_money %> (<%= @account.currency %>) <% else %>
<%= humanized_money_with_symbol @account.balance_to_money %> (<%= @account.currency %>) <% end %>   <%= link_to 'Payment', kaui_engine.pay_all_invoices_account_path(@account.account_id), :method => :post, :class => "btn btn-mini #{"disabled" if !@account.balance.nil? and @account.balance <= 0}" %> <% if can? :credit, Kaui::Account %> <%= link_to 'Credit', kaui_engine.new_credit_path(:params => { :account_id => @account.account_id }), :class => "btn btn-mini" %> <% end %> <% if can? :charge, Kaui::Account %> <%= link_to 'Charge', kaui_engine.new_charge_path(:params => { :account_id => @account.account_id }), :class => "btn btn-mini" %> <% end %>
Account credit:
<% if @account.cba.nil? %>
unknown <% elsif @account.cba >= 0 %>
<%= humanized_money_with_symbol @account.cba_to_money %> (<%= @account.currency %>) <% else %>
<%= humanized_money_with_symbol @account.cba_to_money %> (<%= @account.currency %>) <% end %>
Notified for inv?
<%= @account.is_notified_for_invoices %> <%= link_to "Toggle", kaui_engine.toggle_email_notifications_account_path(@account.account_id, :is_notified => !@account.is_notified_for_invoices), :method => :post, :class => 'btn btn-mini' %>
<%= render :partial => "kaui/tags/tags_table", :locals => { :tags => @tags, :tags_url_or_path => kaui_engine.edit_account_tags_path(:params => { :account_id => @account.account_id }), :tags_show_path => kaui_engine.edit_account_tags_path(:params => { :account_id => @account.account_id}) } %> <%= render :partial => "kaui/account_emails/account_emails_table", :locals => { :account_emails => @account_emails, :account_id => @account.account_id } %>
New base subscription:
<%= link_to "Create", kaui_engine.new_subscription_path(:params => { :account_id => @account.account_id, :product_category => "BASE" }), :class => "btn btn-mini" %>

<%= link_to "Billing timeline", kaui_engine.account_timeline_path(@account.account_id) %>

<% if @payment_methods.present? %> <%= render :partial => "kaui/payment_methods/payment_methods_table", :locals => { :account_id => @account.account_id, :payment_methods => @payment_methods } %> <% end %> <%= link_to "Add payment method", kaui_engine.add_payment_method_account_path(@account.account_id), :class => "btn btn-mini" %> <% @bundles.each do |bundle| %> <% subs = @subscriptions_by_bundle_id[bundle.bundle_id] %> <% if subs.present? %>

Bundle <%= link_to Kaui.bundle_key_display_string.call(bundle.external_key), Kaui.bundle_home_path.call(bundle.bundle_id) if bundle.external_key.present? %>

<%= render :partial => "kaui/subscriptions/subscriptions_table", :locals => { :subscriptions => subs, :account => @account } %> <% end %> <% end %> <% else %>

Account not found

<% end %> <%= javascript_tag do %> function disableLinks() { $('a.btn.disabled').click(function (e) { // e.preventDefault(); is not enough here return false; }); } $(document).ready(function() { disableLinks(); }); <% end %>