From: G. Richardson Date: Fri, 8 Aug 2014 11:50:23 +0000 (+0200) Subject: Steuerzone - neue Customer/Vendor-Objekte brauchen Steuerzone X-Git-Tag: release-3.2.0beta~354 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f358c83ee0b94481a25c66f1d9f2931684c74552;p=kivitendo-erp.git Steuerzone - neue Customer/Vendor-Objekte brauchen Steuerzone Durch den not-NULL Constraint bei Kunden und Lieferanten muß beim Anlegen eines neuen Objekts nun zwingend die Steuerzone mit übergeben werden, ähnlich wie bei der Währung. Dies wurde bei einigen automatischen Tests nachgeholt. --- diff --git a/t/db_helper/acts_as_list.t b/t/db_helper/acts_as_list.t index 53338f757..a91724cce 100644 --- a/t/db_helper/acts_as_list.t +++ b/t/db_helper/acts_as_list.t @@ -6,8 +6,10 @@ use strict; use lib 't'; use utf8; +use Carp; use Data::Dumper; use Support::TestSetup; +use SL::DB::TaxZone; eval { require SL::DB::RequirementSpec; @@ -24,10 +26,12 @@ if ($skip) { plan tests => 48; } -my ($customer, $status, $type, $r_spec, @items); +my ($customer, $taxzone, $status, $type, $r_spec, @items); + sub init { - $customer = SL::DB::Customer->new(name => 'Test Customer', currency_id => $::instance_conf->get_currency_id)->save; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $customer = SL::DB::Customer->new(name => 'Test Customer', currency_id => $::instance_conf->get_currency_id, taxzone_id => $taxzone->id)->save; $status = SL::DB::Manager::RequirementSpecStatus->find_by(name => '', description => '') || SL::DB::RequirementSpecStatus->new(name => '', description => '', position => 0)->save; $type = SL::DB::Manager::RequirementSpecType->find_by(description => '') || diff --git a/t/db_helper/price_tax_calculator.t b/t/db_helper/price_tax_calculator.t index 4bf9ab863..8ec8d1c90 100644 --- a/t/db_helper/price_tax_calculator.t +++ b/t/db_helper/price_tax_calculator.t @@ -17,6 +17,7 @@ use SL::DB::Employee; use SL::DB::Invoice; use SL::DB::Part; use SL::DB::Unit; +use SL::DB::TaxZone; my ($customer, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $taxzone); @@ -42,6 +43,7 @@ sub reset_state { $customer = SL::DB::Customer->new( name => 'Test Customer', currency_id => $currency_id, + taxzone_id => $taxzone->id, %{ $params{customer} } )->save; diff --git a/t/db_helper/record_links.t b/t/db_helper/record_links.t index e7dd31b18..edfcf72fd 100644 --- a/t/db_helper/record_links.t +++ b/t/db_helper/record_links.t @@ -45,12 +45,14 @@ sub reset_state { $customer = SL::DB::Customer->new( name => 'Test Customer', currency_id => $currency_id, + taxzone_id => $taxzone->id, %{ $params{customer} } )->save; $vendor = SL::DB::Vendor->new( name => 'Test Vendor', currency_id => $currency_id, + taxzone_id => $taxzone->id, %{ $params{vendor} } )->save; }