X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FIR.pm;h=45cd7de7d3f514205a281aebaade6f7571405928;hb=e713c3142d8c603b31d25fff371da47f56976aae;hp=a424ab99083b8a9334a193779adbace2050d2af1;hpb=c954dea7c1b814d66b8c31d04fa70a1bbbcce71e;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index a424ab990..45cd7de7d 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -50,6 +50,7 @@ use SL::MoreCommon; use SL::DB::Default; use SL::DB::TaxZone; use SL::DB; +use SL::Presenter::Part qw(type_abbreviation classification_abbreviation); use List::Util qw(min); use strict; @@ -817,19 +818,13 @@ 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; my $datev = SL::DATEV->new( - exporttype => DATEV_ET_BUCHUNGEN, - format => DATEV_FORMAT_KNE, dbh => $dbh, trans_id => $form->{id}, ); - $datev->export; + $datev->generate_datev_data; if ($datev->errors) { die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors; @@ -1315,8 +1310,8 @@ sub retrieve_item { if (($::form->{"partnumber_$i"} ne '') && ($ref->{ean} eq $::form->{"partnumber_$i"})) { push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean}; } - $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}). - $::request->presenter->classification_abbreviation($ref->{classification_id}); + $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) . + classification_abbreviation($ref->{classification_id}); if (! $ref->{used_for_purchase} ) { $has_wrong_pclass = PCLASS_NOTFORPURCHASE; @@ -1453,6 +1448,13 @@ sub vendor_details { 'trans_id' => $form->{vendor_id}); map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables }; + if ($form->{cp_id}) { + $custom_variables = CVar->get_custom_variables(dbh => $dbh, + module => 'Contacts', + trans_id => $form->{cp_id}); + $form->{"cp_cvar_$_->{name}"} = $_->{value} for @{ $custom_variables }; + } + $form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh, 'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'), 'allow_fallback' => 1);