2d0c163f13
see https://github.com/foodcoops/foodsoft/pull/907 for reference and original work by viehlieb Co-authored-by: viehlieb <pf@pragma-shift.net> fix PDF Pdf make explicit deposit in invoices work add ordergroupname to invoice file name mark bold sum for vat exempt foodcoops download multiple group order invoice as zip
29 lines
1.7 KiB
Text
29 lines
1.7 KiB
Text
.row
|
|
.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
|
|
= form_for :group_order_invoice, url: url_for('group_order_invoice#create_multiple'), remote: true do |f|
|
|
= f.label :invoice_date, I18n.t('activerecord.attributes.group_order_invoice.links.invoice_date')
|
|
= f.date_field :invoice_date, {value: Date.today, max: Date.today, required: true}
|
|
= 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'
|
|
|
|
- order.group_orders.includes([:group_order_invoice, :ordergroup]).each do |go|
|
|
.row
|
|
.column.small-3
|
|
= label_tag go.ordergroup.name
|
|
- if go.group_order_invoice
|
|
.column.small-3
|
|
= 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'
|
|
.column.small-3
|
|
= 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
|
|
- 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
|
|
- if order.group_orders.map(&:group_order_invoice).compact.present?
|
|
%br/
|
|
.row
|
|
.column.small-3
|
|
= link_to I18n.t('activerecord.attributes.group_order_invoice.links.download_all_zip'), download_all_group_order_invoices_path(order), class: 'btn btn-small'
|