Issue invoices via admin #2566

This commit is contained in:
Martin Lensment 2015-06-26 17:26:47 +03:00
parent 4569cc11cd
commit 935c547016
8 changed files with 86 additions and 9 deletions

View file

@ -1,7 +1,7 @@
.row
.col-sm-12
%h2.text-center-xs= t(:invoices)
%hr
- content_for :actions do
= link_to(t(:add), new_admin_invoice_path, class: 'btn btn-primary')
= render 'shared/title', name: t(:invoices)
.row
.col-md-12
.table-responsive

View file

@ -0,0 +1,33 @@
- content_for :actions do
= link_to(t(:back), admin_invoices_path, class: 'btn btn-default')
= render 'shared/title', name: t(:create_new_invoice)
= form_for([:admin, @deposit], url: admin_invoices_path, method: :post, html: { class: 'form-horizontal' }) do |f|
= render 'shared/full_errors', object: @deposit
.row
.col-md-8
.form-group
.col-md-4.control-label
= f.label :registrar_id, class: 'required'
.col-md-8
= f.select :registrar_id, Registrar.all.map { |r| [r.name, r.id] }, { include_blank: true }, class: 'form-control selectize', required: true
.form-group
.col-md-4.control-label
= f.label :amount, class: 'required'
.col-md-8
.input-group
= f.text_field :amount, class: 'form-control', required: true
.input-group-addon
EUR
.form-group
.col-md-4.control-label
= f.label :description
.col-md-8
= f.text_area :description, class: 'form-control'
%hr
.row
.col-md-8.text-right
= button_tag(t(:add), class: 'btn btn-warning')

View file

@ -5,7 +5,7 @@
.col-sm-6
%h1.text-right.text-center-xs
- if !@invoice.cancelled? && !@invoice.binded?
= link_to(t(:cancel), cancel_admin_invoice_path(@invoice), method: :patch, class: 'btn btn-default')
= link_to(t(:cancel), cancel_admin_invoice_path(@invoice), method: :patch, class: 'btn btn-warning')
= link_to(t(:back), admin_invoices_path, class: 'btn btn-default')
%hr
= render 'shared/full_errors', object: @invoice