Pflichtenheft: durchsuchbare CVars als Spalten in Bericht anzeigen können
[kivitendo-erp.git] / SL / OE.pm
index 6a46fec..9944f71 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -634,7 +634,7 @@ SQL
              conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
              $amount, $netamount, conv_date($reqdate),
              $form->{taxincluded} ? 't' : 'f', $form->{shippingpoint},
-             $form->{shipvia}, $form->{notes}, $form->{intnotes},
+             $form->{shipvia}, $restricter->process($form->{notes}), $form->{intnotes},
              $form->{currency}, $form->{closed} ? 't' : 'f',
              $form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f',
              $quotation, conv_i($form->{department_id}),
@@ -674,7 +674,7 @@ SQL
   delete $form->{convert_from_oe_ids};
   @{ $form->{convert_from_oe_ids} }      =  @convert_from_oe_ids;
   foreach (qw(ar oe)) {
-    if ($form->{"convert_from_${_}_ids"}) {
+    if (!$form->{useasnew} && $form->{"convert_from_${_}_ids"}) {
       RecordLinks->create_links('dbh'        => $dbh,
                                 'mode'       => 'ids',
                                 'from_table' => $_,
@@ -738,7 +738,7 @@ sub load_periodic_invoice_config {
     my $config_obj = SL::DB::Manager::PeriodicInvoicesConfig->find_by(oe_id => $form->{id});
 
     if ($config_obj) {
-      my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id
+      my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity order_value_periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id
                                                       print printer_id copies) };
       $form->{periodic_invoices_config} = YAML::Dump($config);
     }
@@ -836,6 +836,7 @@ sub retrieve {
   if ($form->{"rowcount"} and $#ids == 0) {
     $form->{"id"} = $ids[0];
     undef @ids;
+    delete $form->{convert_from_oe_ids};
   }
 
   # and remember for the rest of the function