Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 335c27d0

Von Werner Hahn vor fast 2 Jahren hinzugefügt

  • ID 335c27d0884536771413218b0a467f8ef705e29c
  • Vorgänger 9a796462
  • Nachfolger 4fd51bb7

DeliveryOrderType richtig setzen

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
105 105

  
106 106
  require SL::DB::Reclamation;
107 107
  my $reclamation = SL::DB::Reclamation->new(id => $::form->{from_id})->load;
108
  my $type = $reclamation->type eq 'sales_reclamation' ? 'rma_delivery_order' : 'supplier_delivery_order';
109
  my ($delivery_order, $error) = $reclamation->convert_to_delivery_order(type => $type);
108
  my ($delivery_order, $error) = $reclamation->convert_to_delivery_order();
110 109
  if($error) {
111 110
    croak("Error while converting: " . $error);
112 111
  }
SL/DB/DeliveryOrder.pm
207 207
    $record_args{cp_id} = $source->contact_id;
208 208
    $record_args{cusordnumber} = $source->cv_record_number;
209 209
    $record_args{is_sales} = $source->is_sales;
210
    $record_args{type} = $source->is_sales ? 'rma_delivery_order' : 'supplier_delivery_order';
210 211
    # }}} for vim folds
211 212
  }
212 213

  
......
230 231
  $delivery_order->assign_attributes(%{ $params{attributes} }) if $params{attributes};
231 232

  
232 233
  my $items = delete($params{items}) || $source->items_sorted;
233
  my @items = $delivery_order->is_type(SUPPLIER_DELIVERY_ORDER_TYPE) ? ()
234
  my @items = ( $delivery_order->is_type(SUPPLIER_DELIVERY_ORDER_TYPE) && ref($source) ne 'SL::DB::Reclamation' ) ?
235
                ()
234 236
              : map { SL::DB::DeliveryOrderItem->new_from($_) } @{ $items };
235 237

  
236 238
  @items = grep { $params{item_filter}->($_) } @items if $params{item_filter};

Auch abrufbar als: Unified diff