Sha256: c7a0db7840791c410a7c0f84230feb4c7c6e339ba6b0573a9989f4309dbb5333

Contents?: true

Size: 1.89 KB

Versions: 2

Compression:

Stored size: 1.89 KB

Contents

<% if @record.is_published # This means we want to confirm an un-publish -%>
  <h1>Are you sure you wish to un-publish this invoice?</h1>
  <% if @record.payment_assignments.length > 0 -%>
    <p>Please be aware that by un-publishing this invoice:</p>
    <p><strong><%=h @record.name%></strong></p>
    <p>You will be removing the following payment assignments:<p>
    <ul>
    <%= @record.payment_assignments.collect{|ip|
      '<li>%s from (Payment %d)</li>' % [ip.amount.format, ip.payment_id  ] 
    }.join %>
    </ul>
    <p>These payments can be re-assigned if/when you decide to re-publish this invoice.</p>
  <% else -%>
    <p><%=h @record.name%></p>
    <p>This invoice currently has no payments applied to its balance, and can be safely un-published without affecting the payment register.</p>
  <% end -%>
<% else  # This means we want to confirm a publish  -%>
  <h1>Would you like to email this invoice to the client?</h1>
  <p>Shall we email this invoice:</p>
  <p><strong><%=h @record.name%></strong></p>
  <p>to the following recipients:</p>
  <% if @record.client.client_representatives.length > 0 -%>
  <ul>
    <%= @record.client.client_representatives.find(:all, :include => [:credential]).collect{|cr| 
    '<li>%s &lt;%s&gt;</li>' % [cr.name, cr.email_address  ] 
    }.join %>
  </ul>
  <p>with the invoice included as a pdf attachment?</p>
  <% else -%>
    <p>(No client representatives were found)</p>
  <% end -%>
<% end -%>


<% if @record.is_published %>
  <%= toggle_published_submit 'Un-Publish...', true, :email_invoice => 1 %> 
<% else %>
  <%= toggle_published_submit 'Yes - send this out', true, :email_invoice => 1 %> 
  <%= toggle_published_submit 'Nope - just publish it', false, :email_invoice => 0 %>
<% end %>
<span id="cancel_box"> or 
  <%= link_to_function(
    'Cancel & Close', 
    "Modalbox.hide();", 
    :title => 'Cancel & Close'
  ) %>
</span>
<%= toggle_published_indicator %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brisk-bills-0.8.2 app/views/admin/invoices/confirm_publish_modal.html.erb
brisk-bills-0.8.1 app/views/admin/invoices/confirm_publish_modal.html.erb