Revision 9c4876f7
Von Tamino Steinert vor 4 Monaten hinzugefügt
t/background_job/create_periodic_invoices.t | ||
---|---|---|
14 | 14 |
|
15 | 15 |
package main; |
16 | 16 |
|
17 |
use Test::More tests => 78;
|
|
17 |
use Test::More tests => 80;
|
|
18 | 18 |
|
19 | 19 |
use lib 't'; |
20 | 20 |
use strict; |
... | ... | |
299 | 299 |
} |
300 | 300 |
} |
301 | 301 |
); |
302 |
are_invoices 'p=y ovp=p i_p=m i_start_date', [ '01.01.2012', 3333.30 ], [ '01.01.2013', 3999.96 ], [ '01.01.2014', 3999.96];
|
|
302 |
are_invoices 'p=y ovp=p i_p=m i_start_date', [ '01.01.2013', 3666.63 ], [ '01.01.2014', 3999.96];
|
|
303 | 303 |
|
304 | 304 |
create_invoices( |
305 | 305 |
periodic_invoices_config => { |
... | ... | |
317 | 317 |
} |
318 | 318 |
} |
319 | 319 |
); |
320 |
are_invoices 'p=y ovp=p i_p=m i_start_date i_end_date',[ '01.01.2012', 3333.30 ], [ '01.01.2013', 3333.30];
|
|
320 |
are_invoices 'p=y ovp=p i_p=m i_start_date i_end_date',[ '01.01.2013', 3666.63 ], [ '01.01.2014', 2999.97];
|
|
321 | 321 |
|
322 | 322 |
create_invoices( |
323 | 323 |
periodic_invoices_config => { |
324 |
periodicity => 'y',
|
|
324 |
periodicity => 'm',
|
|
325 | 325 |
order_value_periodicity => 'p', |
326 |
start_date => DateTime->from_kivitendo('01.01.2012'),
|
|
327 |
end_date => DateTime->from_kivitendo('31.12.2012'),
|
|
328 |
extend_automatically_by => 12,
|
|
326 |
start_date => DateTime->from_kivitendo('01.01.2013'),
|
|
327 |
end_date => DateTime->from_kivitendo('31.01.2013'),
|
|
328 |
extend_automatically_by => 1, |
|
329 | 329 |
}, |
330 | 330 |
orderitem => { |
331 | 331 |
periodic_invoice_items_config => { |
332 |
periodicity => 'm', |
|
333 |
start_date => DateTime->from_kivitendo('01.03.2012'), |
|
334 |
end_date => DateTime->from_kivitendo('01.02.2012'), |
|
332 |
periodicity => 'n', |
|
335 | 333 |
} |
336 | 334 |
} |
337 | 335 |
); |
338 |
are_invoices 'p=y ovp=p i_p=m i_start_date after i_end_date';
|
|
336 |
are_invoices 'p=m ovp=p i_p=n';
|
|
339 | 337 |
|
340 | 338 |
create_invoices( |
341 | 339 |
periodic_invoices_config => { |
... | ... | |
347 | 345 |
}, |
348 | 346 |
orderitem => { |
349 | 347 |
periodic_invoice_items_config => { |
350 |
periodicity => 'n', |
|
348 |
periodicity => 'o', |
|
349 |
start_date => DateTime->from_kivitendo('01.03.2013'), |
|
351 | 350 |
} |
352 | 351 |
} |
353 | 352 |
); |
354 |
are_invoices 'p=m ovp=p i_p=n'; |
|
353 |
are_invoices 'p=m ovp=p i_p=o i_start_date', [ '01.03.2013', 333.33 ]; |
|
354 |
|
|
355 |
create_invoices( |
|
356 |
periodic_invoices_config => { |
|
357 |
periodicity => 'm', |
|
358 |
order_value_periodicity => 'p', |
|
359 |
start_date => DateTime->from_kivitendo('01.01.2013'), |
|
360 |
end_date => DateTime->from_kivitendo('31.01.2013'), |
|
361 |
}, |
|
362 |
orderitem => { |
|
363 |
periodic_invoice_items_config => { |
|
364 |
periodicity => 'm', |
|
365 |
start_date => DateTime->from_kivitendo('01.02.2013'), |
|
366 |
end_date => DateTime->from_kivitendo('28.02.2013'), |
|
367 |
} |
|
368 |
} |
|
369 |
); |
|
370 |
are_invoices 'p=m ovp=p i_p=m i_start_date i_end_date after', [ '01.02.2013', 333.33 ]; |
|
355 | 371 |
|
356 | 372 |
create_invoices( |
357 | 373 |
periodic_invoices_config => { |
... | ... | |
359 | 375 |
order_value_periodicity => 'p', |
360 | 376 |
start_date => DateTime->from_kivitendo('01.01.2013'), |
361 | 377 |
end_date => DateTime->from_kivitendo('31.01.2013'), |
362 |
extend_automatically_by => 1, |
|
363 | 378 |
}, |
364 | 379 |
orderitem => { |
365 | 380 |
periodic_invoice_items_config => { |
... | ... | |
368 | 383 |
} |
369 | 384 |
} |
370 | 385 |
); |
371 |
are_invoices 'p=m ovp=p i_p=o i_start_date', [ '01.03.2013', 333.33 ]; |
|
386 |
are_invoices 'p=m ovp=p i_p=o i_start_date after', [ '01.03.2013', 333.33 ];
|
|
372 | 387 |
|
373 | 388 |
clear_up(); |
374 | 389 |
|
Auch abrufbar als: Unified diff
t/b/create_periodic_invoices: Positionen richtig berechnen