<% if @invoice.present? %> <h3>Invoice number: INV<%= @invoice.invoice_number %></h3> <dl class="dl-horizontal"> <dt>Account Name:</dt> <dd><%= @account.name %> </dd> <dd><%= link_to @account.email, Kaui.account_home_path.call(@account.external_key) %> </dd> <dt>Invoice date:</dt> <dd><%= format_date(@invoice.invoice_dt).html_safe %> </dd> <dt>Target date:</dt> <dd><%= format_date(@invoice.target_dt).html_safe %> </dd> <dt>Amount:</dt> <dd><%= @invoice.amount %> </dd> <dt>Balance:</dt> <dd><%= @invoice.balance %> </dd> </dl> <div class="page-header"> <h3>Subscriptions</h3> </div> <table class="table table-condensed table-striped data-table"> <thead> <tr> <th>External Key</th> <th>Product category</th> <th>Product name</th> <th>Billing period</th> <th>Start date</th> <th>Charged through date</th> <th>Price list</th> </tr> </thead> <tbody> <% @invoice.items.each do |item| %> <% sub = @subscriptions[item.subscription_id] %> <% bundle = @bundles[item.bundle_id] %> <% if sub.present? && bundle.present? %> <tr> <td> <%= link_to Kaui.bundle_key_display_string.call(bundle.external_key), Kaui.bundle_home_path.call(bundle.external_key) if bundle.external_key.present? %> </td> <td><%= sub.product_category.downcase.capitalize if sub.product_category.present? %></td> <td><%= sub.product_name.downcase.capitalize if sub.product_name.present? %></td> <td><%= sub.billing_period.downcase.capitalize if sub.billing_period.present? %></td> <td><%= format_date(sub.start_date).html_safe %></td> <td><%= format_date(sub.charged_through_date).html_safe %></td> <td><%= sub.price_list.downcase.capitalize if sub.price_list.present? %></td> </tr> <% end %> <% end %> </tbody> </table> <div class="page-header"> <% if @payments.present? %> <%= render :partial => "kaui/payments/payments_table" %> <% end %> </div> <% else %> <p>Invoice not found</p> <% end %> <%= link_to 'Back', :back, :class => 'btn' %> <%= link_to "View customer invoice html", kaui_engine.show_html_invoice_path(@invoice.invoice_id), :class => 'btn', :target => "_blank" %>