Revision 1f53f425
Von Tamino Steinert vor etwa 2 Jahren hinzugefügt
SL/DB/Order.pm | ||
---|---|---|
|
||
sub type {
|
||
my $self = shift;
|
||
|
||
return SALES_ORDER_TYPE() if $self->customer_id && ! $self->quotation;
|
||
return PURCHASE_ORDER_TYPE() if $self->vendor_id && ! $self->quotation;
|
||
return SALES_QUOTATION_TYPE() if $self->customer_id && $self->quotation;
|
||
return REQUEST_QUOTATION_TYPE() if $self->vendor_id && $self->quotation;
|
||
|
||
return;
|
||
die "invalid type: " . $self->record_type if (!any { $self->record_type eq $_ } (
|
||
SALES_ORDER_TYPE(),
|
||
PURCHASE_ORDER_TYPE(),
|
||
REQUEST_QUOTATION_TYPE(),
|
||
SALES_QUOTATION_TYPE(),
|
||
));
|
||
return $self->record_type;
|
||
}
|
||
|
||
sub is_type {
|
||
... | ... | |
$args{shipto_id} = $source->shipto_id;
|
||
}
|
||
|
||
$args{record_type} = $destination_type;
|
||
|
||
my $order = $class->new(%args);
|
||
$order->assign_attributes(%{ $params{attributes} }) if $params{attributes};
|
||
my $items = delete($params{items}) || $source->items_sorted;
|
Auch abrufbar als: Unified diff
Order: nutze Record-Type