OrderController: reorder mit Sort::Naturally damit nach Preis ordentlich
[kivitendo-erp.git] / t / datev / datev_format_2018.t
index 6f86dfe..77a800e 100644 (file)
@@ -19,6 +19,10 @@ Support::TestSetup::login();
 my $dbh = SL::DB->client->dbh;
 
 clear_up();
+
+my $d = SL::DB::Default->get;
+$d->update_attributes(datev_export_format => 'cp1252');
+
 my $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || die "No accounting group for 7\%";
 my $date            = DateTime->new(year => 2017, month =>  7, day => 19);
 my $department      = create_department(description => 'Kästchenweiße heiße Preise');
@@ -145,7 +149,7 @@ ok(scalar @{ $datev_csv4->warnings } == 0, 'no warnings');
 my @sorted =  sort { $a->[0] cmp $b->[0] } @{ $lines_aref };
 cmp_deeply $sorted[0],    [ '1963,5', 'S', 'EUR', '', '', '',
                             '1400', '8400', '', '1907', 'meine muh',
-                            '', '', '', '', '', '', '', '', '',
+                            '', '', 'Test customer', '', '', '', '', '', '',
                             '', '', '', '', '', '', '', '', '',
                             '', '', '', '', '', '', '', "K\x{e4}stchen",
                             '299', '','DE12345678', '', '', '',
@@ -161,7 +165,7 @@ cmp_deeply $sorted[0],    [ '1963,5', 'S', 'EUR', '', '', '',
                           ];
 cmp_deeply $sorted[1],     [ '535', 'S', 'EUR', '', '', '',
                              '1400', '8300', '', '1907','meine muh',
-                            '', '', '', '', '', '', '', '', '',
+                            '', '', 'Test customer', '', '', '', '', '', '',
                             '', '', '', '', '', '', '', '', '',
                             '', '', '', '', '', '', '', "K\x{e4}stchen",
                             '299', '','DE12345678', '', '', '',
@@ -235,7 +239,6 @@ my $datev2 = SL::DATEV->new(
 $datev2->from($startdate);
 $datev2->to($enddate);
 $datev2->generate_datev_data;
-$datev2->generate_datev_lines;
 
 my $datev_csv3  = SL::DATEV::CSV->new(datev_lines  => $datev2->generate_datev_lines,
                                       from         => $startdate,
@@ -244,8 +247,8 @@ my $datev_csv3  = SL::DATEV::CSV->new(datev_lines  => $datev2->generate_datev_li
                                      );
 
 my @data_csv    = sort { $a->[0] cmp $b->[0] } @{ $datev_csv3->lines };
-cmp_deeply($data_csv[0], [ 100, 'S', 'EUR', '', '', '', '4660', '1000', 9, '1703', 'Reise März 2',
-                     '', '', '', '', '', '', '', '', '', '', '',
+cmp_deeply($data_csv[0], [ '100', 'S', 'EUR', '', '', '', '4660', '1000', 9, '1703', 'Reise März 2',
+                     '', '', 'Reisekonsten März 2018 / Ma Schmidt', '', '', '', '', '', '', '', '',
                      '', '', '', '', '', '', '', '', '', '', '', '', '',
                      '', '', '', '', '', '', '', '', '', '', '',
                      '', '', '', '', '', '', '', '', '', '', '', '', '',