Revision 6329a5b2
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
t/workflow/delivery_order_reclamation.t | ||
---|---|---|
$unit,
|
||
@parts,
|
||
$department,
|
||
$relamation_reason,
|
||
$reclamation_reason,
|
||
);
|
||
|
||
|
||
... | ... | |
partnumber => 'Serv_2'
|
||
)->save;
|
||
|
||
$relamation_reason = SL::DB::ReclamationReason->new(
|
||
$reclamation_reason = SL::DB::ReclamationReason->new(
|
||
name => "test_reason",
|
||
description => "",
|
||
position => 1,
|
||
... | ... | |
reclamation_items => [
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
reclamation_items => [
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
)->load;
|
||
|
||
# convert order → reclamation
|
||
my $converted_sales_reclamation = SL::Model::Record->new_from_workflow($sales_delivery_order, "sales_reclamation");
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
my $converted_sales_reclamation = SL::Model::Record->new_from_workflow($sales_delivery_order, 'sales_reclamation');
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->save->load;
|
||
my $converted_purchase_reclamation = SL::Model::Record->new_from_workflow($purchase_delivery_order, "purchase_reclamation");
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
my $converted_purchase_reclamation = SL::Model::Record->new_from_workflow($purchase_delivery_order, 'purchase_reclamation');
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->save->load;
|
||
|
||
# TODO: use SL::Model::Record for conversion
|
||
# convert reclamation → order
|
||
my $converted_sales_delivery_order = $sales_reclamation->convert_to_delivery_order->save->load;
|
||
my $converted_purchase_delivery_order = $purchase_reclamation->convert_to_delivery_order->save->load;
|
||
my $converted_sales_delivery_order = SL::Model::Record->new_from_workflow($sales_reclamation, 'rma_delivery_order')->save->load;
|
||
my $converted_purchase_delivery_order = SL::Model::Record->new_from_workflow($purchase_reclamation, 'supplier_delivery_order')->save->load;
|
||
|
||
|
||
#get items before strip
|
t/workflow/invoice_to_reclamation.t | ||
---|---|---|
$unit,
|
||
@parts,
|
||
$department,
|
||
$relamation_reason,
|
||
$reclamation_reason,
|
||
);
|
||
|
||
|
||
... | ... | |
partnumber => 'Serv_2'
|
||
)->save;
|
||
|
||
$relamation_reason = SL::DB::ReclamationReason->new(
|
||
$reclamation_reason = SL::DB::ReclamationReason->new(
|
||
name => "test_reason",
|
||
description => "",
|
||
position => 1,
|
||
... | ... | |
reclamation_items => [
|
||
create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
reclamation_items => [
|
||
create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
|
||
# convert invoice → reclamation
|
||
my $converted_sales_reclamation =SL::Model::Record->new_from_workflow($sales_invoice, "sales_reclamation");
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->save->load;
|
||
my $converted_purchase_reclamation = SL::Model::Record->new_from_workflow($purchase_invoice, "purchase_reclamation");
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->save->load;
|
||
|
||
#get items before strip
|
t/workflow/order_reclamation.t | ||
---|---|---|
$unit,
|
||
@parts,
|
||
$department,
|
||
$relamation_reason,
|
||
$reclamation_reason,
|
||
);
|
||
|
||
|
||
... | ... | |
partnumber => 'Serv_2'
|
||
)->save;
|
||
|
||
$relamation_reason = SL::DB::ReclamationReason->new(
|
||
$reclamation_reason = SL::DB::ReclamationReason->new(
|
||
name => "test_reason",
|
||
description => "",
|
||
position => 1,
|
||
... | ... | |
reclamation_items => [
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
reclamation_items => [
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
SL::Dev::Record::create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
|
||
# convert order → reclamation
|
||
my $converted_sales_reclamation = SL::Model::Record->new_from_workflow($sales_order, "sales_reclamation");
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_sales_reclamation->save->load;
|
||
my $converted_purchase_reclamation = SL::Model::Record->new_from_workflow($purchase_order, "purchase_reclamation");
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($relamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($relamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[0]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->items_sorted->[1]->reason($reclamation_reason);
|
||
$converted_purchase_reclamation->save->load;
|
||
|
||
# TODO: use SL::Model::Record for conversion
|
||
# convert reclamation → order
|
||
my $converted_sales_order = $sales_reclamation->convert_to_order->save->load;
|
||
my $converted_purchase_order = $purchase_reclamation->convert_to_order->save->load;
|
||
my $converted_sales_order = SL::Model::Record->new_from_workflow($sales_reclamation, 'sales_order')->save->load;
|
||
my $converted_purchase_order = SL::Model::Record->new_from_workflow($purchase_reclamation, 'purchase_order')->save->load;
|
||
|
||
|
||
#get items before strip
|
t/workflow/reclamation_reclamation.t | ||
---|---|---|
$unit,
|
||
@parts,
|
||
$department,
|
||
$relamation_reason,
|
||
$reclamation_reason,
|
||
);
|
||
|
||
|
||
... | ... | |
partnumber => 'Serv_2'
|
||
)->save;
|
||
|
||
$relamation_reason = SL::DB::ReclamationReason->new(
|
||
$reclamation_reason = SL::DB::ReclamationReason->new(
|
||
name => "test_reason",
|
||
description => "",
|
||
position => 1,
|
||
... | ... | |
reclamation_items => [
|
||
create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
||
... | ... | |
reclamation_items => [
|
||
create_reclamation_item(
|
||
part => $parts[0], qty => 3, sellprice => 70,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
create_reclamation_item(
|
||
part => $parts[1], qty => 10, sellprice => 50,
|
||
reason => $relamation_reason,
|
||
reason => $reclamation_reason,
|
||
),
|
||
],
|
||
)->load;
|
Auch abrufbar als: Unified diff
Model::Record: nutze neue Methoden in Workflow-Test