Revision 1e30359a
Von Jan Büren vor etwa 7 Jahren hinzugefügt
t/datev/invoices.t | ||
---|---|---|
3 | 3 |
use Test::Deep qw(cmp_bag); |
4 | 4 |
|
5 | 5 |
use lib 't'; |
6 |
use utf8; |
|
6 | 7 |
|
7 | 8 |
use_ok 'Support::TestSetup'; |
8 | 9 |
use SL::DATEV qw(:CONSTANTS); |
... | ... | |
62 | 63 |
|
63 | 64 |
$datev1->generate_datev_data; |
64 | 65 |
|
65 |
cmp_bag $datev1->generate_datev_lines, [ |
|
66 |
my @data_datev = sort { $a->{umsatz} <=> $b->{umsatz} } @{ $datev1->generate_datev_lines() }; |
|
67 |
cmp_bag \@data_datev, [ |
|
66 | 68 |
{ |
67 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
|
|
69 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
|
|
68 | 70 |
'buchungstext' => 'Testcustomer', |
69 | 71 |
'datum' => '01.01.2017', |
70 | 72 |
'gegenkonto' => '8400', |
... | ... | |
76 | 78 |
'soll_haben_kennzeichen' => 'S', |
77 | 79 |
}, |
78 | 80 |
{ |
79 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
|
|
81 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
|
|
80 | 82 |
'buchungstext' => 'Testcustomer', |
81 | 83 |
'datum' => '01.01.2017', |
82 | 84 |
'gegenkonto' => '8300', |
... | ... | |
88 | 90 |
'soll_haben_kennzeichen' => 'S', |
89 | 91 |
}, |
90 | 92 |
{ |
91 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"), |
|
93 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice", |
|
94 |
'buchungstext' => 'Testcustomer', |
|
92 | 95 |
'buchungstext' => 'Testcustomer', |
93 | 96 |
'datum' => '05.01.2017', |
94 | 97 |
'gegenkonto' => '1400', |
... | ... | |
105 | 108 |
$datev1->generate_datev_data; |
106 | 109 |
cmp_bag $datev1->generate_datev_lines, [ |
107 | 110 |
{ |
108 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
|
|
111 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
|
|
109 | 112 |
'buchungstext' => 'Testcustomer', |
110 | 113 |
'datum' => '01.01.2017', |
111 | 114 |
'gegenkonto' => '8400', |
... | ... | |
117 | 120 |
'soll_haben_kennzeichen' => 'S', |
118 | 121 |
}, |
119 | 122 |
{ |
120 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
|
|
123 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
|
|
121 | 124 |
'buchungstext' => 'Testcustomer', |
122 | 125 |
'datum' => '01.01.2017', |
123 | 126 |
'gegenkonto' => '8300', |
... | ... | |
129 | 132 |
'soll_haben_kennzeichen' => 'S', |
130 | 133 |
}, |
131 | 134 |
{ |
132 |
'belegfeld1' => Encode::decode('utf-8', "Þ sales ¥& invöice"),
|
|
135 |
'belegfeld1' => "\x{de} sales \x{a5}& inv\x{f6}ice",
|
|
133 | 136 |
'buchungstext' => 'Testcustomer', |
134 | 137 |
'datum' => '05.01.2017', |
135 | 138 |
'gegenkonto' => $customer->customernumber, |
... | ... | |
154 | 157 |
# splice away the header, because sort won't do |
155 | 158 |
# we need sort, because pay_invoice is not acc_trans_id order safe |
156 | 159 |
my @data_csv = splice @{ $datev1->csv_buchungsexport() }, 2, 5; |
157 |
@data_csv = sort { $a->[0] <=> $b->[0] } @data_csv;
|
|
160 |
@data_csv = sort { $a->[0] cmp $b->[0] } @data_csv;
|
|
158 | 161 |
|
159 | 162 |
my $cp1252_belegfeld1 = SL::Iconv::convert("UTF-8", "CP1252", 'Þ sales ¥& i'); |
160 | 163 |
my $cp1252_buchungstext = SL::Iconv::convert("UTF-8", "CP1252", 'Þ sales ¥& invöice'); |
Auch abrufbar als: Unified diff
DATEV-Tests auch sauber für perl 5.22