Revision 65063570
Von Tamino Steinert vor fast 2 Jahren hinzugefügt
t/workflow/delivery_order_reclamation.t | ||
---|---|---|
214 | 214 |
my $purchase_reclamation_tmp = clone($purchase_reclamation); |
215 | 215 |
# clean different values |
216 | 216 |
foreach (qw( |
217 |
customer_id vendor_id |
|
217 |
record_type customer_id vendor_id
|
|
218 | 218 |
id record_number |
219 | 219 |
salesman_id |
220 | 220 |
transaction_description |
... | ... | |
277 | 277 |
|
278 | 278 |
|
279 | 279 |
## converted should be nearly the same |
280 |
my @different_record_values = qw( |
|
281 |
id employee_id itime mtime reqdate |
|
282 |
order_type ordnumber oreqnumber |
|
283 |
amount exchangerate netamount |
|
284 |
order_type record_type |
|
285 |
cp_id contact_id |
|
286 |
cusordnumber cv_record_number |
|
287 |
donumber record_number |
|
288 |
); |
|
289 |
my @different_record_item_values = qw( |
|
290 |
id delivery_order_id reclamation_id itime mtime |
|
291 |
cusordnumber marge_price_factor ordnumber transdate |
|
292 |
description reason_description_ext reason_description_int reason_id |
|
293 |
); |
|
294 |
|
|
280 | 295 |
# sales |
281 | 296 |
pairwise { |
282 | 297 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
283 | 298 |
"sales_delivery_order_items to sales_reclamation_items", |
284 |
qw( |
|
285 |
id delivery_order_id reclamation_id itime mtime |
|
286 |
cusordnumber marge_price_factor ordnumber transdate |
|
287 |
description reason_description_ext reason_description_int reason_id |
|
288 |
)); |
|
299 |
@different_record_item_values |
|
300 |
); |
|
289 | 301 |
} @sales_delivery_order_items, @converted_sales_reclamation_items; |
290 | 302 |
test_deeply($sales_delivery_order->strip->as_tree, $converted_sales_reclamation->strip->as_tree, |
291 | 303 |
"sales_delivery_order to sales_reclamation", |
292 |
qw( |
|
293 |
id employee_id itime mtime reqdate |
|
294 |
order_type ordnumber oreqnumber |
|
295 |
amount exchangerate netamount |
|
296 |
cp_id contact_id |
|
297 |
cusordnumber cv_record_number |
|
298 |
donumber record_number |
|
299 |
)); |
|
304 |
@different_record_values |
|
305 |
); |
|
300 | 306 |
|
301 | 307 |
pairwise { |
302 | 308 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
303 | 309 |
"sales_reclamation_items to sales_delivery_order_items", |
304 |
qw( |
|
305 |
id delivery_order_id reclamation_id itime mtime |
|
306 |
cusordnumber marge_price_factor ordnumber transdate |
|
307 |
description reason_description_ext reason_description_int reason_id |
|
308 |
)); |
|
310 |
@different_record_item_values |
|
311 |
); |
|
309 | 312 |
} @sales_reclamation_items, @converted_sales_delivery_order_items; |
310 | 313 |
test_deeply($sales_reclamation->strip->as_tree, $converted_sales_delivery_order->strip->as_tree, |
311 | 314 |
"sales_reclamation to sales_delivery_order", |
312 |
qw( |
|
313 |
id employee_id itime mtime delivered reqdate |
|
314 |
order_type ordnumber oreqnumber |
|
315 |
amount exchangerate netamount |
|
316 |
cp_id contact_id |
|
317 |
cusordnumber cv_record_number |
|
318 |
donumber record_number |
|
319 |
)); |
|
315 |
@different_record_values |
|
316 |
); |
|
320 | 317 |
|
321 | 318 |
|
322 | 319 |
# purchase |
323 | 320 |
pairwise { |
324 | 321 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
325 | 322 |
"purchase_delivery_order_items to purchase_reclamation_items", |
326 |
qw( |
|
327 |
id delivery_order_id reclamation_id itime mtime |
|
328 |
cusordnumber marge_price_factor ordnumber transdate |
|
329 |
description reason_description_ext reason_description_int reason_id |
|
330 |
)); |
|
323 |
@different_record_item_values |
|
324 |
); |
|
331 | 325 |
} @purchase_delivery_order_items, @converted_purchase_reclamation_items; |
332 | 326 |
test_deeply($purchase_delivery_order->strip->as_tree, $converted_purchase_reclamation->strip->as_tree, |
333 | 327 |
"purchase_delivery_order to purchase_reclamation", |
334 |
qw( |
|
335 |
id employee_id itime mtime reqdate |
|
336 |
order_type ordnumber oreqnumber |
|
337 |
amount exchangerate netamount |
|
338 |
cp_id contact_id |
|
339 |
cusordnumber cv_record_number |
|
340 |
donumber record_number |
|
341 |
)); |
|
328 |
@different_record_values |
|
329 |
); |
|
342 | 330 |
|
343 | 331 |
pairwise { |
344 | 332 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
345 | 333 |
"purchase_reclamation_items to purchase_delivery_order_items", |
346 |
qw( |
|
347 |
id delivery_order_id reclamation_id itime mtime |
|
348 |
cusordnumber marge_price_factor ordnumber transdate |
|
349 |
description reason_description_ext reason_description_int reason_id |
|
350 |
)); |
|
334 |
@different_record_item_values |
|
335 |
); |
|
351 | 336 |
} @purchase_reclamation_items, @converted_purchase_delivery_order_items; |
352 | 337 |
test_deeply($purchase_reclamation->strip->as_tree, $converted_purchase_delivery_order->strip->as_tree, |
353 | 338 |
"purchase_reclamation to purchase_delivery_order", |
354 |
qw( |
|
355 |
id employee_id itime mtime delivered reqdate |
|
356 |
order_type ordnumber oreqnumber |
|
357 |
amount exchangerate netamount |
|
358 |
cp_id contact_id |
|
359 |
cusordnumber cv_record_number |
|
360 |
donumber record_number |
|
361 |
)); |
|
339 |
@different_record_values |
|
340 |
); |
|
362 | 341 |
|
363 | 342 |
|
364 | 343 |
|
t/workflow/invoice_to_reclamation.t | ||
---|---|---|
207 | 207 |
my $purchase_reclamation_tmp = clone($purchase_reclamation); |
208 | 208 |
# clean different values |
209 | 209 |
foreach (qw( |
210 |
customer_id vendor_id |
|
210 |
record_type customer_id vendor_id
|
|
211 | 211 |
id record_number |
212 | 212 |
salesman_id |
213 | 213 |
transaction_description |
... | ... | |
236 | 236 |
|
237 | 237 |
|
238 | 238 |
## converted should be nearly the same |
239 |
my @different_record_values = qw( |
|
240 |
id employee_id itime mtime transdate |
|
241 |
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 |
|
242 |
delivered closed exchangerate record_type reqdate vendor_id |
|
243 |
cp_id contact_id |
|
244 |
cusordnumber cv_record_number |
|
245 |
invnumber record_number |
|
246 |
); |
|
247 |
my @different_record_item_values = qw( |
|
248 |
id trans_id reclamation_id itime mtime |
|
249 |
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate |
|
250 |
reason_description_ext reason_description_int reason_id reqdate |
|
251 |
); |
|
239 | 252 |
pairwise { |
240 | 253 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
241 | 254 |
"sales_invoice_items to sales_reclamation_items", |
242 |
qw( |
|
243 |
id trans_id reclamation_id itime mtime |
|
244 |
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate |
|
245 |
reason_description_ext reason_description_int reason_id reqdate |
|
246 |
)); |
|
255 |
@different_record_item_values |
|
256 |
); |
|
247 | 257 |
} @sales_invoice_items, @converted_sales_reclamation_items; |
248 | 258 |
test_deeply($sales_invoice->strip->as_tree, $converted_sales_reclamation->strip->as_tree, |
249 | 259 |
"sales_invoice to sales_reclamation", |
250 |
qw( |
|
260 |
@different_record_values |
|
261 |
); |
|
262 |
|
|
263 |
|
|
264 |
my @different_record_values2 = qw( |
|
251 | 265 |
id employee_id itime mtime transdate |
252 |
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
|
|
253 |
delivered closed exchangerate reqdate vendor_id
|
|
266 |
datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked
|
|
267 |
billing_address_id customer_id cv_record_number delivered closed exchangerate record_type reqdate salesman_id shippingpoint shipto_id
|
|
254 | 268 |
cp_id contact_id |
255 |
cusordnumber cv_record_number |
|
256 | 269 |
invnumber record_number |
257 |
)); |
|
258 |
|
|
270 |
); |
|
259 | 271 |
pairwise { |
260 | 272 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
261 | 273 |
"purchase_invoice_items to purchase_reclamation_items", |
262 |
qw( |
|
263 |
id trans_id reclamation_id itime mtime |
|
264 |
allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate |
|
265 |
reason_description_ext reason_description_int reason_id reqdate |
|
266 |
)); |
|
274 |
@different_record_item_values |
|
275 |
); |
|
267 | 276 |
} @purchase_invoice_items, @converted_purchase_reclamation_items; |
268 | 277 |
test_deeply($purchase_invoice->strip->as_tree, $converted_purchase_reclamation->strip->as_tree, |
269 | 278 |
"purchase_invoice to purchase_reclamation", |
270 |
qw( |
|
271 |
id employee_id itime mtime transdate |
|
272 |
datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked |
|
273 |
billing_address_id customer_id cv_record_number delivered closed exchangerate reqdate salesman_id shippingpoint shipto_id |
|
274 |
cp_id contact_id |
|
275 |
invnumber record_number |
|
276 |
)); |
|
279 |
@different_record_values2 |
|
280 |
); |
|
277 | 281 |
|
278 | 282 |
# diag Dumper($sales_invoice->strip->as_tree); |
279 | 283 |
# diag Dumper($converted_sales_reclamation->strip->as_tree); |
t/workflow/order_reclamation.t | ||
---|---|---|
214 | 214 |
my $purchase_reclamation_tmp = clone($purchase_reclamation); |
215 | 215 |
# clean different values |
216 | 216 |
foreach (qw( |
217 |
customer_id vendor_id |
|
217 |
record_type customer_id vendor_id
|
|
218 | 218 |
id record_number |
219 | 219 |
salesman_id |
220 | 220 |
transaction_description |
... | ... | |
241 | 241 |
my $purchase_order_tmp = clone($purchase_order); |
242 | 242 |
# clean different values |
243 | 243 |
foreach (qw( |
244 |
customer_id vendor_id |
|
244 |
record_type customer_id vendor_id
|
|
245 | 245 |
id |
246 | 246 |
ordnumber salesman_id |
247 | 247 |
transaction_description |
... | ... | |
278 | 278 |
|
279 | 279 |
|
280 | 280 |
## converted should be nealy the same |
281 |
my @different_record_values = qw( |
|
282 |
id record_type employee_id itime mtime reqdate transdate |
|
283 |
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation |
|
284 |
cp_id contact_id |
|
285 |
cusordnumber cv_record_number |
|
286 |
ordnumber record_number |
|
287 |
); |
|
288 |
my @different_record_item_values = qw( |
|
289 |
id trans_id reclamation_id itime mtime |
|
290 |
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate |
|
291 |
reason_description_ext reason_description_int reason_id |
|
292 |
recurring_billing_mode recurring_billing_invoice_id |
|
293 |
); |
|
281 | 294 |
# sales |
282 | 295 |
pairwise { |
283 | 296 |
test_deeply( $a->strip->as_tree, $b->strip->as_tree, |
284 | 297 |
"sales_order_items to sales_reclamation_items", |
285 |
qw( |
|
286 |
id trans_id reclamation_id itime mtime |
|
287 |
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate |
|
288 |
reason_description_ext reason_description_int reason_id |
|
289 |
recurring_billing_mode recurring_billing_invoice_id |
|
290 |
)); |
|
298 |
@different_record_item_values |
|
299 |
); |
|
291 | 300 |
} @sales_order_items, @converted_sales_reclamation_items; |
292 | 301 |
test_deeply( $sales_order->strip->as_tree, $converted_sales_reclamation->strip->as_tree, |
293 | 302 |
"sales_order to sales_reclamation", |
294 |
qw( |
|
295 |
id employee_id itime mtime reqdate transdate |
|
296 |
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation |
|
297 |
cp_id contact_id |
|
298 |
cusordnumber cv_record_number |
|
299 |
ordnumber record_number |
|
300 |
)); |
|
303 |
@different_record_values |
|
304 |
); |
|
301 | 305 |
|
302 | 306 |
pairwise { |
303 | 307 |
test_deeply( $a->strip->as_tree, $b->strip->as_tree, |
304 | 308 |
"sales_reclamation_items to sales_order_items", |
305 |
qw( |
|
306 |
id trans_id reclamation_id itime mtime |
|
307 |
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate |
|
308 |
reason_description_ext reason_description_int reason_id |
|
309 |
recurring_billing_mode recurring_billing_invoice_id |
|
310 |
)); |
|
309 |
@different_record_item_values |
|
310 |
); |
|
311 | 311 |
} @sales_reclamation_items, @converted_sales_order_items; |
312 | 312 |
test_deeply($sales_reclamation->strip->as_tree, $converted_sales_order->strip->as_tree, |
313 | 313 |
"sales_reclamation to sales_order", |
314 |
qw( |
|
315 |
id employee_id itime mtime reqdate transdate |
|
316 |
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation |
|
317 |
cp_id contact_id |
|
318 |
cusordnumber cv_record_number |
|
319 |
ordnumber record_number |
|
320 |
)); |
|
314 |
@different_record_values |
|
315 |
); |
|
321 | 316 |
|
322 | 317 |
# purchase |
323 | 318 |
pairwise { |
324 | 319 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
325 | 320 |
"purchase_order_items to purchase_reclamation_items", |
326 |
qw( |
|
327 |
id trans_id reclamation_id itime mtime |
|
328 |
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate |
|
329 |
reason_description_ext reason_description_int reason_id |
|
330 |
recurring_billing_mode recurring_billing_invoice_id |
|
331 |
)); |
|
321 |
@different_record_item_values |
|
322 |
); |
|
332 | 323 |
} @purchase_order_items, @converted_purchase_reclamation_items; |
333 | 324 |
test_deeply($purchase_order->strip->as_tree, $converted_purchase_reclamation->strip->as_tree, |
334 | 325 |
"purchase_order to purchase_reclamation", |
335 |
qw( |
|
336 |
id employee_id itime mtime reqdate transdate |
|
337 |
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation |
|
338 |
cp_id contact_id |
|
339 |
cusordnumber cv_record_number |
|
340 |
ordnumber record_number |
|
341 |
)); |
|
326 |
@different_record_values |
|
327 |
); |
|
342 | 328 |
|
343 | 329 |
pairwise { |
344 | 330 |
test_deeply($a->strip->as_tree, $b->strip->as_tree, |
345 | 331 |
"purchase_reclamation_items to purchase_order_items", |
346 |
qw( |
|
347 |
id trans_id reclamation_id itime mtime |
|
348 |
cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate |
|
349 |
reason_description_ext reason_description_int reason_id |
|
350 |
recurring_billing_mode recurring_billing_invoice_id |
|
351 |
)); |
|
332 |
@different_record_item_values |
|
333 |
); |
|
352 | 334 |
} @purchase_reclamation_items, @converted_purchase_order_items; |
353 | 335 |
test_deeply($purchase_reclamation->strip->as_tree, $converted_purchase_order->strip->as_tree, |
354 | 336 |
"purchase_reclamation to purchase_order", |
355 |
qw( |
|
356 |
id employee_id itime mtime reqdate transdate |
|
357 |
delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation |
|
358 |
cp_id contact_id |
|
359 |
cusordnumber cv_record_number |
|
360 |
ordnumber record_number |
|
361 |
)); |
|
337 |
@different_record_values |
|
338 |
); |
|
362 | 339 |
|
363 | 340 |
# diag Dumper($sales_order->strip->as_tree); |
364 | 341 |
# diag Dumper($converted_sales_reclamation->strip->as_tree); |
t/workflow/reclamation_reclamation.t | ||
---|---|---|
174 | 174 |
|
175 | 175 |
### TESTS ##################################################################### |
176 | 176 |
|
177 |
my @different_record_values = qw( |
|
178 |
record_type customer_id vendor_id |
|
179 |
id record_number transaction_description employee_id |
|
180 |
itime mtime |
|
181 |
); |
|
182 |
|
|
183 |
my @different_record_item_values = qw( |
|
184 |
id reclamation_id |
|
185 |
itime mtime |
|
186 |
); |
|
187 |
|
|
177 | 188 |
## created sales und purchase reclamation should be nearly the same |
178 | 189 |
my $sales_tmp = clone($sales_reclamation); |
179 | 190 |
my $purchase_tmp = clone($purchase_reclamation); |
180 | 191 |
# clean different values |
181 |
foreach (qw( |
|
182 |
customer_id vendor_id |
|
183 |
id record_number transaction_description |
|
184 |
itime mtime |
|
185 |
)) { |
|
192 |
foreach (@different_record_values) { |
|
186 | 193 |
$sales_tmp->$_(undef); |
187 | 194 |
$purchase_tmp->$_(undef); |
188 | 195 |
} |
189 | 196 |
|
190 | 197 |
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b); |
191 |
foreach (qw( |
|
192 |
id reclamation_id |
|
193 |
itime mtime |
|
194 |
)) { |
|
198 |
foreach (@different_record_item_values) { |
|
195 | 199 |
$first_tmp->$_(undef); |
196 | 200 |
$second_tmp->$_(undef); |
197 | 201 |
} |
... | ... | |
220 | 224 |
my $new_purchase_tmp = clone($new_purchase_reclamation); |
221 | 225 |
my $purchase_tmp2 = clone($purchase_reclamation); |
222 | 226 |
# clean different values |
223 |
foreach (qw( |
|
224 |
id record_number |
|
225 |
reqdate employee_id transdate |
|
226 |
itime mtime |
|
227 |
)) { |
|
227 |
foreach (@different_record_values) { |
|
228 | 228 |
$new_sales_tmp->$_(undef); |
229 | 229 |
$sales_tmp2->$_(undef); |
230 | 230 |
$new_purchase_tmp->$_(undef); |
... | ... | |
232 | 232 |
} |
233 | 233 |
|
234 | 234 |
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b); |
235 |
foreach (qw( |
|
236 |
id reclamation_id |
|
237 |
itime mtime |
|
238 |
)) { |
|
235 |
foreach (@different_record_item_values) { |
|
239 | 236 |
$first_tmp->$_(undef); |
240 | 237 |
$second_tmp->$_(undef); |
241 | 238 |
} |
... | ... | |
244 | 241 |
is_deeply($sales_tmp2->strip->as_tree, $new_sales_tmp->strip->as_tree); |
245 | 242 |
|
246 | 243 |
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b); |
247 |
foreach (qw( |
|
248 |
id reclamation_id |
|
249 |
itime mtime |
|
250 |
)) { |
|
244 |
foreach (@different_record_item_values) { |
|
251 | 245 |
$first_tmp->$_(undef); |
252 | 246 |
$second_tmp->$_(undef); |
253 | 247 |
} |
... | ... | |
261 | 255 |
my $converted_sales_tmp = clone($converted_sales_reclamation); |
262 | 256 |
my $purchase_tmp3 = clone($purchase_reclamation); |
263 | 257 |
my $converted_purchase_tmp = clone($converted_purchase_reclamation); |
264 |
# clean changing values |
|
265 |
foreach (qw(
|
|
258 |
|
|
259 |
my @different_converted_record_values = qw(
|
|
266 | 260 |
transdate |
261 |
record_type |
|
267 | 262 |
customer_id vendor_id |
268 | 263 |
id record_number |
269 | 264 |
employee_id reqdate |
... | ... | |
271 | 266 |
|
272 | 267 |
delivery_term_id |
273 | 268 |
payment_id |
274 |
)) { |
|
269 |
); |
|
270 |
|
|
271 |
my @different_converted_record_item_values = qw( |
|
272 |
id reclamation_id |
|
273 |
sellprice discount lastcost |
|
274 |
itime mtime |
|
275 |
); |
|
276 |
|
|
277 |
# clean changing values |
|
278 |
foreach (@different_converted_record_values) { |
|
275 | 279 |
$sales_tmp3->$_(undef); |
276 | 280 |
$converted_sales_tmp->$_(undef); |
277 | 281 |
$purchase_tmp3->$_(undef); |
... | ... | |
280 | 284 |
|
281 | 285 |
# from sales to purchase |
282 | 286 |
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b); |
283 |
foreach (qw( |
|
284 |
id reclamation_id |
|
285 |
sellprice discount |
|
286 |
itime mtime |
|
287 |
)) { |
|
287 |
foreach (@different_converted_record_item_values) { |
|
288 | 288 |
$first_tmp->$_(undef); |
289 | 289 |
$second_tmp->$_(undef); |
290 | 290 |
} |
... | ... | |
295 | 295 |
|
296 | 296 |
# from purchase to sales |
297 | 297 |
pairwise { my $first_tmp = clone($a); my $second_tmp = clone($b); |
298 |
foreach (qw( |
|
299 |
id reclamation_id |
|
300 |
lastcost |
|
301 |
itime mtime |
|
302 |
)) { |
|
298 |
foreach (@different_converted_record_item_values) { |
|
303 | 299 |
$first_tmp->$_(undef); |
304 | 300 |
$second_tmp->$_(undef); |
305 | 301 |
} |
Auch abrufbar als: Unified diff
t/workflow: Tests für Record-Type angepasst