Skip to content

Commit 42ceec8

Browse files
anna-devKagemaru
authored andcommitted
Adjust invoice reports csv (644449
1 parent b0dcbf1 commit 42ceec8

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

app/domain/invoice/report/csv.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
class Invoice
99
class Report
1010
class Csv
11-
include FormatHelper
12-
1311
attr_reader :report
1412

1513
def initialize(report)
@@ -36,7 +34,7 @@ def header
3634

3735
def row(e)
3836
[e.reference, client(e), e.period, e.billing_date, e.due_date, format_invoice_status(e.status),
39-
e.total_amount, e.total_hours, e.order.department, e.order.responsible, f(e.manual_invoice?)]
37+
e.total_amount, e.total_hours, e.order.department, e.order.responsible, I18n.t("global.#{e.manual_invoice?}")]
4038
end
4139

4240
def client(entry)

app/helpers/format_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def f(value)
2323
number_with_delimiter(value, delimiter: t('number.format.delimiter').html_safe)
2424
when Date then l(value, format: :long)
2525
when Time then "#{l(value.to_date)} #{l(value, format: :time)}"
26-
when true then I18n.t('global.yes')
27-
when false then I18n.t('global.no')
26+
when true then t('global.yes')
27+
when false then t('global.no')
2828
when nil then UtilityHelper::EMPTY_STRING
2929
when ActiveRecord::Base then assoc_link(value)
3030
else value.to_s

test/controllers/invoice_reports_controller_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ class InvoiceReportsControllerTest < ActionController::TestCase
1111
setup :login
1212

1313
test 'GET index csv exports csv file' do
14-
get :index, params: { responsible_id: employees(:lucien).id }, format: :csv
14+
get :index, format: :csv
1515

1616
assert_match(%r{Referenz,Kunde / Auftrag,Leistungsperiode,Rechnungsdatum,Fälligkeitsdatum,Status,Rechnungsbetrag,Total Stunden,OE,Verantwortlich,Manuell}, response.body)
17+
assert_match(/Swisstopo\nSTOP-WEB: Webauftritt",01.12.2006 - 31.12.2006,2015-06-15,2015-07-14,Entwurf,40000.45,50.0,devone,Neverends John,nein/, response.body)
1718
end
1819
end

0 commit comments

Comments
 (0)