mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 03:09:36 +02:00
Add index view for invoices
This commit is contained in:
parent
6a47f38e80
commit
d33d249e2d
5 changed files with 27 additions and 3 deletions
|
@ -7,6 +7,7 @@ $container-large-desktop: 1040px
|
||||||
$font-family-sans-serif: 'EtelkaLightProRegular', Arial, Helvetica, sans-serif
|
$font-family-sans-serif: 'EtelkaLightProRegular', Arial, Helvetica, sans-serif
|
||||||
$font-family-serif: 'EtelkaLightProBold', Georgia, "Times New Roman", Times, serif
|
$font-family-serif: 'EtelkaLightProBold', Georgia, "Times New Roman", Times, serif
|
||||||
$font-size-h1: 26px
|
$font-size-h1: 26px
|
||||||
|
$navbar-default-link-active-color: #333
|
||||||
|
|
||||||
html
|
html
|
||||||
position: relative
|
position: relative
|
||||||
|
@ -30,6 +31,9 @@ hr
|
||||||
.no-border
|
.no-border
|
||||||
border: 0 !important
|
border: 0 !important
|
||||||
|
|
||||||
|
.navbar li
|
||||||
|
font-weight: bold
|
||||||
|
|
||||||
.footer
|
.footer
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 0
|
bottom: 0
|
||||||
|
|
|
@ -4,6 +4,7 @@ class Registrar::InvoicesController < RegistrarController
|
||||||
before_action :set_invoice, only: [:show]
|
before_action :set_invoice, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@invoices = current_user.registrar.invoices.includes(:invoice_items)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -650,3 +650,4 @@ en:
|
||||||
seller: 'Seller'
|
seller: 'Seller'
|
||||||
prepayment: 'Prepayment'
|
prepayment: 'Prepayment'
|
||||||
vat: 'VAT (%{vat_prc}%)'
|
vat: 'VAT (%{vat_prc}%)'
|
||||||
|
unpaid: 'Unpaid'
|
||||||
|
|
|
@ -13,7 +13,7 @@ class AddInvoiceColumns < ActiveRecord::Migration
|
||||||
add_column :invoices, :reference_no, :string
|
add_column :invoices, :reference_no, :string
|
||||||
add_column :invoices, :vat_prc, :decimal
|
add_column :invoices, :vat_prc, :decimal
|
||||||
#add_column :invoices, :total_sum, :decimal # calculate on the fly
|
#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
|
# seller info
|
||||||
# add_column :invoices, :sellable_id, :integer # EIS is actually a registrar itself and invoice can belong to EIS
|
# add_column :invoices, :sellable_id, :integer # EIS is actually a registrar itself and invoice can belong to EIS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue