Improve invoicing views

This commit is contained in:
Martin Lensment 2015-04-10 11:37:02 +03:00
parent d33d249e2d
commit 28d8aac65c
6 changed files with 34 additions and 15 deletions

View file

@ -12,6 +12,14 @@ class Invoice < ActiveRecord::Base
[buyer_street, buyer_city, buyer_state, buyer_zip].reject(&:blank?).compact.join(', ')
end
def seller_country
Country.new(seller_country_code)
end
def buyer_country
Country.new(buyer_country_code)
end
def items
invoice_items
end

View file

@ -1,3 +1,14 @@
.row
.col-sm-6
%h1.text-center-xs
= t('your_account')
.col-sm-6
%h1.text-right.text-center-xs
= link_to(t('add_deposit'), new_registrar_deposit_path, class: 'btn btn-default')
%hr
= t('your_current_credit_account_balance_is', balance: 1000.0)
%h1= t('invoices')
%hr
.table-responsive

View file

@ -10,11 +10,16 @@
%dt= t('address')
%dd= @invoice.buyer_address
%dt= t('phone')
%dd= @invoice.buyer_phone
%dt= t('country')
%dd= @invoice.buyer_country
%dt= t('url')
%dd= @invoice.buyer_url
- if @invoice.buyer_phone
%dt= t('phone')
%dd= @invoice.buyer_phone
- if @invoice.buyer_url
%dt= t('url')
%dd= @invoice.buyer_url
%dt= t('email')
%dd= @invoice.buyer_email

View file

@ -22,6 +22,9 @@
%dt= t('address')
%dd= @invoice.seller_address
%dt= t('country')
%dd= @invoice.seller_country
%dt= t('phone')
%dd= @invoice.seller_phone

View file

@ -7,14 +7,3 @@
.col-md-12= render 'registrar/invoices/partials/buyer'
.row
.col-md-12= render 'registrar/invoices/partials/items'
/ .row
/ .col-md-12= render 'admin/domains/partials/statuses'
/ .row
/ .col-md-12= render 'admin/domains/partials/nameservers'
/ .row
/ .col-md-12= render 'admin/domains/partials/dnskeys'
/ .row
/ .col-md-12= render 'admin/domains/partials/keyrelays'
/ .row
/ .col-md-12
/ = render 'admin/domains/partials/legal_documents', legal_documents: @domain.legal_documents

View file

@ -651,3 +651,6 @@ en:
prepayment: 'Prepayment'
vat: 'VAT (%{vat_prc}%)'
unpaid: 'Unpaid'
your_current_credit_account_balance_is: 'Your current credit account balance is %{balance} EUR'
accounting: 'Accounting'
your_account: 'Your account'