use Test::Deep qw(cmp_bag);
use lib 't';
+use utf8;
use_ok 'Support::TestSetup';
use SL::DATEV qw(:CONSTANTS);
$datev1->generate_datev_data;
-cmp_bag $datev1->generate_datev_lines, [
+my @data_datev = sort { $a->{umsatz} <=> $b->{umsatz} } @{ $datev1->generate_datev_lines() };
+cmp_bag \@data_datev, [
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
'buchungstext' => 'Testcustomer',
'datum' => '01.01.2017',
'gegenkonto' => '8400',
'soll_haben_kennzeichen' => 'S',
},
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
'buchungstext' => 'Testcustomer',
'datum' => '01.01.2017',
'gegenkonto' => '8300',
'soll_haben_kennzeichen' => 'S',
},
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
+ 'buchungstext' => 'Testcustomer',
'buchungstext' => 'Testcustomer',
'datum' => '05.01.2017',
'gegenkonto' => '1400',
$datev1->generate_datev_data;
cmp_bag $datev1->generate_datev_lines, [
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
'buchungstext' => 'Testcustomer',
'datum' => '01.01.2017',
'gegenkonto' => '8400',
'soll_haben_kennzeichen' => 'S',
},
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
'buchungstext' => 'Testcustomer',
'datum' => '01.01.2017',
'gegenkonto' => '8300',
'soll_haben_kennzeichen' => 'S',
},
{
- 'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
+ 'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
'buchungstext' => 'Testcustomer',
'datum' => '05.01.2017',
'gegenkonto' => $customer->customernumber,
# splice away the header, because sort won't do
# we need sort, because pay_invoice is not acc_trans_id order safe
my @data_csv = splice @{ $datev1->csv_buchungsexport() }, 2, 5;
-@data_csv = sort { $a->[0] <=> $b->[0] } @data_csv;
+@data_csv = sort { $a->[0] cmp $b->[0] } @data_csv;
my $cp1252_belegfeld1 = SL::Iconv::convert("UTF-8", "CP1252", 'Þ sales ¥& i');
my $cp1252_buchungstext = SL::Iconv::convert("UTF-8", "CP1252", 'Þ sales ¥& invöice');