<% if @invoice.present? %>

Invoice number: INV<%= @invoice.invoice_number %>

Account Name:
<%= @account.name %> 
<%= link_to @account.email, Kaui.account_home_path.call(@account.external_key) %> 
Invoice date:
<%= format_date(@invoice.invoice_date).html_safe %> 
Target date:
<%= format_date(@invoice.target_date).html_safe %> 
Amount:
<%= @invoice.amount %> 
Balance:
<%= @invoice.balance %> 
<% @invoice.items.each do |item| %> <% sub = @subscriptions[item.subscription_id] %> <% bundle = @bundles[item.bundle_id] %> > <% end %>
External Key Description Start date End date Charged through date Price list Amount
<%= link_to Kaui.bundle_key_display_string.call(bundle.external_key), Kaui.bundle_home_path.call(bundle.bundle_id) if bundle.present? and bundle.external_key.present? %> <%= item.description %> <%= format_date(item.start_date).html_safe if item.start_date %> <%= format_date(item.end_date).html_safe if item.end_date %> <%= format_date(sub.charged_through_date).html_safe if sub.present? %> <%= sub.price_list.downcase.capitalize if sub.present? and sub.price_list.present? %> <%= item.amount %> <%= item.currency %> <%= link_to "Adjust", kaui_engine.edit_invoice_item_path(item.invoice_item_id, :invoice_id => @invoice.invoice_id), :class => "btn btn-mini" %>
<% else %>

Invoice not found

<% 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" %>