Id:
<%= @account.account_id %> 
Name:
<%= @account.name %> 
Email:
<%= @account.email %> 
Bill cycle day:
<% if @account.bill_cycle_day_local %>
<%= @account.bill_cycle_day_local %> (user timezone)
<% else %>
<%= t :unknown_bcd %>
<% end %>
Currency:
<%= @account.currency %> 
Timezone:
<%= @account.time_zone %> 
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.account_balance.nil? %>
unknown
<% elsif @account.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-xs #{"disabled" if !@account.account_balance.nil? and @account.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-xs" %> <% end %> <% if can? :charge, Kaui::Account %> <%= link_to 'Charge', kaui_engine.new_charge_path(:params => {:account_id => @account.account_id}), :class => "btn btn-xs" %> <% end %>
Account credit:
<% if @account.account_cba.nil? %>
unknown <% elsif @account.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-xs' %>
<%= 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.account_tags_path(: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-xs" %>
<% 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.new_payment_method_path(:account_id => @account.account_id), :class => "btn btn-xs" %> <% @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 %> <%= javascript_tag do %> function disableLinks() { $('a.btn.disabled').click(function (e) { // e.preventDefault(); is not enough here return false; }); } $(document).ready(function() { disableLinks(); }); <% end %>