From f358c83ee0b94481a25c66f1d9f2931684c74552 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Fri, 8 Aug 2014 13:50:23 +0200 Subject: [PATCH] Steuerzone - neue Customer/Vendor-Objekte brauchen Steuerzone MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- t/db_helper/acts_as_list.t | 8 ++++++-- t/db_helper/price_tax_calculator.t | 2 ++ t/db_helper/record_links.t | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) 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; } -- 2.20.1