Invoice <%= @invoice.invoice_number %>
<% unless @invoice.invoice_number.blank? %>
<%= link_to 'View customer invoice html', kaui_engine.show_html_invoice_path(@invoice.invoice_id), :class => 'btn', :target => '_blank' %>
<% end %>
<% dry_run = @invoice.invoice_number.blank? %>
<% if dry_run %>
This is a dry-run invoice.
<% if can? :trigger, Kaui::Invoice %>
To persist it, <%= link_to 'trigger an invoice run', kaui_engine.trigger_invoice_path(:account_id => @invoice.account_id, :target_date => @invoice.target_date), :method => :post %>.
<% end %>
<% elsif @invoice.status == 'DRAFT' %>
This is a DRAFT invoice.
<%= link_to 'Commit it', kaui_engine.commit_invoice_path(:id => @invoice.invoice_id), :method => :post %>.
<% end %>
Invoice date |
<%= @invoice.invoice_date %> |
Target date |
<%= @invoice.target_date %> |
<%= render :partial => 'kaui/invoices/invoice_table', :locals => {:dry_run => dry_run} %>