53 lines
2.4 KiB
Text
53 lines
2.4 KiB
Text
<div class="header">
|
|
<h1><%= @invoice.number %></h1>
|
|
<p class="tagline"><a href="/admin/invoices">← all invoices</a></p>
|
|
</div>
|
|
|
|
<section class="section">
|
|
<dl class="kv">
|
|
<dt>Client</dt><dd><%= @invoice.client_name %> <<%= @invoice.client_email %>></dd>
|
|
<dt>Issued</dt><dd class="mono"><%= @invoice.issued_on.strftime('%Y-%m-%d') %></dd>
|
|
<dt>Due</dt><dd class="mono"><%= @invoice.due_on.strftime('%Y-%m-%d') %></dd>
|
|
<dt>Total</dt><dd class="mono"><%= @invoice.currency %> <%= '%.2f' % @invoice.total %><% unless @invoice.currency == 'GEL' %> · GEL <%= '%.2f' % @invoice.total_gel %><% end %></dd>
|
|
<dt>Status</dt><dd><span class="badge badge-<%= @invoice.status %>"><%= @invoice.status %></span></dd>
|
|
<% if @invoice.paid_at %>
|
|
<dt>Paid at</dt><dd class="mono"><%= @invoice.paid_at.utc.strftime('%Y-%m-%d %H:%M UTC') %></dd>
|
|
<% end %>
|
|
<% if @invoice.ltc? %>
|
|
<dt>LTC</dt>
|
|
<dd class="mono">
|
|
<% if (amt = @invoice.ltc_amount_due) %><%= amt.to_s('F').sub(/\.?0+$/, '') %> LTC<% if @invoice.ltc_rate %> @ <%= @invoice.ltc_rate.to_s('F').sub(/(\.\d*?)0+$/, '\1').sub(/\.$/, '') %> <%= @invoice.currency %><% end %><br /><% end %>
|
|
<span style="word-break:break-all;"><%= @invoice.ltc_address %></span>
|
|
</dd>
|
|
<% end %>
|
|
</dl>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>Actions</h2>
|
|
<p>
|
|
<a href="/i/<%= @invoice.uuid %>" target="_blank">Public landing page</a>
|
|
·
|
|
<a href="/i/<%= @invoice.uuid %>/pdf" target="_blank">Download PDF</a>
|
|
</p>
|
|
<p>
|
|
Share this URL with the client:<br />
|
|
<code class="mono">https://asxp.io/i/<%= @invoice.uuid %></code>
|
|
</p>
|
|
<form method="post" action="/admin/invoices/<%= @invoice.uuid %>/paid" style="margin-top: 14px;">
|
|
<input type="hidden" name="authenticity_token" value="<%= csrf_token %>" />
|
|
<button type="submit">
|
|
<% if @invoice.paid? %>Mark unpaid<% else %>Mark paid<% end %>
|
|
</button>
|
|
</form>
|
|
<p style="margin-top: 14px;">
|
|
<a href="/admin/invoices/<%= @invoice.uuid %>/duplicate">Use as template for a new invoice →</a>
|
|
</p>
|
|
</section>
|
|
|
|
<% unless @invoice.notes.to_s.strip.empty? %>
|
|
<section class="section">
|
|
<h2>Notes</h2>
|
|
<p style="white-space: pre-wrap;"><%= @invoice.notes %></p>
|
|
</section>
|
|
<% end %>
|