Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 34d2f9da

Von Werner Hahn vor fast 3 Jahren hinzugefügt

  • ID 34d2f9da09e77fee134bf138c1fff801b28990ec
  • Vorgänger 66869d3f
  • Nachfolger e0fb092b

MassRecordCreationAndPrinting: Shopstatus setzen

Unterschiede anzeigen:

SL/BackgroundJob/MassRecordCreationAndPrinting.pm
55 55
      my $invoice              = $sales_delivery_order->convert_to_invoice(%conversion_params);
56 56

  
57 57
      die $db->error if !$invoice;
58
      # update shop status
59
      my @linked_shop_orders = $invoice->linked_records(
60
        from      => 'ShopOrder',
61
        via       => [ 'DeliveryOrder', 'Order' ],
62
      );
63
      #if (scalar @linked_shop_orders[0][0] >= 1){
64
        #do update
65
      my $shop_order = $linked_shop_orders[0][0];
66
      if ($shop_order){
67
      require SL::Shop;
68
        my $shop_config = SL::DB::Manager::Shop->get_first( query => [ id => $shop_order->shop_id ] );
69
        my $shop = SL::Shop->new( config => $shop_config );
70
        $shop->connector->set_orderstatus($shop_order->shop_trans_id, "completed");
71
      }
58 72

  
59 73
      $data->{num_created}++;
60 74
      push @{ $data->{invoice_ids} }, $invoice->id;
SL/Controller/MassInvoiceCreatePrint.pm
83 83
    $::form->error($db->error);
84 84
  }
85 85

  
86
  foreach my $invoice( @invoices ) {
87
    # update shop status
88
    my @linked_shop_orders = $invoice->linked_records(
89
      from      => 'ShopOrder',
90
      via       => [ 'DeliveryOrder', 'Order' ],
91
    );
92
    #if (scalar @linked_shop_orders[0][0] >= 1){
93
      #do update
94
    my $shop_order = $linked_shop_orders[0][0];
95
    if ($shop_order){
96
    require SL::Shop;
97
      my $shop_config = SL::DB::Manager::Shop->get_first( query => [ id => $shop_order->shop_id ] );
98
      my $shop = SL::Shop->new( config => $shop_config );
99
      $shop->connector->set_orderstatus($shop_order->shop_trans_id, "completed");
100
    }
101
  }
102

  
86 103
  my $key = sprintf('%d-%d', Time::HiRes::gettimeofday());
87 104
  $::auth->set_session_value("MassInvoiceCreatePrint::ids-${key}" => [ map { $_->id } @invoices ]);
88 105

  

Auch abrufbar als: Unified diff