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:
viehlieb 2023-02-14 16:51:22 +01:00 committed by Philipp Rothmann
parent caa32de30c
commit 895589c03d
13 changed files with 111 additions and 17 deletions

View file

@ -155,4 +155,16 @@ module OrdersHelper
class: "btn#{' btn-success' unless order.received?} #{options[:class]}"
end
end
def custom_csv_collection
[
OrderArticle.human_attribute_name(:units_to_order),
Article.human_attribute_name(:order_number),
Article.human_attribute_name(:name),
Article.human_attribute_name(:unit),
Article.human_attribute_name(:unit_quantity_short),
ArticlePrice.human_attribute_name(:price),
OrderArticle.human_attribute_name(:total_price)
]
end
end