commit 65063570dbbb5705428e01be618d940fb9d5c853
Author: Tamino Steinert <tamino.steinert@tamino.st>
Date:   Mon Mar 6 13:04:26 2023 +0100

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

diff --git a/t/workflow/delivery_order_reclamation.t b/t/workflow/delivery_order_reclamation.t
index e8bd9d0f2..3b120d2b7 100644
--- a/t/workflow/delivery_order_reclamation.t
+++ b/t/workflow/delivery_order_reclamation.t
@@ -214,7 +214,7 @@ my $sales_reclamation_tmp = clone($sales_reclamation);
 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
@@ -277,88 +277,67 @@ is_deeply($linked_purchase_reclamation->strip->as_tree, $purchase_reclamation->l
 
 
 ## 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
+);
 
 
 
diff --git a/t/workflow/invoice_to_reclamation.t b/t/workflow/invoice_to_reclamation.t
index 23b4c142b..a3662825d 100644
--- a/t/workflow/invoice_to_reclamation.t
+++ b/t/workflow/invoice_to_reclamation.t
@@ -207,7 +207,7 @@ my $sales_reclamation_tmp = clone($sales_reclamation);
 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
@@ -236,44 +236,48 @@ is_deeply($linked_purchase_invoice->strip->as_tree, $purchase_invoice->strip->as
 
 
 ## 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);
diff --git a/t/workflow/order_reclamation.t b/t/workflow/order_reclamation.t
index eda589f4e..d9c1cef44 100644
--- a/t/workflow/order_reclamation.t
+++ b/t/workflow/order_reclamation.t
@@ -214,7 +214,7 @@ my $sales_reclamation_tmp = clone($sales_reclamation);
 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
@@ -241,7 +241,7 @@ my $sales_order_tmp = clone($sales_order);
 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
@@ -278,87 +278,64 @@ is_deeply($linked_purchase_reclamation->strip->as_tree, $purchase_reclamation->l
 
 
 ## 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);
diff --git a/t/workflow/reclamation_reclamation.t b/t/workflow/reclamation_reclamation.t
index 6a9a8d2f6..c15c28fd8 100644
--- a/t/workflow/reclamation_reclamation.t
+++ b/t/workflow/reclamation_reclamation.t
@@ -174,24 +174,28 @@ my @converted_sales_reclamation_items    = @{$converted_sales_reclamation->items
 
 ### 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);
   }
@@ -220,11 +224,7 @@ my $sales_tmp2 = clone($sales_reclamation);
 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);
@@ -232,10 +232,7 @@ foreach (qw(
 }
 
 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);
   }
@@ -244,10 +241,7 @@ pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b);
 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);
   }
@@ -261,9 +255,10 @@ my $sales_tmp3 = clone($sales_reclamation);
 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
@@ -271,7 +266,16 @@ foreach (qw(
 
   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);
@@ -280,11 +284,7 @@ foreach (qw(
 
 # 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);
   }
@@ -295,11 +295,7 @@ is_deeply($sales_tmp3->strip->as_tree, $converted_purchase_tmp->strip->as_tree);
 
 # 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);
   }
