2012-04-20 18:33:47 +02:00
|
|
|
= simple_form_for([:finance, @invoice]) do |f|
|
2016-03-11 13:23:13 +01:00
|
|
|
- if @invoice.created_at
|
|
|
|
.fold-line
|
|
|
|
.control-group
|
|
|
|
%label.control-label{for: 'created_at'}
|
|
|
|
= Invoice.human_attribute_name(:created_at)
|
|
|
|
.controls.control-text#article_fc_price
|
|
|
|
= format_date @invoice.created_at
|
|
|
|
.control-group
|
|
|
|
%label.control-label{for: 'created_by'}
|
|
|
|
= Invoice.human_attribute_name(:created_by)
|
|
|
|
.controls.control-text#article_fc_price
|
|
|
|
= show_user @invoice.created_by
|
2016-02-25 13:16:48 +01:00
|
|
|
= f.association :supplier, collection: Supplier.order(:name), hint: false
|
2016-03-11 13:23:13 +01:00
|
|
|
- if Delivery.any?
|
|
|
|
= f.association :deliveries, collection: @deliveries_collection, input_html: {size: 10}, multiple: true, label_method: method(:format_delivery_item)
|
|
|
|
= f.association :orders, collection: @orders_collection, multiple: true, label_method: method(:format_order_item)
|
2012-04-20 18:33:47 +02:00
|
|
|
= f.input :number
|
2012-11-10 16:44:05 +01:00
|
|
|
= f.input :date, as: :date_picker
|
2016-02-17 21:07:35 +01:00
|
|
|
- if current_user.role_finance?
|
|
|
|
= f.input :paid_on, as: :date_picker
|
2012-04-20 18:33:47 +02:00
|
|
|
= f.input :amount, as: :string
|
|
|
|
= f.input :deposit, as: :string
|
|
|
|
= f.input :deposit_credit, as: :string
|
2017-10-12 20:50:40 +02:00
|
|
|
= render 'shared/custom_form_fields', f: f, type: :invoice
|
2016-05-06 15:04:58 +02:00
|
|
|
= f.input :attachment, as: :file, hint: t('.attachment_hint')
|
2016-05-06 15:56:26 +02:00
|
|
|
- if f.object.attachment_data.present?
|
|
|
|
= f.input :delete_attachment, as: :boolean
|
2012-04-20 18:33:47 +02:00
|
|
|
= f.input :note
|
2012-11-10 16:44:05 +01:00
|
|
|
.form-actions
|
|
|
|
= f.submit class: 'btn'
|
2013-04-04 02:49:52 +02:00
|
|
|
= link_to t('ui.or_cancel'), :back
|
2016-03-11 13:23:13 +01:00
|
|
|
|
|
|
|
= render :partial => 'form_js', :locals => {:invoice_id => invoice_id}
|