mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Add forms for adding bank transactions #2733
This commit is contained in:
parent
de082bb637
commit
55ecae3e28
7 changed files with 111 additions and 72 deletions
|
@ -34,7 +34,13 @@
|
|||
%dt= t(:import_file)
|
||||
%dd= link_to(t(:download), download_import_file_admin_bank_statement_path(@bank_statement))
|
||||
|
||||
%h2.text-center-xs= t(:bank_transactions)
|
||||
.row
|
||||
.col-sm-6
|
||||
%h3.text-center-xs
|
||||
= t(:bank_transactions)
|
||||
.col-sm-6.text-right
|
||||
%h3.text-right.text-center-xs
|
||||
= link_to(t(:add), new_admin_bank_statement_bank_transaction_path(@bank_statement), class: 'btn btn-primary')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
71
app/views/admin/bank_transactions/_form.haml
Normal file
71
app/views/admin/bank_transactions/_form.haml
Normal file
|
@ -0,0 +1,71 @@
|
|||
= form_for([:admin, @bank_statement, @bank_transaction], html: { class: 'form-horizontal' }) do |f|
|
||||
= render 'shared/full_errors', object: @bank_transaction
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
- if @bank_transaction.persisted?
|
||||
.form-group
|
||||
= f.label :status, class: 'col-md-4 control-label'
|
||||
- c = @bank_transaction.binded? ? 'text-success' : 'text-danger'
|
||||
.col-md-8.form-control-static{class: c}
|
||||
= @bank_transaction.binded? ? t(:binded) : t(:not_binded)
|
||||
|
||||
.form-group
|
||||
= f.label :description, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:description, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :sum, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:sum, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :reference_no, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:reference_no, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :document_no, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:document_no, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :bank_reference, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:bank_reference, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :iban, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:iban, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_bank_code, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:buyer_bank_code, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_iban, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:buyer_iban, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_name, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:buyer_name, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :currency, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:currency, class: 'form-control', readonly: true)
|
||||
|
||||
.form-group
|
||||
= f.label :paid_at, class: 'col-md-4 control-label'
|
||||
.col-md-8
|
||||
= f.text_field(:paid_at, class: 'form-control datepicker')
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
= button_tag(t(:save), class: 'btn btn-warning')
|
|
@ -2,73 +2,4 @@
|
|||
= link_to(t(:back), admin_bank_transaction_path(@bank_transaction), class: 'btn btn-default')
|
||||
= render 'shared/title', name: t(:bank_transaction)
|
||||
|
||||
= form_for([:admin, @bank_transaction], html: { class: 'form-horizontal' }) do |f|
|
||||
= render 'shared/full_errors', object: @bank_transaction
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
.form-group
|
||||
= f.label :status, class: 'col-md-2 control-label'
|
||||
- c = @bank_transaction.binded? ? 'text-success' : 'text-danger'
|
||||
.col-md-10.form-control-static{class: c}
|
||||
= @bank_transaction.binded? ? t(:binded) : t(:not_binded)
|
||||
|
||||
.form-group
|
||||
= f.label :description, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:description, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :sum, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:sum, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :reference_no, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:reference_no, class: 'form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :document_no, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:document_no, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :bank_reference, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:bank_reference, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :iban, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:iban, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_bank_code, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:buyer_bank_code, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_iban, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:buyer_iban, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :buyer_name, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:buyer_name, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :currency, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:currency, class: 'form-control', disabled: :disabled)
|
||||
|
||||
.form-group
|
||||
= f.label :paid_at, class: 'col-md-2 control-label'
|
||||
.col-md-10
|
||||
= f.text_field(:paid_at, class: 'form-control', disabled: :disabled)
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
= button_tag(t(:save), class: 'btn btn-primary')
|
||||
= render 'form'
|
||||
|
|
6
app/views/admin/bank_transactions/new.haml
Normal file
6
app/views/admin/bank_transactions/new.haml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:back), admin_bank_statement_path(@bank_statement), class: 'btn btn-default')
|
||||
|
||||
= render 'shared/title', name: t(:create_bank_transaction)
|
||||
|
||||
= render 'form'
|
Loading…
Add table
Add a link
Reference in a new issue