+ my $customer = SL::DB::Customer->new( name => delete $params{name} || 'Testkunde',
+ currency_id => $currency->id,
+ taxzone_id => $taxzone->id,
+ );
+ $customer->assign_attributes( %params );
+ return $customer;
+}
+
+sub new_vendor {
+ my (%params) = @_;
+
+ my $taxzone = _check_taxzone(delete $params{taxzone_id});
+ my $currency = _check_currency(delete $params{currency_id});
+
+ my $vendor = SL::DB::Vendor->new( name => delete $params{name} || 'Testlieferant',
+ currency_id => $currency->id,
+ taxzone_id => $taxzone->id,
+ );
+ $vendor->assign_attributes( %params );
+ return $vendor;
+}
+
+sub _check_taxzone {
+ my ($taxzone_id) = @_;
+ # check that taxzone_id exists or if no taxzone_id passed use 'Inland'
+ my $taxzone;
+ if ( $taxzone_id ) {