Es stellt sich heraus dass das Verhalten von FCGI 0.70 gewollt ist.
[kivitendo-erp.git] / bin / mozilla / do.pl
index 1ce1c46..d5e8d3a 100644 (file)
@@ -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};
@@ -645,7 +645,7 @@ sub save {
   if(!$form->{print_and_save}) {
     set_headings("edit");
     update();
-    exit;
+    ::end_of_request();
   }
   $main::lxdebug->leave_sub();
 }
@@ -688,7 +688,7 @@ sub delete_delivery_order {
     # /saving the history
 
     $form->info($locale->text('Delivery Order deleted!'));
-    exit();
+    ::end_of_request();
   }
 
   $form->error($locale->text('Cannot delete delivery order!'));
@@ -736,7 +736,7 @@ sub invoice {
       # 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();
     }
   }
 
@@ -1339,7 +1342,7 @@ sub transfer_out {
       update();
       $main::lxdebug->leave_sub();
 
-      exit 0;
+      ::end_of_request();
     }
   }