anchor.diff:              </td>
             </tr>
             <% end %>
  +          <tr>
  +            <td>Posted</td>
  +            <td><%= @invoice.post_date %></td>
  +          </tr>
             <tr>
               <td>Status</td>
               <td>
  
positive.code:     <th>Memo</th>
      <th style="text-align: right">Amount</th>
    </tr>
    <% 
      invoiced_items = Payment.where(invoice_id: @invoice.id).where.not(payable_type: :invoice)
      invoiced_items.each do |pmt| %>
    <tr>
      <%
      if pmt.payable_type == "ShipmentItem"
        si = ShipmentItem.find(pmt.payable_id)
      %>
        <td><%= si.shipment.ship_date %></td>
        <td><%= link_to si.shipment.to_s, admin_store_shipment_path(si.shipment) %></td>
  
negative.code: <%
    start_date = Date.new(2500, 1, 1)
    end_date = Date.new(1900, 1, 1)
    
    invoiced_items = Payment.where(invoice_id: @invoice.id).where.not(payable_type: :invoice)
    invoiced_items.each do |pmt|
      date = sysdate(pmt.created_at)
      date = pmt.payable.shipment.ship_date if pmt.payable_type == "ShipmentItem"
      date = pmt.payable.ship_date if pmt.payable_type == "Shipment"
      date = pmt.payable.submitted if pmt.payable_type == "Order"
      
      start_date = date if date < start_date
      end_date = date if date > end_date
    end
  %>
  
  <div class="pull-right">
    <%= link_to edit_admin_billing_invoice_path(@invoice), class: 'btn btn-default btn-sm' do %>
      <i class="fa fa-edit"></i> Edit
  