feat(order): export order to custom csv file
add custom_csv_collection to orders helper add rute and controller method to orders controller add custom csv to download dropdown add functionality to choose column headers + order for custom csv and append order.sum gross&net to custom csv
This commit is contained in:
parent
4b5775e107
commit
d81ae10dc8
13 changed files with 111 additions and 17 deletions
15
app/views/orders/_custom_csv_form.html.haml
Normal file
15
app/views/orders/_custom_csv_form.html.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
= simple_form_for :custom_csv,format: :csv, :url => order_path(@order, view: @view, format: :csv), method: :get do |f|
|
||||
.modal-header
|
||||
= close_button :modal
|
||||
.h3=I18n.t('.orders.custom_csv.description')
|
||||
.modal-body
|
||||
= f.input :first, as: :select, collection: custom_csv_collection, label: "1. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :second, as: :select, collection: custom_csv_collection, required: false, label: "2. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :third, as: :select, collection: custom_csv_collection, required: false, label: "3. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :fourth, as: :select, collection: custom_csv_collection, required: false, label: "4. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :fifth, as: :select, collection: custom_csv_collection, required: false, label: "5. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :sixth, as: :select, collection: custom_csv_collection, required: false, label: "6. " + I18n.t('.orders.custom_csv.column')
|
||||
= f.input :seventh, as: :select, collection: custom_csv_collection, required: false, label: "7. " + I18n.t('.orders.custom_csv.column')
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit class: 'btn btn-primary'
|
||||
3
app/views/orders/custom_csv.js.haml
Normal file
3
app/views/orders/custom_csv.js.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$('#modalContainer').html('#{j(render("custom_csv_form"))}');
|
||||
$('#modalContainer').modal();
|
||||
$('#modalContainer').submit(function() {$('#modalContainer').modal('hide');});
|
||||
|
|
@ -10,3 +10,4 @@
|
|||
- unless order.stockit?
|
||||
%li= link_to t('.fax_txt'), order_path(order, format: :txt), {title: t('.download_file')}
|
||||
%li= link_to t('.fax_csv'), order_path(order, format: :csv), {title: t('.download_file')}
|
||||
%li= link_to t('.custom_csv'), custom_csv_order_path(order), remote: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue