resubmit beim Drucken für Lieferscheine ohne speichern gefixt (Opera/Chromium).
[kivitendo-erp.git] / bin / mozilla / do.pl
index 3e54c1e..21e8d32 100644 (file)
@@ -293,16 +293,16 @@ sub form_header {
   $form->{oldvcname}         =  $form->{"old$form->{vc}"};
   $form->{oldvcname}         =~ s/--.*//;
 
-  if ($form->{resubmit}) {
-    my $dispatch_to_popup = '';
-    if ($form->{format} eq "html") {
-      $dispatch_to_popup .= "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
-    }
-    # emulate click for resubmitting actions
-    $dispatch_to_popup .= "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
+  my $dispatch_to_popup = '';
+  if ($form->{resubmit} && ($form->{format} eq "html")) {
+    $dispatch_to_popup  = "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
     $dispatch_to_popup .= "document.do.submit();";
-    $::request->{layout}->add_javascripts_inline("\$(function(){$dispatch_to_popup})");
+  } elsif ($form->{resubmit}) {
+    # emulate click for resubmitting actions
+    $dispatch_to_popup  = "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
   }
+  $::request->{layout}->add_javascripts_inline("\$(function(){$dispatch_to_popup})");
+
 
   my $follow_up_vc                =  $form->{ $form->{vc} eq 'customer' ? 'customer' : 'vendor' };
   $follow_up_vc                   =~ s/--\d*\s*$//;
@@ -412,7 +412,7 @@ sub update_delivery_order {
         map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
 
         $form->{"marge_price_factor_$i"} = $form->{item_list}->[0]->{price_factor};
-        $form->{"sellprice_$i"}          = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
+        $form->{"sellprice_$i"}          = $form->format_amount(\%myconfig, $form->{"sellprice_$i"} * (1 - $form->{tradediscount}));
         $form->{"lastcost_$i"}          = $form->format_amount(\%myconfig, $form->{"lastcost_$i"});
         $form->{"qty_$i"}                = $form->format_amount(\%myconfig, $form->{"qty_$i"});
       }