X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=0d5941cb0b4f5c9ed812891b6ae2e98c71ff9e5b;hb=7ad942750f0294bdbbbb6f0693bea17dcc75f18b;hp=dd4d2d01aef8c18d87efcadb38a282ceb4afb7d5;hpb=096f9e3e06dc378bcc2f97df58c74cec02b9f7ff;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index dd4d2d01a..0d5941cb0 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -48,8 +48,6 @@ require "bin/mozilla/reportgenerator.pl"; use strict; -my $print_post; - 1; # end of main @@ -235,6 +233,7 @@ sub prepare_order { $form->{"reqdate_$i"} = $form->{"deliverydate_$i"} unless $form->{"reqdate_$i"}; $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); + $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces); (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); $dec_qty = length $dec_qty; @@ -366,7 +365,7 @@ sub update_delivery_order { if ($rows > 1) { select_item(); - exit; + ::end_of_request(); } else { @@ -374,6 +373,7 @@ sub update_delivery_order { $form->{"marge_price_factor_$i"} = $form->{item_list}->[0]->{price_factor}; $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"}); } @@ -617,7 +617,7 @@ sub save { # if the name changed get new values if (check_name($form->{vc})) { update(); - exit; + ::end_of_request(); } $form->{id} = 0 if $form->{saveasnew}; @@ -637,7 +637,7 @@ sub save { if(!exists $form->{addition}) { $form->{snumbers} = qq|donumber_| . $form->{donumber}; $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history @@ -645,7 +645,7 @@ sub save { if(!$form->{print_and_save}) { set_headings("edit"); update(); - exit; + ::end_of_request(); } $main::lxdebug->leave_sub(); } @@ -683,12 +683,12 @@ sub delete_delivery_order { if(!exists $form->{addition}) { $form->{snumbers} = qq|donumber_| . $form->{donumber}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->info($locale->text('Delivery Order deleted!')); - exit(); + ::end_of_request(); } $form->error($locale->text('Cannot delete delivery order!')); @@ -732,11 +732,11 @@ sub invoice { for my $i (1 .. $form->{rowcount}) { # für bug 1284 - if ($form->{discount}){ # Falls wir einen Kundenrabatt haben + if ($form->{discount}){ # Falls wir einen Kundenrabatt haben # und keinen anderen discount wert an $i ... $form->{"discount_$i"} ||= $form->{discount}*100; # ... nehmen wir den kundenrabatt } - map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice basefactor); + map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor); } $form->{type} = "invoice"; @@ -769,10 +769,15 @@ sub invoice { $form->{"deliverydate_$i"} = $form->{"reqdate_$i"} unless $form->{"deliverydate_$i"}; + $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); + $form->{"lastcost_$i"} = + $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, + $decimalplaces); + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); $dec_qty = length $dec_qty; $form->{"qty_$i"} = @@ -898,8 +903,6 @@ sub e_mail { $form->{print_and_save} = 1; - $print_post = 1; - my $saved_form = save_form(); save(); @@ -1225,7 +1228,7 @@ sub transfer_in { update(); $main::lxdebug->leave_sub(); - exit 0; + ::end_of_request(); } } @@ -1310,13 +1313,26 @@ sub transfer_out { my $pinfo = $part_info_map{$request->{parts_id}}; my $binfo = $bin_info_map{$request->{bin_id}}; - push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, #5, for the transfer of #6.", - $pinfo->{description}, $binfo->{warehouse_description}, $binfo->{bin_description}, - $request->{chargenumber} ? $locale->text('chargenumber #1', $request->{chargenumber}) : $locale->text('no chargenumber'), - $request->{bestbefore} ? $locale->text('bestbefore #1', $request->{bestbefore}) : $locale->text('no bestbefore'), - $form->format_amount_units('amount' => $request->{sum_base_qty}, - 'part_unit' => $pinfo->{unit}, - 'conv_units' => 'convertible_not_smaller')); + if ($main::show_best_before) { + push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, #5, for the transfer of #6.", + $pinfo->{description}, + $binfo->{warehouse_description}, + $binfo->{bin_description}, + $request->{chargenumber} ? $locale->text('chargenumber #1', $request->{chargenumber}) : $locale->text('no chargenumber'), + $request->{bestbefore} ? $locale->text('bestbefore #1', $request->{bestbefore}) : $locale->text('no bestbefore'), + $form->format_amount_units('amount' => $request->{sum_base_qty}, + 'part_unit' => $pinfo->{unit}, + 'conv_units' => 'convertible_not_smaller')); + } else { + push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, for the transfer of #5.", + $pinfo->{description}, + $binfo->{warehouse_description}, + $binfo->{bin_description}, + $request->{chargenumber} ? $locale->text('chargenumber #1', $request->{chargenumber}) : $locale->text('no chargenumber'), + $form->format_amount_units('amount' => $request->{sum_base_qty}, + 'part_unit' => $pinfo->{unit}, + 'conv_units' => 'convertible_not_smaller')); + } } } @@ -1326,7 +1342,7 @@ sub transfer_out { update(); $main::lxdebug->leave_sub(); - exit 0; + ::end_of_request(); } }