Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1f53f425

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 1f53f4251e8aa82251be5f50b56d49a5973b447e
  • Vorgänger fa1b9d49
  • Nachfolger b1695edc

Order: nutze Record-Type

Unterschiede anzeigen:

SL/DB/Order.pm
162 162

  
163 163
sub type {
164 164
  my $self = shift;
165

  
166
  return SALES_ORDER_TYPE()       if $self->customer_id && ! $self->quotation;
167
  return PURCHASE_ORDER_TYPE()    if $self->vendor_id   && ! $self->quotation;
168
  return SALES_QUOTATION_TYPE()   if $self->customer_id &&   $self->quotation;
169
  return REQUEST_QUOTATION_TYPE() if $self->vendor_id   &&   $self->quotation;
170

  
171
  return;
165
  die "invalid type: " . $self->record_type if (!any { $self->record_type eq $_ } (
166
      SALES_ORDER_TYPE(),
167
      PURCHASE_ORDER_TYPE(),
168
      REQUEST_QUOTATION_TYPE(),
169
      SALES_QUOTATION_TYPE(),
170
    ));
171
  return $self->record_type;
172 172
}
173 173

  
174 174
sub is_type {
......
444 444
    $args{shipto_id} = $source->shipto_id;
445 445
  }
446 446

  
447
  $args{record_type} = $destination_type;
448

  
447 449
  my $order = $class->new(%args);
448 450
  $order->assign_attributes(%{ $params{attributes} }) if $params{attributes};
449 451
  my $items = delete($params{items}) || $source->items_sorted;

Auch abrufbar als: Unified diff