From: Jan Büren Date: Thu, 14 Mar 2019 12:23:30 +0000 (+0100) Subject: Testfall: closedto für bank_transactions angepasst X-Git-Tag: release-3.5.4~97 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5027341d15500dac6df99ed204118cce7e6b360d;p=kivitendo-erp.git Testfall: closedto für bank_transactions angepasst Prüfung auf Date 30.12.18 < 30.12.18 ist nicht falsch Zeitstempel beide auf 0h --- diff --git a/t/bank/bank_transactions.t b/t/bank/bank_transactions.t index aaff649bb..8b38424ec 100644 --- a/t/bank/bank_transactions.t +++ b/t/bank/bank_transactions.t @@ -1,4 +1,4 @@ -use Test::More tests => 290; +use Test::More tests => 289; use strict; @@ -51,6 +51,7 @@ sub clear_up { SL::DB::Manager::BankAccount->delete_all(all => 1); SL::DB::Manager::PaymentTerm->delete_all(all => 1); SL::DB::Manager::Currency->delete_all(where => [ name => 'CUR' ]); + # SL::DB::Manager::Default->delete_all(all => 1); }; my $bt_controller; @@ -1189,18 +1190,19 @@ sub test_closedto { is($bt1->closed_period, 0, "$testname undefined closedto"); my $defaults = SL::DB::Manager::Default->get_all(limit => 1)->[0]; - $defaults->closedto(DateTime->new(year => 2019, month => 12, day => 30)); + $defaults->closedto(DateTime->new(year => 2019, month => 12, day => 31)); $defaults->save(); $::instance_conf->reload->data; $bt1->load(); + is($bt1->closed_period, 1, "$testname defined and next date closedto"); - is($bt1->closed_period, 1, "$testname defined and same date closedto"); - - $bt1->valutadate(DateTime->new(year => 2019, month => 12, day => 31)); + $bt1->valutadate(DateTime->new(year => 2020, month => 1, day => 1)); $bt1->save(); $bt1->load(); is($bt1->closed_period, 0, "$testname defined closedto and next date valuta"); + $defaults->closedto(undef); + $defaults->save(); }