add functionality in views and controllers for generation of group order invoices

This commit is contained in:
Viehlieb 2021-12-23 01:51:44 +01:00
parent 817c680c28
commit 50017fefa8
8 changed files with 41 additions and 4 deletions

View file

@ -0,0 +1,11 @@
.row
- order.group_orders.includes([:group_order_invoice, :ordergroup]).each do |go|
.row
= label_tag go.ordergroup.name
- if go.group_order_invoice
= 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'
= 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
%br

View file

@ -0,0 +1 @@
$("#generate-invoice<%= params[:id] %>").html("<%= escape_javascript(render partial: 'links', locals: {order: @order}) %>");

View file

@ -0,0 +1 @@
$("#generate-invoice<%= @order.id %>").html("<%= escape_javascript(render partial: 'links', locals: {order: @order}) %>");

View file

@ -0,0 +1 @@
pdf.text "Hello World"