]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/do.pl
Reimplementierung von 55e9890a und 1465da30
[mfinanz.git] / bin / mozilla / do.pl
index ae3436f6588f8cc63cccdfccd662f4fc4a536d64..b9f7fc16fbee6f09c3f27d26b8055b7dcfe5c269 100644 (file)
@@ -751,6 +751,15 @@ sub invoice {
   my $currency = $form->{currency};
   invoice_links();
 
+  if ($form->{ordnumber}) {
+    require SL::DB::Order;
+    if (my $order = SL::DB::Manager::Order->find_by(ordnumber => $form->{ordnumber})) {
+      $order->load;
+      $form->{orddate} = $order->transdate_as_date;
+      $form->{$_}      = $order->$_ for qw(payment_id salesman_id taxzone_id quonumber);
+    }
+  }
+
   $form->{currency}     = $currency;
   $form->{exchangerate} = "";
   $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell);