year_end.t - Testjahr: in 2020 das Jahr 2019 nehmen
authorG. Richardson <grichardson@kivitec.de>
Tue, 7 Jul 2020 15:51:32 +0000 (17:51 +0200)
committerG. Richardson <grichardson@kivitec.de>
Tue, 7 Jul 2020 16:35:41 +0000 (18:35 +0200)
wegen Steuerumstellung

t/year_end/year_end.t

index 39a7f1c..5976edd 100644 (file)
@@ -30,9 +30,8 @@ clear_up();
 # * also the default test client has the accounting method "cash" rather than "accrual"
 #   (Ist-versteuerung, rather than Soll-versteuerung)
 
-# hardcode for 2019, as this will break in 2020 due to change in tax (19/16 and 7/5) because we check for account sums
-# can be changed back to current year in 2021
-my $year = 2019; # DateTime->today->year;
+# use 2019 instead of 2020 because of tax changes in Germany (19/16 and 7/5) because we check for account sums
+my $year = 2019 if DateTime->today_local->year == 2020;
 my $start_of_year = DateTime->new(year => $year, month => 01, day => 01);
 my $booking_date  = DateTime->new(year => $year, month => 12, day => 22);
 
@@ -97,7 +96,7 @@ my $ar_transaction = create_ar_transaction(
 $ar_transaction->pay_invoice(
                               chart_id     => $bank_account->chart_id,
                               amount       => $ar_transaction->amount,
-                              transdate    => $booking_date->to_kivitendo,
+                              transdate    => $booking_date,
                               payment_type => 'without_skonto',
                             );