Revision 1b112bd3
Von G. Richardson vor mehr als 4 Jahren hinzugefügt
t/tax/tax.t | ||
---|---|---|
1 |
use Test::More tests => 46;
|
|
1 |
use Test::More tests => 48;
|
|
2 | 2 |
use Test::Deep qw(cmp_deeply); |
3 | 3 |
|
4 | 4 |
use strict; |
... | ... | |
107 | 107 |
|
108 | 108 |
my $tax_ust_19 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_19) or die; # 19% |
109 | 109 |
my $tax_ust_16 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_16) or die; # 16% |
110 |
my $tax_ust_5 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_5) or die; # 5%
|
|
111 |
my $tax_ust_7 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_7) or die; # 7%
|
|
110 |
my $tax_ust_5 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_5) or die; # 5%
|
|
111 |
my $tax_ust_7 = SL::DB::Manager::Chart->find_by(accno => $chart_ust_7) or die; # 7%
|
|
112 | 112 |
|
113 | 113 |
my $chart_income_19 = SL::DB::Manager::Chart->find_by(accno => $income_19_accno) or die; |
114 | 114 |
my $chart_income_7 = SL::DB::Manager::Chart->find_by(accno => $income_7_accno) or die; |
... | ... | |
122 | 122 |
is(defined SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.05), 1, "tax for taxkey 2 with 5% was created ok"); |
123 | 123 |
is(defined SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.16, chart_id => $tax_ust_16->id), 1, "new sales tax for taxkey 3 with 16% exists ok"); |
124 | 124 |
is(defined SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, chart_id => $tax_ust_19->id), 1, "old sales tax for taxkey 3 with 19% exists ok"); |
125 |
is(defined SL::DB::Manager::Tax->find_by(taxkey => 5, rate => 0.16, chart_id => $tax_ust_16->id), 1, "new sales tax for taxkey 5 with 16% exists ok"); |
|
125 |
# is(defined SL::DB::Manager::Tax->find_by(taxkey => 5, rate => 0.16, chart_id => $tax_ust_16->id), 1, "new sales tax for taxkey 5 with 16% exists ok");
|
|
126 | 126 |
|
127 | 127 |
# is(defined SL::DB::Manager::Tax->find_by(taxkey => 7, rate => 0.16, chart_id => $tax_ust_16->id), 1, "old purchase tax for taxkey 7 with 16% exists ok"); |
128 | 128 |
is(defined SL::DB::Manager::Tax->find_by(taxkey => 8, rate => 0.07, chart_id => $tax_vst_7->id ), 1, "purchase tax for taxkey 8 with 7% exists ok"); |
... | ... | |
132 | 132 |
my $vendor = new_vendor( name => 'Testvendor', payment_id => $payment_terms->id)->save; |
133 | 133 |
my $customer = new_customer(name => 'Testcustomer', payment_id => $payment_terms->id)->save; |
134 | 134 |
|
135 |
# cmp_ok($chart_income_7->get_active_taxkey($date_2020_1)->tax->rate, '==', 0.07, "get_active_taxkey rate for 8300 in 2020_1 ok");
|
|
136 |
# cmp_ok($chart_income_7->get_active_taxkey($date_2020_2)->tax->rate, '==', 0.05, "get_active_taxkey rate for 8300 in 2020_2 ok");
|
|
137 |
# cmp_ok($chart_income_7->get_active_taxkey($date_2021 )->tax->rate, '==', 0.07, "get_active_taxkey rate for 8300 in 2021 ok");
|
|
135 |
cmp_ok($chart_income_7->get_active_taxkey($date_2020_1)->tax->rate, '==', 0.07, "get_active_taxkey rate for 8300 in 2020_1 ok"); |
|
136 |
cmp_ok($chart_income_7->get_active_taxkey($date_2020_2)->tax->rate, '==', 0.05, "get_active_taxkey rate for 8300 in 2020_2 ok"); |
|
137 |
cmp_ok($chart_income_7->get_active_taxkey($date_2021 )->tax->rate, '==', 0.07, "get_active_taxkey rate for 8300 in 2021 ok"); |
|
138 | 138 |
cmp_ok($chart_income_7->get_active_taxkey($date_2020_1)->tax->rate, '==', 0.07, "get_active_taxkey rate for $income_7_accno in 2020_1 ok"); |
139 | 139 |
cmp_ok($chart_income_7->get_active_taxkey($date_2020_2)->tax->rate, '==', 0.05, "get_active_taxkey rate for $income_7_accno in 2020_2 ok"); |
140 | 140 |
cmp_ok($chart_income_7->get_active_taxkey($date_2021 )->tax->rate, '==', 0.07, "get_active_taxkey rate for $income_7_accno in 2021 ok"); |
... | ... | |
245 | 245 |
# would select the entries from the dropdown, as they may differ from the |
246 | 246 |
# default, so we have to pass the tax we want to create_ap_transaction |
247 | 247 |
|
248 |
my $tax_9_16_old = SL::DB::Manager::Tax->find_by(taxkey => 7, rate => 0.16, chart_id => $tax_vst_16->id); |
|
248 |
# my $tax_9_16_old = SL::DB::Manager::Tax->find_by(taxkey => 7, rate => 0.16, chart_id => $tax_vst_16->id);
|
|
249 | 249 |
my $tax_9_19 = SL::DB::Manager::Tax->find_by(taxkey => 9, rate => 0.19, chart_id => $tax_vst_19->id) or die "missing 9_19"; |
250 | 250 |
my $tax_9_16 = SL::DB::Manager::Tax->find_by(taxkey => 9, rate => 0.16, chart_id => $tax_vst_16->id) or die "missing 9_16"; |
251 | 251 |
my $tax_8_7 = SL::DB::Manager::Tax->find_by(taxkey => 8, rate => 0.07, chart_id => $tax_vst_7->id) or die "missing 8_7"; |
252 | 252 |
my $tax_8_5 = SL::DB::Manager::Tax->find_by(taxkey => 8, rate => 0.05, chart_id => $tax_vst_5->id) or die "missing 8_5"; |
253 | 253 |
|
254 | 254 |
# simulate user selecting the "correct" taxes in dropdown: |
255 |
my $ap_transaction_2006 = create_ap_transaction_for_date('2006', $date_2006, undef, $tax_9_16_old, $tax_8_7);
|
|
256 |
my $ap_transaction_2020_1 = create_ap_transaction_for_date('2020_1', $date_2020_1, undef, $tax_9_19, $tax_8_7);
|
|
257 |
my $ap_transaction_2020_2 = create_ap_transaction_for_date('2020_2', $date_2020_2, undef, $tax_9_16, $tax_8_5);
|
|
258 |
my $ap_transaction_2021 = create_ap_transaction_for_date('2021', $date_2021, undef, $tax_9_19, $tax_8_7);
|
|
255 |
my $ap_transaction_2006 = create_ap_transaction_for_date('2006', $date_2006, undef, $tax_9_16, $tax_8_7); |
|
256 |
my $ap_transaction_2020_1 = create_ap_transaction_for_date('2020_1', $date_2020_1, undef, $tax_9_19, $tax_8_7); |
|
257 |
my $ap_transaction_2020_2 = create_ap_transaction_for_date('2020_2', $date_2020_2, undef, $tax_9_16, $tax_8_5); |
|
258 |
my $ap_transaction_2021 = create_ap_transaction_for_date('2021', $date_2021, undef, $tax_9_19, $tax_8_7); |
|
259 | 259 |
|
260 | 260 |
|
261 | 261 |
is($ap_transaction_2006->amount, 223, '2006 ap transaction has 16% and 7% tax ok'); # 116 + 7 |
Auch abrufbar als: Unified diff
Konjunkturpaket - SKR03 - kein 5 und 7 mehr anlegen
Im Gegensatz zu der Standardinstallation von SKR04 gibt es bei SKR03
keine konfigurierten Steuerschlüssel 5 und 7 (für die alten 16%-Fälle),
stattdessen gibt es noch Einträge für 16% die über die Steuerschlüssel 3
und 9 abgebildet werden und sogar noch auf die korrekten Konten zeigen.
Da das Anlegen von 5 und 7 derzeit noch zu Komplikationen führt, und
diese durch das Lieferdatum/Leistungsdatum nicht zwingend notwendig
sind, wird daher vorerst darauf verzichtet.
Außerdem werden noch ein paar fehlende Konten und taxkeys angelegt.