Bug 603: Interne Bemerkungen bei Workflow aus Lieferanten heraus
[kivitendo-erp.git] / SL / OE.pm
index 6226a57..27f57f9 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -121,8 +121,6 @@ sub transactions {
   $sth->execute(@values) ||
     $form->dberror($query . " (" . join(", ", @values) . ")");
 
-  dump_query(0, "laqje", $query, @values);
-
   my %id = ();
   while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
     $ref->{exchangerate} = 1 unless $ref->{exchangerate};
@@ -486,6 +484,9 @@ Message: $form->{message}\r| if $form->{message};
   my $rc = $dbh->commit;
   $dbh->disconnect;
 
+  $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
+                                       "quonumber" : "ordnumber"};
+
   Common::webdav_folder($form) if ($main::webdav);
 
   $main::lxdebug->leave_sub();
@@ -700,7 +701,8 @@ sub retrieve {
     $ref = $sth->fetchrow_hashref(NAME_lc);
     map { $form->{$_} = $ref->{$_} } keys %$ref;
 
-
+    $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
+                                         "quonumber" : "ordnumber"};
 
     # set all entries for multiple ids blank that yield different information
     while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
@@ -970,11 +972,6 @@ sub order_details {
        discount p_discount discount_sub nodiscount_sub
        linetotal  nodiscount_linetotal tax_rate projectnumber);
 
-  my @tax_arrays =
-    qw(taxbase tax taxdescription taxrate taxnumber);
-
-  map({ $form->{$_} = [] } (@arrays, @tax_arrays));
-
   my $sameitem = "";
   foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
     $i = $item->[0];
@@ -1172,7 +1169,7 @@ sub order_details {
     $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
 
     push(@{ $form->{tax} }, $form->format_amount($myconfig, $taxamount, 2));
-    push(@{ $form->{taxdescription} }, $form->{"${item}_description"});
+    push(@{ $form->{taxdescription} }, $form->{"${item}_description"}  . q{ } . 100 * $form->{"${item}_rate"} . q{%});
     push(@{ $form->{taxrate} },
          $form->format_amount($myconfig, $form->{"${item}_rate"} * 100));
     push(@{ $form->{taxnumber} }, $form->{"${item}_taxnumber"});
@@ -1198,9 +1195,6 @@ sub order_details {
     $form->set_payment_options($myconfig, $form->{orddate});
   }
 
-  # myconfig variables
-  map { $form->{$_} = $myconfig->{$_} }
-    (qw(company address tel fax signature businessnumber));
   $form->{username} = $myconfig->{name};
 
   $dbh->disconnect;