X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=b25509ec6c0c8ddbd350f2791feaa12491b25329;hb=cdacfe1cb5156c4bde158f0592d1dd3c445be7dd;hp=07a6d2ec86e537dd6e3b510aa489f62905bc14c2;hpb=5eadc96699ee3f70f3a0bb3f473f3cfea7e8ea68;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 07a6d2ec8..b25509ec6 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -50,6 +50,7 @@ use POSIX qw(strftime); use SL::CT; use SL::CVar; +use SL::DB::Business; use SL::ReportGenerator; require "bin/mozilla/common.pl"; @@ -141,6 +142,14 @@ sub list_names { push @options, $locale->text('Billing/shipping address (zipcode)') . " : $form->{zipcode}" if $form->{addr_zipcode}; push @options, $locale->text('Billing/shipping address (street)') . " : $form->{street}" if $form->{addr_street}; + if ($form->{business_id}) { + my $business = SL::DB::Manager::Business->find_by(id => $form->{business_id}); + if ($business) { + my $label = $form->{IS_CUSTOMER} ? $::locale->text('Customer type') : $::locale->text('Vendor type'); + push @options, $label . " : " . $business->description; + } + } + my @columns = ( 'id', 'name', "$form->{db}number", 'contact', 'phone', 'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city', @@ -175,7 +184,14 @@ sub list_names { map { $column_defs{$_}->{visible} = $form->{"l_$_"} eq 'Y' } @columns; - my @hidden_variables = (qw(db status obsolete name contact email cp_name addr_city), "$form->{db}number", @searchable_custom_variables, map { "l_$_" } @columns); + my @hidden_variables = ( qw( + db status obsolete name contact email cp_name addr_street addr_zipcode + addr_city business_id + ), "$form->{db}number", + map({ "cvar_$_->{name}" } @searchable_custom_variables), + map({ "l_$_" } @columns), + ); + my @hidden_nondefault = grep({ $form->{$_} } @hidden_variables); my $callback = build_std_url('action=list_names', grep { $form->{$_} } @hidden_nondefault); $form->{callback} = "$callback&sort=" . E($form->{sort}) . "&sortdir=" . E($form->{sortdir}); @@ -208,6 +224,7 @@ sub list_names { 'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time), ); $report->set_options_from_form(); + $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; $report->set_columns(%column_defs); $report->set_column_order(@columns); @@ -289,7 +306,7 @@ sub form_header { taxzones => "ALL_TAXZONES"); $form->get_pricegroup(\%myconfig, { all => 1 }); - $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter; + $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter}; $form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; @@ -343,7 +360,7 @@ sub _do_save { $::form->isblank("name", $::locale->text("Name missing!")); - if ($::form->{new_salesman_id} && $::vertreter) { + if ($::form->{new_salesman_id} && $::lx_office_conf{features}->{vertreter}) { $::form->{salesman_id} = $::form->{new_salesman_id}; delete $::form->{new_salesman_id}; } @@ -597,9 +614,6 @@ sub delete { # /saving the history $form->redirect($locale->text($msg)); - $msg = "Cannot delete $form->{db}"; - $form->error($locale->text($msg)); - $main::lxdebug->leave_sub(); } @@ -703,7 +717,7 @@ sub delete_contact { CT->get_contact(\%myconfig, \%$form); unless ($form->{cp_used}) { - CT->delete_shipto($form->{cp_id}); + CT->delete_contact($form->{cp_id}); @$form{ grep /^cp_/, keys %$form } = undef; }