X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fpay_posting_import%2Fdatev_import.t;fp=t%2Fpay_posting_import%2Fdatev_import.t;h=91934de9059b9996aacaeb46549008b9c675b66f;hb=b293ff8ad52fc76ba0c44783e3982418114d6b08;hp=0afff356c907e784320ca67efc681f2cee892faa;hpb=d4925a8b60f04674885e30d9316dc0263f8b9a84;p=kivitendo-erp.git diff --git a/t/pay_posting_import/datev_import.t b/t/pay_posting_import/datev_import.t index 0afff356c..91934de90 100644 --- a/t/pay_posting_import/datev_import.t +++ b/t/pay_posting_import/datev_import.t @@ -18,7 +18,7 @@ Support::TestSetup::login(); my $dbh = SL::DB->client->dbh; my @charts = qw(379000 136900 372000 372500 373000 374000 377000 494700); local $::locale = Locale->new('en'); -diag("init csv"); +note("init csv"); clear_up(); # datev naming convention and expected filename entry in $::form @@ -50,6 +50,23 @@ foreach my $accno (@charts) { } # and add department (KOST1 description) + SL::DB::Department->new( + description => 'Total falsche Abteilung, niemals zuordnen!' + )->save; + + SL::DB::Department->new( + description => '2. Total falsche Abteilung, niemals zuordnen!' + )->save; + + SL::DB::Department->new( + description => '3. Total falsche Abteilung, niemals zuordnen!' + )->save; + + SL::DB::Department->new( + description => 'annahme stelle. Total falsche Abteilung, niemals zuordnen!' + )->save; + + SL::DB::Department->new( description => 'Wisavis' )->save; @@ -73,7 +90,14 @@ foreach my $booking (@{ $gl_bookings }) { # gl is ($current_row->[13], $booking->reference, "Buchungstext correct"); - is ("Wisavis", $booking->department->description, "Department correctly assigned"); + if ($current_row->[36] eq 'wisavis') { + is(ref $booking->department eq 'SL::DB::Department', 1, "Department assigned"); + is ($current_row->[36], 'wisavis', "Department correctly assigned"); # lowercase + is ('Wisavis', $booking->department->description, "Department correctly assigned"); # upper case + } else { + is ($current_row->[36], '', "No Department correctly assigned"); + + } is ($source, $booking->transactions->[0]->source, "Source 0 correctly assigned"); is ($source, $booking->transactions->[1]->source, "Source 1 correctly assigned");