X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f7b15d4334848fad1bcd0b569eff5139f9a6ba4d..aae306cda6274d:/bin/mozilla/do.pl diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index f8a57e444..f69da647b 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -265,9 +265,9 @@ sub form_header { my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; $form->get_lists($vc => "ALL_VC", "price_factors" => "ALL_PRICE_FACTORS", - "departments" => "ALL_DEPARTMENTS", "business_types" => "ALL_BUSINESS_TYPES", ); + $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; # Projects my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"}); @@ -302,7 +302,6 @@ sub form_header { ] ]); - map { $_->{value} = "$_->{description}--$_->{id}" } @{ $form->{ALL_DEPARTMENTS} }; map { $_->{value} = "$_->{name}--$_->{id}" } @{ $form->{ALL_VC} }; $form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} }; @@ -502,11 +501,10 @@ sub search { $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->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; $form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} }; $form->{title} = $locale->text('Delivery Orders'); @@ -527,7 +525,6 @@ sub orders { my $locale = $main::locale; my $cgi = $::request->{cgi}; - $form->{department_id} = (split /--/, $form->{department})[-1]; ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} }); report_generator_set_default_sort('transdate', 1); @@ -612,9 +609,8 @@ sub orders { if ($form->{cp_name}) { push @options, $locale->text('Contact Person') . " : $form->{cp_name}"; } - if ($form->{department}) { - my ($department) = split /--/, $form->{department}; - push @options, $locale->text('Department') . " : $department"; + if ($form->{department_id}) { + push @options, $locale->text('Department') . " : " . SL::DB::Department->new(id => $form->{department_id})->load->description; } if ($form->{donumber}) { push @options, $locale->text('Delivery Order Number') . " : $form->{donumber}"; @@ -918,7 +914,7 @@ sub invoice_multi { my @do_ids = map { $form->{"trans_id_$_"} } grep { $form->{"multi_id_$_"} } (1..$form->{rowcount}); if (!scalar @do_ids) { - $form->show_generic_error($locale->text('You have not selected any delivery order.'), 'back_button' => 1); + $form->show_generic_error($locale->text('You have not selected any delivery order.')); } map { delete $form->{$_} } grep { m/^(?:trans|multi)_id_\d+/ } keys %{ $form }; @@ -1361,7 +1357,7 @@ sub transfer_in { my $locale = $main::locale; if ($form->{id} && DO->is_marked_as_delivered(id => $form->{id})) { - $form->show_generic_error($locale->text('The parts for this delivery order have already been transferred in.'), 'back_button' => 1); + $form->show_generic_error($locale->text('The parts for this delivery order have already been transferred in.')); } save(no_redirect => 1); @@ -1431,7 +1427,7 @@ sub transfer_out { my $locale = $main::locale; if ($form->{id} && DO->is_marked_as_delivered(id => $form->{id})) { - $form->show_generic_error($locale->text('The parts for this delivery order have already been transferred out.'), 'back_button' => 1); + $form->show_generic_error($locale->text('The parts for this delivery order have already been transferred out.')); } save(no_redirect => 1); @@ -1657,7 +1653,7 @@ sub transfer_in_out_default { my $base_unit_factor = $units->{ $part_info_map{$form->{"id_$i"}}->{unit} }->{factor} || 1; my $qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"}) * $units->{$form->{"unit_$i"}}->{factor} / $base_unit_factor; - $form->show_generic_error($locale->text("Cannot transfer negative entries." ), 'back_button' => 1) if ($qty < 0); + $form->show_generic_error($locale->text("Cannot transfer negative entries." )) if ($qty < 0); # if we do not want to transfer services and this part is a service, set qty to zero # ... and do not create a hash entry in %qty_parts below (will skip check for bins for the transfer == out case) # ... and push only a empty (undef) element to @all_requests (will skip check for bin_id and warehouse_id and will not alter the row) @@ -1744,7 +1740,7 @@ sub transfer_in_out_default { } } else { #$main::lxdebug->message(0, 'Fehlertext: ' . $fehlertext); - $form->show_generic_error($locale->text("Cannot transfer.
Reason:
#1", $fehlertext ), 'back_button' => 1); + $form->show_generic_error($locale->text("Cannot transfer.
Reason:
#1", $fehlertext )); } } }