Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 51c872e7

Von Sven Schöling vor etwa 1 Jahr hinzugefügt

  • ID 51c872e76985f6a33a7b1d940872a181d6693074
  • Vorgänger d9676896
  • Nachfolger 95c4d843

RecordLink: in BackgroundJobs nicht mehr manuell setzen

Unterschiede anzeigen:

SL/BackgroundJob/CreatePeriodicInvoices.pm
257 257

  
258 258
    $invoice->post(ar_id => $config->ar_chart_id) || die;
259 259

  
260
    $order->link_to_record($invoice);
261

  
262
    foreach my $item (@{ $invoice->items }) {
263
      foreach (qw(orderitems)) {    # expand if needed (delivery_order_items)
264
          if ($item->{"converted_from_${_}_id"}) {
265
            die unless $item->{id};
266
            RecordLinks->create_links('mode'       => 'ids',
267
                                      'from_table' => $_,
268
                                      'from_ids'   => $item->{"converted_from_${_}_id"},
269
                                      'to_table'   => 'invoice',
270
                                      'to_id'      => $item->{id},
271
            ) || die;
272
            delete $item->{"converted_from_${_}_id"};
273
         }
274
      }
275
    }
276

  
277 260
    foreach my $item (grep { ($_->recurring_billing_mode eq 'once') && !$_->recurring_billing_invoice_id } @{ $order->orderitems }) {
278 261
      $item->update_attributes(recurring_billing_invoice_id => $invoice->id);
279 262
    }

Auch abrufbar als: Unified diff