Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 333daa0d

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 333daa0dbe03bb04a3bd86d6fd2d576cb84d3fc2
  • Vorgänger 7d7ab469
  • Nachfolger bec63527

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

Unterschiede anzeigen:

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 expense_chart_id tax_id inventory_chart_id
250
  reason_description_ext reason_description_int reason_id reqdate
251
  tax_chart_type
252
);
239 253
pairwise {
240 254
  test_deeply($a->strip->as_tree, $b->strip->as_tree,
241 255
    "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 expense_chart_id tax_id inventory_chart_id
245
      reason_description_ext reason_description_int reason_id reqdate
246
      tax_chart_type
247
    ));
256
    @different_record_item_values
257
  );
248 258
} @sales_invoice_items, @converted_sales_reclamation_items;
249 259
test_deeply($sales_invoice->strip->as_tree, $converted_sales_reclamation->strip->as_tree,
250 260
  "sales_invoice to sales_reclamation",
251
  qw(
261
  @different_record_values
262
);
263

  
264

  
265
my @different_record_values2 = qw(
252 266
    id employee_id itime mtime transdate
253
    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
254
    delivered closed exchangerate reqdate vendor_id
267
    datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked
268
    billing_address_id customer_id cv_record_number delivered closed exchangerate record_type reqdate salesman_id shippingpoint shipto_id
255 269
    cp_id contact_id
256
    cusordnumber cv_record_number
257
    invnumber record_number
258
  ));
259

  
270
    invnumber record_number qrbill_data
271
);
260 272
pairwise {
261 273
  test_deeply($a->strip->as_tree, $b->strip->as_tree,
262 274
    "purchase_invoice_items to purchase_reclamation_items",
263
    qw(
264
      id trans_id reclamation_id itime mtime
265
      allocated assemblyitem cusordnumber deliverydate donumber fxsellprice marge_percent marge_price_factor marge_total optional ordnumber subtotal transdate expense_chart_id tax_id inventory_chart_id
266
      reason_description_ext reason_description_int reason_id reqdate
267
      tax_chart_type
268
    ));
275
    @different_record_item_values
276
  );
269 277
} @purchase_invoice_items, @converted_purchase_reclamation_items;
270 278
test_deeply($purchase_invoice->strip->as_tree, $converted_purchase_reclamation->strip->as_tree,
271 279
  "purchase_invoice to purchase_reclamation",
272
  qw(
273
    id employee_id itime mtime transdate
274
    datepaid deliverydate direct_debit duedate gldate invoice orddate ordnumber paid quodate quonumber storno storno_id type is_sepa_blocked
275
    billing_address_id customer_id cv_record_number delivered closed exchangerate reqdate salesman_id shippingpoint shipto_id
276
    cp_id contact_id
277
    invnumber record_number qrbill_data
278
  ));
280
  @different_record_values2
281
);
279 282

  
280 283
# diag Dumper($sales_invoice->strip->as_tree);
281 284
# 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
  intake
288
);
289
my @different_record_item_values = qw(
290
  id trans_id reclamation_id itime mtime
291
  cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
292
  reason_description_ext reason_description_int reason_id
293
  recurring_billing_mode recurring_billing_invoice_id
294
);
281 295
# sales
282 296
pairwise {
283 297
  test_deeply( $a->strip->as_tree, $b->strip->as_tree,
284 298
    "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
    ));
299
    @different_record_item_values
300
  );
291 301
} @sales_order_items, @converted_sales_reclamation_items;
292 302
test_deeply( $sales_order->strip->as_tree, $converted_sales_reclamation->strip->as_tree,
293 303
  "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
    intake
301
  ));
304
  @different_record_values
305
);
302 306

  
303 307
pairwise {
304 308
  test_deeply( $a->strip->as_tree, $b->strip->as_tree,
305 309
    "sales_reclamation_items to sales_order_items",
306
    qw(
307
      id trans_id reclamation_id itime mtime
308
      cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
309
      reason_description_ext reason_description_int reason_id
310
      recurring_billing_mode recurring_billing_invoice_id
311
    ));
310
    @different_record_item_values
311
  );
312 312
} @sales_reclamation_items, @converted_sales_order_items;
313 313
test_deeply($sales_reclamation->strip->as_tree, $converted_sales_order->strip->as_tree,
314 314
  "sales_reclamation to sales_order",
315
  qw(
316
    id employee_id itime mtime reqdate transdate
317
    delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
318
    cp_id contact_id
319
    cusordnumber cv_record_number
320
    ordnumber record_number
321
    intake
322
  ));
315
  @different_record_values
316
);
323 317

  
324 318
# purchase
325 319
pairwise {
326 320
  test_deeply($a->strip->as_tree, $b->strip->as_tree,
327 321
    "purchase_order_items to purchase_reclamation_items",
328
    qw(
329
      id trans_id reclamation_id itime mtime
330
      cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
331
      reason_description_ext reason_description_int reason_id
332
      recurring_billing_mode recurring_billing_invoice_id
333
    ));
322
    @different_record_item_values
323
  );
334 324
} @purchase_order_items, @converted_purchase_reclamation_items;
335 325
test_deeply($purchase_order->strip->as_tree, $converted_purchase_reclamation->strip->as_tree,
336 326
  "purchase_order to purchase_reclamation",
337
  qw(
338
    id employee_id itime mtime reqdate transdate
339
    delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
340
    cp_id contact_id
341
    cusordnumber cv_record_number
342
    ordnumber record_number
343
    intake
344
  ));
327
  @different_record_values
328
);
345 329

  
346 330
pairwise {
347 331
  test_deeply($a->strip->as_tree, $b->strip->as_tree,
348 332
    "purchase_reclamation_items to purchase_order_items",
349
    qw(
350
      id trans_id reclamation_id itime mtime
351
      cusordnumber marge_percent marge_price_factor marge_total optional ordnumber ship subtotal transdate
352
      reason_description_ext reason_description_int reason_id
353
      recurring_billing_mode recurring_billing_invoice_id
354
    ));
333
    @different_record_item_values
334
  );
355 335
} @purchase_reclamation_items, @converted_purchase_order_items;
356 336
test_deeply($purchase_reclamation->strip->as_tree, $converted_purchase_order->strip->as_tree,
357 337
  "purchase_reclamation to purchase_order",
358
  qw(
359
    id employee_id itime mtime reqdate transdate
360
    delivery_customer_id delivery_vendor_id expected_billing_date marge_percent marge_total order_probability order_status_id proforma quonumber quotation
361
    cp_id contact_id
362
    cusordnumber cv_record_number
363
    ordnumber record_number
364
    intake
365
  ));
338
  @different_record_values
339
);
366 340

  
367 341
# diag Dumper($sales_order->strip->as_tree);
368 342
# 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