]> wagnertech.de Git - mfinanz.git/blobdiff - SL/BackgroundJob/CreatePeriodicInvoices.pm
trailing whitespace entfernt
[mfinanz.git] / SL / BackgroundJob / CreatePeriodicInvoices.pm
index 9f116becbd1006efa160f594e1ba60d30dc20625..431225f9c6592c3e3bf368680e11959026e1e815 100644 (file)
@@ -200,6 +200,7 @@ sub _create_periodic_invoice {
     $invoice->assign_attributes(deliverydate => $period_start_date,
                                 intnotes     => $intnotes,
                                 employee     => $order->employee, # new_from sets employee to import user
+                                direct_debit => $config->direct_debit,
                                );
 
     _replace_vars(object => $invoice, vars => $time_period_vars, attribute => $_, attribute_format => ($_ eq 'notes' ? 'html' : 'text')) for qw(notes intnotes transaction_description);
@@ -212,18 +213,6 @@ sub _create_periodic_invoice {
 
     $invoice->post(ar_id => $config->ar_chart_id) || die;
 
-    # like $form->add_shipto, but we don't need to check for a manual exception,
-    # because we can already assume this (otherwise no shipto_id from order)
-    if ($order->shipto_id) {
-
-      my $shipto_oe = SL::DB::Manager::Shipto->find_by(shipto_id => $order->shipto_id);
-      my $shipto_ar = $shipto_oe->clone_and_reset;
-
-      $shipto_ar->module('AR');            # alter module OE -> AR
-      $shipto_ar->trans_id($invoice->id);  # alter trans_id -> new id from invoice
-      $shipto_ar->save;
-    }
-
     $order->link_to_record($invoice);
 
     foreach my $item (@{ $invoice->items }) {