From a699f959035d1e125a14d3aa20407292c77380f6 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 2 Sep 2014 15:47:01 +0200 Subject: [PATCH] fix fax documents for stock orders (closes foodcoops#79) --- app/views/orders/show.html.haml | 3 ++- lib/order_csv.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index b3be5bde..f554bb10 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -55,7 +55,8 @@ %li= order_pdf(@order, :articles, t('.download.article_pdf')) %li= order_pdf(@order, :matrix, t('.download.matrix_pdf')) %li= order_pdf(@order, :fax, t('.download.fax_pdf')) - %li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')} + - unless @order.stockit? + %li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')} %li= link_to t('.download.fax_csv'), order_path(@order, format: :csv), {title: t('.download.download_file')} - if @order.open? diff --git a/lib/order_csv.rb b/lib/order_csv.rb index 4a3114bb..d2c458c2 100644 --- a/lib/order_csv.rb +++ b/lib/order_csv.rb @@ -20,7 +20,7 @@ class OrderCsv < RenderCSV oa.article.order_number, oa.article.name, oa.article.unit + (oa.price.unit_quantity > 1 ? " × #{oa.price.unit_quantity}" : ''), - number_to_currency(oa.article_price.price * oa.article_price.unit_quantity), + number_to_currency(oa.article.price * oa.article.unit_quantity), number_to_currency(oa.total_price) ] end