X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=1f9419b39c372369c13258ef58abab3b81666597;hb=9985655a1d5ae8577901aec2f5052e1d357c52a3;hp=67819fbc90b2f214f6f58fe8a8ba119dca36efb1;hpb=e8966d209fcc8cda8c402cb0bab2a58f61b5922c;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 67819fbc9..1f9419b39 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -453,6 +453,7 @@ sub update_delivery_order { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}); $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}); $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100.0); } display_form(); @@ -491,10 +492,11 @@ sub search { $form->{vc} = $form->{type} eq 'purchase_delivery_order' ? 'vendor' : 'customer'; - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }, - "departments" => "ALL_DEPARTMENTS", - "$form->{vc}s" => "ALL_VC"); + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }, + "departments" => "ALL_DEPARTMENTS", + "$form->{vc}s" => "ALL_VC", + "business_types" => "ALL_BUSINESS_TYPES"); $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); $form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} }; @@ -550,7 +552,7 @@ sub orders { push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber cusordnumber transaction_description transdatefrom transdateto reqdatefrom reqdateto type vc employee_id salesman_id project_id - insertdatefrom insertdateto); + insertdatefrom insertdateto business_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -613,6 +615,10 @@ sub orders { push @options, $locale->text('Order Number') . " : $form->{ordnumber}"; } push @options, $locale->text('Serial Number') . " : $form->{serialnumber}" if $form->{serialnumber}; + if ($form->{business_id}) { + my $vc_type_label = $form->{vc} eq 'customer' ? $locale->text('Customer type') : $locale->text('Vendor type'); + push @options, $vc_type_label . " : " . SL::DB::Business->new(id => $form->{business_id})->load->description; + } if ($form->{transaction_description}) { push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"; } @@ -814,7 +820,7 @@ sub invoice { } } } - map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor); + map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice lastcost basefactor); $form->{"donumber_$i"} = $form->{donumber}; $form->{"converted_from_delivery_order_items_id_$i"} = delete $form->{"delivery_order_items_id_$i"}; } @@ -822,7 +828,7 @@ sub invoice { $form->{type} = "invoice"; # locale messages - $main::locale = new Locale "$myconfig{countrycode}", "$script"; + $main::locale = Locale->new("$myconfig{countrycode}", "$script"); $locale = $main::locale; require "bin/mozilla/$form->{script}"; @@ -830,15 +836,6 @@ sub invoice { my $currency = $form->{currency}; invoice_links(); - if ($form->{ordnumber}) { - require SL::DB::Order; - if (my $order = SL::DB::Manager::Order->find_by(ordnumber => $form->{ordnumber})) { - $order->load; - $form->{orddate} = $order->transdate_as_date; - $form->{$_} = $order->$_ for qw(payment_id salesman_id taxzone_id quonumber); - } - } - $form->{currency} = $currency; $form->{exchangerate} = ""; $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell); @@ -969,7 +966,7 @@ sub invoice_multi { } delete $form->{form_details}; - $locale = new Locale "$myconfig{countrycode}", "$script"; + $locale = Locale->new("$myconfig{countrycode}", "$script"); require "bin/mozilla/$form->{script}";