diff --git a/app/assets/stylesheets/registrar.sass b/app/assets/stylesheets/registrar.sass index 2f2de0b32..0ab63cacb 100644 --- a/app/assets/stylesheets/registrar.sass +++ b/app/assets/stylesheets/registrar.sass @@ -7,6 +7,7 @@ $container-large-desktop: 1040px $font-family-sans-serif: 'EtelkaLightProRegular', Arial, Helvetica, sans-serif $font-family-serif: 'EtelkaLightProBold', Georgia, "Times New Roman", Times, serif $font-size-h1: 26px +$navbar-default-link-active-color: #333 html position: relative @@ -30,6 +31,9 @@ hr .no-border border: 0 !important +.navbar li + font-weight: bold + .footer position: absolute bottom: 0 diff --git a/app/controllers/registrar/invoices_controller.rb b/app/controllers/registrar/invoices_controller.rb index ebca56950..bb6a146ad 100644 --- a/app/controllers/registrar/invoices_controller.rb +++ b/app/controllers/registrar/invoices_controller.rb @@ -4,6 +4,7 @@ class Registrar::InvoicesController < RegistrarController before_action :set_invoice, only: [:show] def index + @invoices = current_user.registrar.invoices.includes(:invoice_items) end def show diff --git a/app/views/registrar/invoices/index.haml b/app/views/registrar/invoices/index.haml index 56a5147fd..b76d4f40e 100644 --- a/app/views/registrar/invoices/index.haml +++ b/app/views/registrar/invoices/index.haml @@ -1,2 +1,20 @@ -invoices index - +%h1= t('invoices') +%hr +.table-responsive + %table.table.table-hover.table-condensed + %thead + %tr + %th{class: 'col-xs-3'}= t('invoice') + %th{class: 'col-xs-3'}= t('paid_at') + %th{class: 'col-xs-3'}= t('due_date') + %th{class: 'col-xs-3'}= t('total') + %tbody + - @invoices.each do |x| + %tr + %td= link_to(t('invoice_no', no: x.id), [:registrar, x]) + - if x.paid_at + %td= l(x.paid_at) + - else + %td{class: 'text-danger'}= t('unpaid') + %td= l(x.due_date) + %td= x.total diff --git a/config/locales/en.yml b/config/locales/en.yml index 5fc476487..b9e0e6089 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -650,3 +650,4 @@ en: seller: 'Seller' prepayment: 'Prepayment' vat: 'VAT (%{vat_prc}%)' + unpaid: 'Unpaid' diff --git a/db/migrate/20150407145943_add_invoice_columns.rb b/db/migrate/20150407145943_add_invoice_columns.rb index 543fb0ac0..eb4dbd473 100644 --- a/db/migrate/20150407145943_add_invoice_columns.rb +++ b/db/migrate/20150407145943_add_invoice_columns.rb @@ -13,7 +13,7 @@ class AddInvoiceColumns < ActiveRecord::Migration add_column :invoices, :reference_no, :string add_column :invoices, :vat_prc, :decimal #add_column :invoices, :total_sum, :decimal # calculate on the fly - add_column :invoices, :paid_at, :datetime + add_column :invoices, :paid_at, :datetime # maybe figure this out from transactions # seller info # add_column :invoices, :sellable_id, :integer # EIS is actually a registrar itself and invoice can belong to EIS