generic translations strict
[kivitendo-erp.git] / bin / mozilla / do.pl
index 3884b68..7f83bf3 100644 (file)
@@ -121,7 +121,8 @@ sub edit {
   }
 
   if ($form->{print_and_save}) {
-    $form->{action}   = "print";
+    $form->{action}   = "dispatcher";
+    $form->{action_print} = "1";
     $form->{resubmit} = 1;
     $language_id      = $form->{language_id};
     $printer_id       = $form->{printer_id};
@@ -184,8 +185,6 @@ sub order_links {
 
   $form->{employee} = "$form->{employee}--$form->{employee_id}";
 
-  $form->{salesman_id} = $salesman_id if ($editing);
-
   $lxdebug->leave_sub();
 }
 
@@ -272,10 +271,15 @@ sub form_header {
     if ($form->{format} eq "html") {
       $form->{onload} = "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
     }
+    # emulate click for resubmitting actions
+    $form->{onload} .= "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
     $form->{onload} .= "document.do.submit();"
   }
 
   $form->header();
+  # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID'
+  $form->{department} .= '--' . $form->{department_id};
+
   print $form->parse_html_template('do/form_header');
 
   $lxdebug->leave_sub();
@@ -765,8 +769,12 @@ sub invoice_multi {
   $form->{rowcount} = 0;
   foreach my $ref (@{ $form->{form_details} }) {
     $form->{rowcount}++;
+    $ref->{reqdate} ||= $ref->{dord_transdate}; # copy transdates into each invoice row
     map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{ $ref };
     map { $form->{"${_}_$form->{rowcount}"} = $form->format_amount(\%myconfig, $ref->{$_}) } qw(qty sellprice discount lastcost);
+               $form->{"discount_$form->{rowcount}"}   = $form->{"discount_$form->{rowcount}"}  * 100; #s.a. Bug 1151
+               # Anm.: Eine Änderung des discounts in der SL/DO.pm->retrieve (select (doi.discount * 100) as discount) ergibt in psql einen
+               # Wert von 10.0000001490116. Ferner ist der Rabatt in der Rechnung dann bei 1.0 (?). Deswegen lasse ich das hier. jb 10.10.09
   }
   delete $form->{form_details};