mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Show real balance in invoices view
This commit is contained in:
parent
8768c0e1d6
commit
99aecc476f
5 changed files with 14 additions and 3 deletions
|
@ -13,6 +13,11 @@ class Invoice < ActiveRecord::Base
|
||||||
account_activity.present?
|
account_activity.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def paid_at
|
||||||
|
# TODO: Cache this?
|
||||||
|
account_activity.try(:bank_transaction).try(:paid_at)
|
||||||
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
I18n.t('invoice_no', no: id)
|
I18n.t('invoice_no', no: id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
= link_to(t('add_deposit'), new_registrar_deposit_path, class: 'btn btn-default')
|
= link_to(t('add_deposit'), new_registrar_deposit_path, class: 'btn btn-default')
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
= t('your_current_credit_account_balance_is', balance: 1000.0)
|
= t('your_current_account_balance_is', balance: current_user.registrar.cash_account.balance)
|
||||||
|
|
||||||
%h1= t('invoices')
|
%h1= t('invoices')
|
||||||
%hr
|
%hr
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
%dt= t('due_date')
|
%dt= t('due_date')
|
||||||
%dd= l(@invoice.due_date)
|
%dd= l(@invoice.due_date)
|
||||||
|
|
||||||
|
%dt= t('paid_at')
|
||||||
|
- if @invoice.paid_at
|
||||||
|
%dd= l(@invoice.paid_at)
|
||||||
|
- else
|
||||||
|
%dd{class: 'text-danger'}= t('unpaid')
|
||||||
|
|
||||||
%dt= t('payment_term')
|
%dt= t('payment_term')
|
||||||
%dd= t(@invoice.payment_term)
|
%dd= t(@invoice.payment_term)
|
||||||
|
|
||||||
|
|
|
@ -652,7 +652,7 @@ en:
|
||||||
prepayment: 'Prepayment'
|
prepayment: 'Prepayment'
|
||||||
vat: 'VAT (%{vat_prc}%)'
|
vat: 'VAT (%{vat_prc}%)'
|
||||||
unpaid: 'Unpaid'
|
unpaid: 'Unpaid'
|
||||||
your_current_credit_account_balance_is: 'Your current credit account balance is %{balance} EUR'
|
your_current_account_balance_is: 'Your current account balance is %{balance} EUR'
|
||||||
billing: 'Billing'
|
billing: 'Billing'
|
||||||
your_account: 'Your account'
|
your_account: 'Your account'
|
||||||
pay_by_bank_link: 'Pay by bank link'
|
pay_by_bank_link: 'Pay by bank link'
|
||||||
|
|
|
@ -24,7 +24,7 @@ feature 'Invoices', type: :feature do
|
||||||
click_link 'Billing'
|
click_link 'Billing'
|
||||||
|
|
||||||
current_path.should == '/registrar/invoices'
|
current_path.should == '/registrar/invoices'
|
||||||
page.should have_text('Your current credit account balance is')
|
page.should have_text('Your current account balance is')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should get domains index page' do
|
it 'should get domains index page' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue