2022-03-29 13:17:36 +02:00
|
|
|
.row
|
2022-03-30 11:45:40 +02:00
|
|
|
.column.small-12
|
|
|
|
- show_generate_with_date = true
|
|
|
|
- order.group_orders.each do |go|
|
|
|
|
- if go.group_order_invoice.present?
|
|
|
|
- show_generate_with_date = false
|
|
|
|
- if show_generate_with_date
|
2022-03-30 15:49:53 +02:00
|
|
|
= form_for :group_order_invoice, url: url_for('group_order_invoice#create_multiple'), remote: true do |f|
|
2022-03-30 11:45:40 +02:00
|
|
|
= f.label :invoice_date, I18n.t('activerecord.attributes.group_order_invoice.links.invoice_date')
|
2022-03-30 15:49:53 +02:00
|
|
|
= f.date_field :invoice_date, {value: Date.today, max: Date.today, required: true}
|
2022-03-30 11:45:40 +02:00
|
|
|
= f.hidden_field :order_id, value: order.id
|
|
|
|
= f.submit I18n.t('activerecord.attributes.group_order_invoice.links.generate_with_date'), class: 'btn btn small'
|
2022-03-29 13:17:36 +02:00
|
|
|
|
2022-01-27 12:42:29 +01:00
|
|
|
- order.group_orders.includes([:group_order_invoice, :ordergroup]).each do |go|
|
|
|
|
.row
|
|
|
|
.column.small-3
|
2021-12-23 01:51:44 +01:00
|
|
|
= label_tag go.ordergroup.name
|
2022-01-27 12:42:29 +01:00
|
|
|
- if go.group_order_invoice
|
|
|
|
.column.small-3
|
2021-12-23 01:51:44 +01:00
|
|
|
= link_to I18n.t('activerecord.attributes.group_order_invoice.links.download'), group_order_invoice_path(go.group_order_invoice, :format => 'pdf'), class: 'btn btn-small'
|
2022-01-27 12:42:29 +01:00
|
|
|
.column.small-3
|
2021-12-23 01:51:44 +01:00
|
|
|
= link_to I18n.t('activerecord.attributes.group_order_invoice.links.delete'), go.group_order_invoice, method: :delete, class: 'btn btn-danger btn-small', remote: true
|
2022-01-27 12:42:29 +01:00
|
|
|
- else
|
|
|
|
= button_to I18n.t('activerecord.attributes.group_order_invoice.links.generate'), group_order_invoices_path(:method => :post, group_order: go) ,class: 'btn btn-small', params: {id: order.id}, remote: true
|
2021-12-23 01:51:44 +01:00
|
|
|
|