Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 65063570

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

  • ID 65063570dbbb5705428e01be618d940fb9d5c853
  • Vorgänger e22bb853
  • Nachfolger 4b09a3dd

t/workflow: Tests für Record-Type angepasst

Unterschiede anzeigen:

t/workflow/delivery_order_reclamation.t
my $purchase_reclamation_tmp = clone($purchase_reclamation);
# clean different values
foreach (qw(
customer_id vendor_id
record_type customer_id vendor_id
id record_number
salesman_id
transaction_description
......
## converted should be nearly the same
my @different_record_values = qw(
id employee_id itime mtime reqdate
order_type ordnumber oreqnumber
amount exchangerate netamount
order_type record_type
cp_id contact_id
cusordnumber cv_record_number
donumber record_number
);
my @different_record_item_values = qw(
id delivery_order_id reclamation_id itime mtime
cusordnumber marge_price_factor ordnumber transdate
description reason_description_ext reason_description_int reason_id
);
# sales
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"sales_delivery_order_items to sales_reclamation_items",
qw(
id delivery_order_id reclamation_id itime mtime
cusordnumber marge_price_factor ordnumber transdate
description reason_description_ext reason_description_int reason_id
));
@different_record_item_values
);
} @sales_delivery_order_items, @converted_sales_reclamation_items;
test_deeply($sales_delivery_order->strip->as_tree, $converted_sales_reclamation->strip->as_tree,
"sales_delivery_order to sales_reclamation",
qw(
id employee_id itime mtime reqdate
order_type ordnumber oreqnumber
amount exchangerate netamount
cp_id contact_id
cusordnumber cv_record_number
donumber record_number
));
@different_record_values
);
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"sales_reclamation_items to sales_delivery_order_items",
qw(
id delivery_order_id reclamation_id itime mtime
cusordnumber marge_price_factor ordnumber transdate
description reason_description_ext reason_description_int reason_id
));
@different_record_item_values
);
} @sales_reclamation_items, @converted_sales_delivery_order_items;
test_deeply($sales_reclamation->strip->as_tree, $converted_sales_delivery_order->strip->as_tree,
"sales_reclamation to sales_delivery_order",
qw(
id employee_id itime mtime delivered reqdate
order_type ordnumber oreqnumber
amount exchangerate netamount
cp_id contact_id
cusordnumber cv_record_number
donumber record_number
));
@different_record_values
);
# purchase
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"purchase_delivery_order_items to purchase_reclamation_items",
qw(
id delivery_order_id reclamation_id itime mtime
cusordnumber marge_price_factor ordnumber transdate
description reason_description_ext reason_description_int reason_id
));
@different_record_item_values
);
} @purchase_delivery_order_items, @converted_purchase_reclamation_items;
test_deeply($purchase_delivery_order->strip->as_tree, $converted_purchase_reclamation->strip->as_tree,
"purchase_delivery_order to purchase_reclamation",
qw(
id employee_id itime mtime reqdate
order_type ordnumber oreqnumber
amount exchangerate netamount
cp_id contact_id
cusordnumber cv_record_number
donumber record_number
));
@different_record_values
);
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"purchase_reclamation_items to purchase_delivery_order_items",
qw(
id delivery_order_id reclamation_id itime mtime
cusordnumber marge_price_factor ordnumber transdate
description reason_description_ext reason_description_int reason_id
));
@different_record_item_values
);
} @purchase_reclamation_items, @converted_purchase_delivery_order_items;
test_deeply($purchase_reclamation->strip->as_tree, $converted_purchase_delivery_order->strip->as_tree,
"purchase_reclamation to purchase_delivery_order",
qw(
id employee_id itime mtime delivered reqdate
order_type ordnumber oreqnumber
amount exchangerate netamount
cp_id contact_id
cusordnumber cv_record_number
donumber record_number
));
@different_record_values
);
t/workflow/invoice_to_reclamation.t
my $purchase_reclamation_tmp = clone($purchase_reclamation);
# clean different values
foreach (qw(
customer_id vendor_id
record_type customer_id vendor_id
id record_number
salesman_id
transaction_description
......
## converted should be nearly the same
my @different_record_values = qw(
id employee_id itime mtime transdate
datepaid delivery_customer_id delivery_vendor_id deliverydate direct_debit donumber duedate dunning_config_id gldate invnumber_for_credit_note invoice marge_percent marge_total orddate ordnumber paid qr_reference qr_unstructured_message qrbill_without_amount quodate quonumber storno storno_id type
delivered closed exchangerate record_type reqdate vendor_id
cp_id contact_id
cusordnumber cv_record_number
invnumber record_number
);
my @different_record_item_values = qw(
id trans_id reclamation_id itime mtime
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate
reason_description_ext reason_description_int reason_id reqdate
);
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"sales_invoice_items to sales_reclamation_items",
qw(
id trans_id reclamation_id itime mtime
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate
reason_description_ext reason_description_int reason_id reqdate
));
@different_record_item_values
);
} @sales_invoice_items, @converted_sales_reclamation_items;
test_deeply($sales_invoice->strip->as_tree, $converted_sales_reclamation->strip->as_tree,
"sales_invoice to sales_reclamation",
qw(
@different_record_values
);
my @different_record_values2 = qw(
id employee_id itime mtime transdate
datepaid delivery_customer_id delivery_vendor_id deliverydate direct_debit donumber duedate dunning_config_id gldate invnumber_for_credit_note invoice marge_percent marge_total orddate ordnumber paid qr_reference qr_unstructured_message qrbill_without_amount quodate quonumber storno storno_id type
delivered closed exchangerate reqdate vendor_id
datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked
billing_address_id customer_id cv_record_number delivered closed exchangerate record_type reqdate salesman_id shippingpoint shipto_id
cp_id contact_id
cusordnumber cv_record_number
invnumber record_number
));
);
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"purchase_invoice_items to purchase_reclamation_items",
qw(
id trans_id reclamation_id itime mtime
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate
reason_description_ext reason_description_int reason_id reqdate
));
@different_record_item_values
);
} @purchase_invoice_items, @converted_purchase_reclamation_items;
test_deeply($purchase_invoice->strip->as_tree, $converted_purchase_reclamation->strip->as_tree,
"purchase_invoice to purchase_reclamation",
qw(
id employee_id itime mtime transdate
datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked
billing_address_id customer_id cv_record_number delivered closed exchangerate reqdate salesman_id shippingpoint shipto_id
cp_id contact_id
invnumber record_number
));
@different_record_values2
);
# diag Dumper($sales_invoice->strip->as_tree);
# diag Dumper($converted_sales_reclamation->strip->as_tree);
t/workflow/order_reclamation.t
my $purchase_reclamation_tmp = clone($purchase_reclamation);
# clean different values
foreach (qw(
customer_id vendor_id
record_type customer_id vendor_id
id record_number
salesman_id
transaction_description
......
my $purchase_order_tmp = clone($purchase_order);
# clean different values
foreach (qw(
customer_id vendor_id
record_type customer_id vendor_id
id
ordnumber salesman_id
transaction_description
......
## converted should be nealy the same
my @different_record_values = qw(
id record_type employee_id itime mtime reqdate transdate
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
cp_id contact_id
cusordnumber cv_record_number
ordnumber record_number
);
my @different_record_item_values = qw(
id trans_id reclamation_id itime mtime
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
reason_description_ext reason_description_int reason_id
recurring_billing_mode recurring_billing_invoice_id
);
# sales
pairwise {
test_deeply( $a->strip->as_tree, $b->strip->as_tree,
"sales_order_items to sales_reclamation_items",
qw(
id trans_id reclamation_id itime mtime
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
reason_description_ext reason_description_int reason_id
recurring_billing_mode recurring_billing_invoice_id
));
@different_record_item_values
);
} @sales_order_items, @converted_sales_reclamation_items;
test_deeply( $sales_order->strip->as_tree, $converted_sales_reclamation->strip->as_tree,
"sales_order to sales_reclamation",
qw(
id employee_id itime mtime reqdate transdate
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
cp_id contact_id
cusordnumber cv_record_number
ordnumber record_number
));
@different_record_values
);
pairwise {
test_deeply( $a->strip->as_tree, $b->strip->as_tree,
"sales_reclamation_items to sales_order_items",
qw(
id trans_id reclamation_id itime mtime
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
reason_description_ext reason_description_int reason_id
recurring_billing_mode recurring_billing_invoice_id
));
@different_record_item_values
);
} @sales_reclamation_items, @converted_sales_order_items;
test_deeply($sales_reclamation->strip->as_tree, $converted_sales_order->strip->as_tree,
"sales_reclamation to sales_order",
qw(
id employee_id itime mtime reqdate transdate
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
cp_id contact_id
cusordnumber cv_record_number
ordnumber record_number
));
@different_record_values
);
# purchase
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"purchase_order_items to purchase_reclamation_items",
qw(
id trans_id reclamation_id itime mtime
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
reason_description_ext reason_description_int reason_id
recurring_billing_mode recurring_billing_invoice_id
));
@different_record_item_values
);
} @purchase_order_items, @converted_purchase_reclamation_items;
test_deeply($purchase_order->strip->as_tree, $converted_purchase_reclamation->strip->as_tree,
"purchase_order to purchase_reclamation",
qw(
id employee_id itime mtime reqdate transdate
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
cp_id contact_id
cusordnumber cv_record_number
ordnumber record_number
));
@different_record_values
);
pairwise {
test_deeply($a->strip->as_tree, $b->strip->as_tree,
"purchase_reclamation_items to purchase_order_items",
qw(
id trans_id reclamation_id itime mtime
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
reason_description_ext reason_description_int reason_id
recurring_billing_mode recurring_billing_invoice_id
));
@different_record_item_values
);
} @purchase_reclamation_items, @converted_purchase_order_items;
test_deeply($purchase_reclamation->strip->as_tree, $converted_purchase_order->strip->as_tree,
"purchase_reclamation to purchase_order",
qw(
id employee_id itime mtime reqdate transdate
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
cp_id contact_id
cusordnumber cv_record_number
ordnumber record_number
));
@different_record_values
);
# diag Dumper($sales_order->strip->as_tree);
# diag Dumper($converted_sales_reclamation->strip->as_tree);
t/workflow/reclamation_reclamation.t
### TESTS #####################################################################
my @different_record_values = qw(
record_type customer_id vendor_id
id record_number transaction_description employee_id
itime mtime
);
my @different_record_item_values = qw(
id reclamation_id
itime mtime
);
## created sales und purchase reclamation should be nearly the same
my $sales_tmp = clone($sales_reclamation);
my $purchase_tmp = clone($purchase_reclamation);
# clean different values
foreach (qw(
customer_id vendor_id
id record_number transaction_description
itime mtime
)) {
foreach (@different_record_values) {
$sales_tmp->$_(undef);
$purchase_tmp->$_(undef);
}
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
foreach (qw(
id reclamation_id
itime mtime
)) {
foreach (@different_record_item_values) {
$first_tmp->$_(undef);
$second_tmp->$_(undef);
}
......
my $new_purchase_tmp = clone($new_purchase_reclamation);
my $purchase_tmp2 = clone($purchase_reclamation);
# clean different values
foreach (qw(
id record_number
reqdate employee_id transdate
itime mtime
)) {
foreach (@different_record_values) {
$new_sales_tmp->$_(undef);
$sales_tmp2->$_(undef);
$new_purchase_tmp->$_(undef);
......
}
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
foreach (qw(
id reclamation_id
itime mtime
)) {
foreach (@different_record_item_values) {
$first_tmp->$_(undef);
$second_tmp->$_(undef);
}
......
is_deeply($sales_tmp2->strip->as_tree, $new_sales_tmp->strip->as_tree);
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
foreach (qw(
id reclamation_id
itime mtime
)) {
foreach (@different_record_item_values) {
$first_tmp->$_(undef);
$second_tmp->$_(undef);
}
......
my $converted_sales_tmp = clone($converted_sales_reclamation);
my $purchase_tmp3 = clone($purchase_reclamation);
my $converted_purchase_tmp = clone($converted_purchase_reclamation);
# clean changing values
foreach (qw(
my @different_converted_record_values = qw(
transdate
record_type
customer_id vendor_id
id record_number
employee_id reqdate
......
delivery_term_id
payment_id
)) {
);
my @different_converted_record_item_values = qw(
id reclamation_id
sellprice discount lastcost
itime mtime
);
# clean changing values
foreach (@different_converted_record_values) {
$sales_tmp3->$_(undef);
$converted_sales_tmp->$_(undef);
$purchase_tmp3->$_(undef);
......
# from sales to purchase
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
foreach (qw(
id reclamation_id
sellprice discount
itime mtime
)) {
foreach (@different_converted_record_item_values) {
$first_tmp->$_(undef);
$second_tmp->$_(undef);
}
......
# from purchase to sales
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
foreach (qw(
id reclamation_id
lastcost
itime mtime
)) {
foreach (@different_converted_record_item_values) {
$first_tmp->$_(undef);
$second_tmp->$_(undef);
}

Auch abrufbar als: Unified diff