Lagerbestandanzeige in OE Masken
[kivitendo-erp.git] / bin / mozilla / do.pl
index 11e3a4d..ebaffc6 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};
@@ -182,8 +183,6 @@ sub order_links {
   ($form->{ $form->{vc} })  = split /--/, $form->{ $form->{vc} };
   $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
 
-  $form->{taxincluded} = $taxincluded if ($form->{id});
-
   $form->{employee} = "$form->{employee}--$form->{employee_id}";
 
   $form->{salesman_id} = $salesman_id if ($editing);
@@ -274,6 +273,8 @@ 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();"
   }
 
@@ -734,6 +735,7 @@ sub invoice_multi {
                               'back_button' => 1);
   }
 
+  my $source_type              = $form->{type};
   $form->{convert_from_do_ids} = join ' ', @do_ids;
   # bei der auswahl von mehreren Lieferscheinen fuer eine Rechnung, die einfach in donumber_array
   # zwischenspeichern (DO.pm) und als ' '-separierte Liste wieder zurueckschreiben
@@ -748,7 +750,7 @@ sub invoice_multi {
   $form->{defaultcurrency}     = $form->get_default_currency(\%myconfig);
 
   my $buysell;
-  if ($form->{type} eq 'purchase_delivery_order') {
+  if ($source_type eq 'purchase_delivery_order') {
     $form->{title}  = $locale->text('Add Vendor Invoice');
     $form->{script} = 'ir.pl';
     $script         = "ir";
@@ -766,6 +768,7 @@ 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);
   }