Abteilungsname für DATEV-Checks bei Einkaufsrechnungen setzen
authorJan Büren <jan@kivitendo-premium.de>
Wed, 2 Dec 2015 08:54:04 +0000 (09:54 +0100)
committerJan Büren <jan@kivitendo-premium.de>
Wed, 2 Dec 2015 09:02:23 +0000 (10:02 +0100)
If we filter DATEV transaction via department we need also a name for export.
At least if we have DATEV checks activated and force a valid department in
DATEV filter (currently customer extension)

SL/IR.pm

index fbff03e..55987af 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -800,6 +800,8 @@ SQL
 
   # safety check datev export
   if ($::instance_conf->get_datev_check_on_purchase_invoice) {
+    # if we need department for kostenstelle in DATEV check
+    $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id};
     my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
     $transdate  ||= DateTime->today;