X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCT.pm;h=cae50f0fba7e18e7111a8e7522e670c77f7579eb;hb=e90048c8180f32f52f3f12ee52eb7269c4b27fcf;hp=66b3e25b7042f09e368fb9d9e4ab9a3a98d7fa45;hpb=82053b457be3de2ee5285dc13633222f4d30802c;p=kivitendo-erp.git diff --git a/SL/CT.pm b/SL/CT.pm index 66b3e25b7..cae50f0fb 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -42,6 +42,7 @@ use Data::Dumper; use SL::Common; use SL::CVar; use SL::DBUtils; +use SL::DB::Default; use SL::FU; use SL::Notes; use SL::TransNumber; @@ -633,6 +634,7 @@ sub search { "zipcode" => "ct.zipcode", "city" => "ct.city", "country" => "ct.country", + "discount" => "ct.discount", "salesman" => "e.name" ); @@ -648,7 +650,7 @@ sub search { } my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; - if ($sortorder !~ /(business|id)/ && !$join_records) { + if ($sortorder !~ /(business|id|discount)/ && !$join_records) { $sortorder = "lower($sortorder) ${sortdir}"; } else { $sortorder .= " ${sortdir}"; @@ -1080,6 +1082,10 @@ sub parse_excel_file { my ($self, $myconfig, $form) = @_; my $locale = $main::locale; + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; + $form->{formname} = 'sales_quotation'; $form->{type} = 'sales_quotation'; $form->{format} = 'excel'; @@ -1122,8 +1128,6 @@ sub parse_excel_file { $form->{notes} =~ s/^\s+//g; - $form->{templates} = $myconfig->{templates}; - delete $form->{printer_command}; $form->get_employee_info($myconfig);