<% if @invoices.size == 0 && @invoice_templates.size == 0 && @receipts.size == 0 && @receipt_templates.size == 0 && @contacts.size == 0 %>
<%= t('invoice_bar.nothing_found') %>
<% end %> <% if @invoices.size > 0 %>

<%= t('titles.invoices') %>

<% @invoices.each do |invoice| %> <% end %>
<%= t('attributes.invoice.number') %> <%= t('attributes.invoice.contact_name') %> <%= t('attributes.invoice.issue_date') %> <%= t('attributes.invoice.due_date') %> <%= t('attributes.invoice.amount') %> Stav
<%= link_to invoice do %><%= invoice.number %><% end %> <%= invoice.contact_name %> <%= l(invoice.issue_date) %> <%= l(invoice.due_date) %> <%= invoice.amount %> <% if invoice.paid %> <%= link_to 'Zaplaceno', invoice_path(invoice), class: 'btn-small btn-success btn-no-link' %> <% elsif invoice.due_date >= Date.today and invoice.issued? %> <% if invoice.sent? %> <%= link_to 'Posláno', invoice_path(invoice), class: 'btn-small btn-info btn-no-link' %> <% else %> <%= link_to 'Neposláno', invoice_path(invoice), class: 'btn-small btn-warning btn-no-link' %> <% end %> <% else %> <%= link_to 'Nezaplaceno', invoice_path(invoice), class: 'btn-small btn-danger btn-no-link' %> <% end %>
<% end %> <% if @receipts.size > 0 %>

<%= t('titles.receipts') %>

<% @receipts.each do |receipt| %> <% end %>
<%= t('attributes.receipt.number') %> <%= t('attributes.receipt.contact_name') %> <%= t('attributes.receipt.issue_date') %> <%= t('attributes.receipt.amount') %>
<%= link_to receipt do %><%= receipt.number %><% end %> <%= receipt.contact_name %> <%= l(receipt.issue_date) %> <%= receipt.amount %>
<% end %> <% for invoice_template in @invoice_templates %>

<%= t('titles.invoice_templates') %>

<% @invoice_templates.each do |invoice| %> <% end %>
<%= t('attributes.invoice_template.name') %> <%= t('attributes.invoice_template.contact_name') %> <%= t('attributes.invoice_template.amount') %>
<%= link_to invoice do %><%= invoice.name %><% end %> <%= invoice.contact_name %> <%= invoice.amount %>
<% end %> <% for receipt_template in @receipt_templates %>

<%= t('titles.receipt_templates') %>

<% @receipt_templates.each do |receipt| %> <% end %>
<%= t('attributes.receipt_template.name') %> <%= t('attributes.receipt_template.contact_name') %> <%= t('attributes.receipt_template.amount') %>
<%= link_to receipt do %><%= receipt.name %><% end %> <%= receipt.contact_name %> <%= receipt.amount %>
<% end %> <% for contact in @contacts %>

<%= t('titles.contacts.list') %>

<% @contacts.each do |contact| %> <% end %>
<%= t('attributes.contact.name') %> <%= t('attributes.contact.ic') %> <%= t('attributes.contact.email') %>
<%= link_to contact do %><%= contact.name %><% end %> <%= contact.ic %> <%= contact.email %>
<% end %>