Revision a38750d2
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t | ||
---|---|---|
37 | 37 |
|
38 | 38 |
our ($ar_chart, $buchungsgruppe, $ctrl, $currency_id, $customer, $employee, $order, $part, $tax_zone, $unit, @invoices); |
39 | 39 |
|
40 |
sub cleanup { |
|
41 |
"SL::DB::Manager::${_}"->delete_all(all => 1) for qw(InvoiceItem Invoice OrderItem Order Customer Part); |
|
42 |
} |
|
43 |
|
|
40 | 44 |
sub init_common_state { |
41 | 45 |
$ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; |
42 | 46 |
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; |
... | ... | |
49 | 53 |
sub create_sales_order { |
50 | 54 |
my %params = @_; |
51 | 55 |
|
52 |
$params{$_} ||= {} for qw(customer part tax order orderitem);
|
|
56 |
cleanup();
|
|
53 | 57 |
|
54 |
# Clean up: remove invoices, orders, parts and customers |
|
55 |
"SL::DB::Manager::${_}"->delete_all(all => 1) for qw(InvoiceItem Invoice OrderItem Order Customer Part); |
|
58 |
$params{$_} ||= {} for qw(customer part tax order orderitem); |
|
56 | 59 |
|
57 | 60 |
$customer = SL::DB::Customer->new( |
58 | 61 |
name => 'Test Customer', |
... | ... | |
545 | 548 |
end_date => DateTime->from_kivitendo('30.04.2014'), |
546 | 549 |
}); |
547 | 550 |
|
551 |
cleanup(); |
|
548 | 552 |
|
549 | 553 |
done_testing(); |
Auch abrufbar als: Unified diff
sales_order_with_periodic_invoices_config.t: nach Test aufräumen