From 273659cc031b9be0c79fe199f4ec76c7bb44ac26 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Jun 2017 08:08:57 +0200 Subject: [PATCH] Bug 8612: [QA Follow-up] Remove two newlines from template output When using the Default profile from the basket form, the resulting csv file has an additional newline after the headers and at the end. This patch removes them. Unit test adjusted accordingly. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt | 5 +++-- t/db_dependent/Acquisition/GetBasketAsCSV.t | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt index 0ca6a8425a..6ee81aa2c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt @@ -1,3 +1,4 @@ [% INCLUDE csv_headers/acqui/basket.tt %] -[% FOREACH r IN rows %]"[% r.contractname %]",[% r.ordernumber %],[% r.entrydate %],[% r.isbn %],"[% r.author %]","[% r.title %]",[% r.publicationyear %],"[% r.publishercode %]","[% r.collectiontitle %]","[% r.notes %]",[% r.quantity %],[% r.rrp %],"[% r.deliveryplace %]","[% r.billingplace %]" -[% END %] +[%- FOREACH r IN rows -%] +"[% r.contractname %]",[% r.ordernumber %],[% r.entrydate %],[% r.isbn %],"[% r.author %]","[% r.title %]",[% r.publicationyear %],"[% r.publishercode %]","[% r.collectiontitle %]","[% r.notes %]",[% r.quantity %],[% r.rrp %],"[% r.deliveryplace %]","[% r.billingplace %]" +[% END -%] diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index b6dfdbef80..33e6f163ef 100644 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -72,9 +72,7 @@ is($basket_csv1, 'autor,title,quantity # Use default template my $basket_csv2 = C4::Acquisition::GetBasketAsCSV($basketno, $query); is($basket_csv2, 'Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher,Collection title,Note for vendor,Quantity,RRP,Delivery place,Billing place - "",' . $order->{ordernumber} . ',2016-01-02,,"King, Stephen","Test Record",,"","","",3,,"","" - ', 'CSV should be generated with default template'); my $basket_csv3 = C4::Acquisition::GetBasketAsCSV($basketno, $query, $csv_profile2->export_format_id); -- 2.39.5