projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
YearEndTransactions: undefined warnings behoben
[kivitendo-erp.git]
/
t
/
db_helper
/
record_links.t
diff --git
a/t/db_helper/record_links.t
b/t/db_helper/record_links.t
index
e7dd31b
..
5df89a4
100644
(file)
--- a/
t/db_helper/record_links.t
+++ b/
t/db_helper/record_links.t
@@
-25,16
+25,21
@@
use SL::DB::TaxZone;
my ($customer, $currency_id, $buchungsgruppe, $employee, $vendor, $taxzone);
my ($link, $links, $o1, $o2, $d, $i);
my ($customer, $currency_id, $buchungsgruppe, $employee, $vendor, $taxzone);
my ($link, $links, $o1, $o2, $d, $i);
-sub reset_state {
- my %params = @_;
-
- $params{$_} ||= {} for qw(buchungsgruppe unit customer part tax);
-
+sub clear_up {
SL::DB::Manager::DeliveryOrder->delete_all(all => 1);
SL::DB::Manager::Order->delete_all(all => 1);
SL::DB::Manager::Invoice->delete_all(all => 1);
SL::DB::Manager::DeliveryOrder->delete_all(all => 1);
SL::DB::Manager::Order->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);
SL::DB::Manager::Vendor->delete_all(all => 1);
SL::DB::Manager::Customer->delete_all(all => 1);
SL::DB::Manager::Vendor->delete_all(all => 1);
+};
+
+sub reset_state {
+ my %params = @_;
+
+ $params{$_} ||= {} for qw(buchungsgruppe unit customer part tax);
+
+ clear_up();
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group";
$employee = SL::DB::Manager::Employee->current || croak "No employee";
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group";
$employee = SL::DB::Manager::Employee->current || croak "No employee";
@@
-45,12
+50,14
@@
sub reset_state {
$customer = SL::DB::Customer->new(
name => 'Test Customer',
currency_id => $currency_id,
$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,
%{ $params{customer} }
)->save;
$vendor = SL::DB::Vendor->new(
name => 'Test Vendor',
currency_id => $currency_id,
+ taxzone_id => $taxzone->id,
%{ $params{vendor} }
)->save;
}
%{ $params{vendor} }
)->save;
}
@@
-102,7
+109,6
@@
Support::TestSetup::login();
reset_state();
reset_state();
-
$o1 = new_order();
$i = new_invoice();
$o1 = new_order();
$i = new_invoice();
@@
-311,4
+317,7
@@
is @$links, 3, 'recursive from i finds 3 (not i)';
$links = $o1->linked_records(direction => 'both', recursive => 1, save_path => 1);
is @$links, 4, 'recursive dir=both does not give duplicates';
$links = $o1->linked_records(direction => 'both', recursive => 1, save_path => 1);
is @$links, 4, 'recursive dir=both does not give duplicates';
+
+clear_up();
+
1;
1;