Manual invoice binding improvement #2733

This commit is contained in:
Martin Lensment 2015-07-15 11:30:14 +03:00
parent 194a551203
commit 1142b1dfc7
6 changed files with 45 additions and 4 deletions

View file

@ -13,6 +13,31 @@
= f.label :iban
.col-md-8
= f.text_field(:iban, class: 'form-control')
- if @invoice
%hr
%h4= t('bank_transaction')
%hr
= f.fields_for :bank_transactions, [@bank_transaction] do |x|
.row
.col-md-8
.form-group
= x.label :description, class: 'col-md-4 control-label required'
.col-md-8
= x.text_field(:description, class: 'form-control', required: true)
.form-group
= x.label :sum, class: 'col-md-4 control-label required'
.col-md-8
= x.text_field(:sum, class: 'form-control', required: true)
.form-group
= x.label :reference_no, class: 'col-md-4 control-label required'
.col-md-8
= x.text_field(:reference_no, class: 'form-control', required: true)
.form-group
= x.label :paid_at, class: 'col-md-4 control-label required'
.col-md-8
= x.text_field(:paid_at, class: 'form-control datepicker', required: true)
%hr
.row
.col-md-8.text-right

View file

@ -1,5 +1,6 @@
- content_for :actions do
= link_to(t(:back), admin_bank_statement_path(@bank_statement), class: 'btn btn-default')
- if @bank_statement.persisted?
= link_to(t(:back), admin_bank_statement_path(@bank_statement), class: 'btn btn-default')
= render 'shared/title', name: t(:create_bank_transaction)

View file

@ -1,9 +1,11 @@
.row
.col-sm-6
.col-sm-4
%h1.text-center-xs
= @invoice
.col-sm-6
.col-sm-8
%h1.text-right.text-center-xs
- unless @invoice.binded?
= link_to(t(:payment_received), new_admin_bank_statement_path(invoice_id: @invoice.id), class: 'btn btn-default')
= link_to(t(:download), admin_invoice_download_pdf_path(@invoice), class: 'btn btn-default')
= link_to(t(:forward), admin_invoice_forward_path(@invoice), class: 'btn btn-default')
- if !@invoice.cancelled? && !@invoice.binded?