X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fdb_helper%2Fprice_tax_calculator.t;h=98462641d3a6055fe681a60af90f785a34da4141;hb=0f15cf8a2fc968fe19bea1d678f961a23b6fe947;hp=f7aa9ab0ae92b3a611c73a0faaf310a10310a23a;hpb=1d34002dbf0a3ee90237f4373229a45ed890cd7f;p=kivitendo-erp.git diff --git a/t/db_helper/price_tax_calculator.t b/t/db_helper/price_tax_calculator.t index f7aa9ab0a..98462641d 100644 --- a/t/db_helper/price_tax_calculator.t +++ b/t/db_helper/price_tax_calculator.t @@ -14,22 +14,30 @@ use Test::Exception; use SL::DB::Buchungsgruppe; use SL::DB::Currency; use SL::DB::Customer; +use SL::DB::DeliveryOrder; use SL::DB::Employee; use SL::DB::Invoice; +use SL::DB::Order; use SL::DB::Part; use SL::DB::Unit; use SL::DB::TaxZone; my ($customer, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $taxzone); +sub clear_up { + SL::DB::Manager::Order->delete_all(all => 1); + SL::DB::Manager::DeliveryOrder->delete_all(all => 1); + SL::DB::Manager::Invoice->delete_all(all => 1); + SL::DB::Manager::Part->delete_all(all => 1); + SL::DB::Manager::Customer->delete_all(all => 1); +}; + sub reset_state { my %params = @_; $params{$_} ||= {} for qw(buchungsgruppe unit customer part tax); - SL::DB::Manager::Invoice->delete_all(all => 1); - SL::DB::Manager::Part->delete_all(all => 1); - SL::DB::Manager::Customer->delete_all(all => 1); + clear_up(); $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%"; @@ -372,4 +380,5 @@ test_default_invoice_one_item_19_tax_not_included(); test_default_invoice_two_items_19_7_tax_not_included(); test_default_invoice_three_items_sellprice_rounding_discount(); +clear_up(); done_testing();