X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FController%2FPayPostingImport.pm;fp=SL%2FController%2FPayPostingImport.pm;h=c8d39091d7d604af37b5e4aad8f42990ee2856c8;hp=03a44d0bb81b8900afce5098b2a5b0427a5c3c6b;hb=b293ff8ad52fc76ba0c44783e3982418114d6b08;hpb=d4925a8b60f04674885e30d9316dc0263f8b9a84 diff --git a/SL/Controller/PayPostingImport.pm b/SL/Controller/PayPostingImport.pm index 03a44d0bb..c8d39091d 100644 --- a/SL/Controller/PayPostingImport.pm +++ b/SL/Controller/PayPostingImport.pm @@ -28,7 +28,7 @@ sub action_import_datev_pay_postings { my $filename= $::form->{ATTACHMENTS}{file}{filename}; # check name and first fields of CSV data die t8("Wrong file name, expects name like: DTVF_*_LOHNBUCHUNG*.csv") unless $filename =~ /^DTVF_.*_LOHNBUCHUNGEN_LUG.*\.csv$/; - die t8("not a valid DTVF file, expected first field in A1 'DTVF'") unless ($::form->{file} =~ m/^"DTVF";/); + die t8("not a valid DTVF file, expected first field in A1 'DTVF'") unless ($::form->{file} =~ m/^('|")?DTVF/); die t8("not a valid DTVF file, expected field header start with 'Umsatz; (..) ;Konto;Gegenkonto'") unless ($::form->{file} =~ m/Umsatz;S\/H;;;;;Konto;Gegenkonto.*;;Belegdatum;Belegfeld 1;Belegfeld 2;;Buchungstext/); @@ -81,7 +81,9 @@ sub parse_and_import { # optional KOST1 - KOST2 ? $department_name = $row->[36]; - $department = SL::DB::Manager::Department->get_first(description => { like => $department_name . '%' }); + if ($department_name) { + $department = SL::DB::Manager::Department->get_first(where => [ description => { ilike => $department_name . '%' } ]); + } my $amount = $::form->parse_amount({ numberformat => '1000,00' }, $row->[0]);