X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fvk.pl;h=8a0dc463a2b13e922f132770ebe10ab4f7c500d2;hb=bee7d33fe47d29afeb4432b222fb1bf90c19e517;hp=59ba7b42060084add1ba6337d22a600586cb1a00;hpb=df41380a9c1150938985322c48ef20fe7f2cd98b;p=kivitendo-erp.git diff --git a/bin/mozilla/vk.pl b/bin/mozilla/vk.pl index 59ba7b420..8a0dc463a 100644 --- a/bin/mozilla/vk.pl +++ b/bin/mozilla/vk.pl @@ -36,12 +36,12 @@ use POSIX qw(strftime); use List::Util qw(sum first); use SL::AM; +use SL::DB::Employee; use SL::VK; use SL::IS; use SL::ReportGenerator; use Data::Dumper; -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; @@ -55,20 +55,19 @@ sub search_invoice { my %myconfig = %main::myconfig; my $locale = $main::locale; - my ($customer, $department); + my ($customer); - # setup customer selection - $form->all_vc(\%myconfig, "customer", "AR"); + $::request->layout->add_javascripts("autocomplete_project.js"); $form->{title} = $locale->text('Sales Report'); - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, - "departments" => "ALL_DEPARTMENTS", + $form->get_lists("departments" => "ALL_DEPARTMENTS", "business_types" => "ALL_BUSINESS_TYPES", "salesmen" => "ALL_SALESMEN", - 'employees' => 'ALL_EMPLOYEES', - 'partsgroup' => 'ALL_PARTSGROUPS', - "customers" => "ALL_VC"); + 'partsgroup' => 'ALL_PARTSGROUPS'); + + $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted; + $form->{CUSTOM_VARIABLES_IC} = CVar->get_configs('module' => 'IC'); ($form->{CUSTOM_VARIABLES_FILTER_CODE_IC}, $form->{CUSTOM_VARIABLES_INCLUSION_CODE_IC}) = CVar->render_search_options('variables' => $form->{CUSTOM_VARIABLES_IC}, @@ -80,10 +79,6 @@ sub search_invoice { $form->{CUSTOM_VARIABLES_INCLUSION_CODE_CT}) = CVar->render_search_options('variables' => $form->{CUSTOM_VARIABLES_CT}, 'include_prefix' => 'l_', 'include_value' => 'Y'); - $form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; - $form->{employee_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} }; - $form->{salesman_labels} = $form->{employee_labels}; - $form->header; print $form->parse_html_template('vk/search_invoice', { %myconfig }); @@ -142,7 +137,7 @@ sub invoice_transactions { $form->{title} = $locale->text('Sales Report'); @columns = - qw(description invnumber transdate customernumber customername partnumber partsgroup country business transdate qty parts_unit weight sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent employee salesman); + qw(description invnumber transdate shipvia customernumber customername partnumber partsgroup country business transdate qty parts_unit weight sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent employee salesman); my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs_ic }, @{ $cvar_configs_ct }; my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs_ic }, @{ $cvar_configs_ct }; @@ -154,7 +149,7 @@ sub invoice_transactions { # pass hidden variables for pdf/csv export # first with l_ to determine which columns to show # then with the options for headings (such as transdatefrom, partnumber, ...) - my @hidden_variables = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customer_id department partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort), + my @hidden_variables = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customer_id department_id partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort), "$form->{db}number", map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns @@ -176,6 +171,7 @@ sub invoice_transactions { 'salesman' => { 'text' => $locale->text('Salesperson'), }, 'invnumber' => { 'text' => $locale->text('Invoice Number'), }, 'transdate' => { 'text' => $locale->text('Invoice Date'), }, + 'shipvia' => { 'text' => $locale->text('Ship via'), }, 'qty' => { 'text' => $locale->text('Quantity'), }, 'parts_unit' => { 'text' => $locale->text('Base unit'), }, 'weight' => { 'text' => $locale->text('Weight'), }, @@ -211,9 +207,10 @@ sub invoice_transactions { push @options, $locale->text('Customer') . " : $form->{customer}" if $form->{customer}; push @options, $locale->text('Customer Number') . " : $form->{customernumber}" if $form->{customernumber}; # TODO: only customer id is passed - push @options, $locale->text('Department') . " : " . (split /--/, $form->{department})[0] if $form->{department}; + push @options, $locale->text('Department') . " : " . SL::DB::Department->new(id => $form->{department_id})->load->description if $form->{department_id}; push @options, $locale->text('Invoice Number') . " : $form->{invnumber}" if $form->{invnumber}; push @options, $locale->text('Invoice Date') . " : $form->{invdate}" if $form->{invdate}; + push @options, $locale->text('Ship via') . " : $form->{shipvia}" if $form->{shipvia}; push @options, $locale->text('Part Number') . " : $form->{partnumber}" if $form->{partnumber}; push @options, $locale->text('Partsgroup') . " : " . SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup if $form->{partsgroup_id}; push @options, $locale->text('Country') . " : $form->{country}" if $form->{country};