]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Steuerzone - neue Customer/Vendor-Objekte brauchen Steuerzone
authorG. Richardson <information@kivitendo-premium.de>
Fri, 8 Aug 2014 11:50:23 +0000 (13:50 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Fri, 8 Aug 2014 11:53:46 +0000 (13:53 +0200)
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
t/db_helper/price_tax_calculator.t
t/db_helper/record_links.t

index 53338f757a39c2c687c4d7dd55e513648ed90945..a91724ccecc8548ed01bdc60e321a1c9aad5b187 100644 (file)
@@ -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 => '') ||
index 4bf9ab8635ed306c6df434450910ec50422d639c..8ec8d1c905df41eed62bd7189825bb9a05abd6b7 100644 (file)
@@ -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;
 
index e7dd31b18dfa152e1d2cea4fd3bbef1d41da6253..edfcf72fdbad46ccfeaeb778d15395a9e5c9305f 100644 (file)
@@ -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;
 }