Revision 4cdf2968
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/DB/Order.pm | ||
---|---|---|
162 | 162 |
|
163 | 163 |
sub type { |
164 | 164 |
my $self = shift; |
165 |
|
|
166 |
return SALES_ORDER_INTAKE_TYPE() if $self->customer_id && $self->intake;
|
|
167 |
return SALES_ORDER_TYPE() if $self->customer_id && ! $self->quotation;
|
|
168 |
return PURCHASE_ORDER_TYPE() if $self->vendor_id && ! $self->quotation;
|
|
169 |
return SALES_QUOTATION_TYPE() if $self->customer_id && $self->quotation;
|
|
170 |
return REQUEST_QUOTATION_TYPE() if $self->vendor_id && $self->quotation && ! $self->intake;
|
|
171 |
return PURCHASE_QUOTATION_INTAKE_TYPE() if $self->vendor_id && $self->quotation && $self->intake;
|
|
172 |
|
|
173 |
return; |
|
165 |
die "invalid type: " . $self->record_type if (!any { $self->record_type eq $_ } ( |
|
166 |
SALES_ORDER_INTAKE_TYPE(),
|
|
167 |
SALES_ORDER_TYPE(),
|
|
168 |
PURCHASE_ORDER_TYPE(),
|
|
169 |
REQUEST_QUOTATION_TYPE(),
|
|
170 |
SALES_QUOTATION_TYPE(),
|
|
171 |
PURCHASE_QUOTATION_INTAKE_TYPE(),
|
|
172 |
)); |
|
173 |
return $self->record_type;
|
|
174 | 174 |
} |
175 | 175 |
|
176 | 176 |
sub is_type { |
... | ... | |
469 | 469 |
$args{shipto_id} = $source->shipto_id; |
470 | 470 |
} |
471 | 471 |
|
472 |
$args{record_type} = $destination_type; |
|
473 |
|
|
472 | 474 |
my $order = $class->new(%args); |
473 | 475 |
$order->assign_attributes(%{ $params{attributes} }) if $params{attributes}; |
474 | 476 |
my $items = delete($params{items}) || $source->items_sorted; |
Auch abrufbar als: Unified diff
Order: nutze Record-Type