Revision 1a3707af
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
SL/AccTransCorrections.pm | ||
---|---|---|
288 | 288 |
return 0; |
289 | 289 |
} |
290 | 290 |
|
291 |
# Problemfall: Verkaufsrechnungen, bei denen Steuern verbucht wurden, obwohl |
|
292 |
# kein Steuerschl?ssel eingetragen ist. |
|
293 |
sub _check_missing_taxkeys_in_invoices { |
|
294 |
$::lxdebug->enter_sub; |
|
295 |
|
|
296 |
my $self = shift; |
|
297 |
my %params = @_; |
|
298 |
my $transaction = $params{transaction}; |
|
299 |
my $found_broken = 0; |
|
300 |
|
|
301 |
$::lxdebug->leave_sub and return 0 |
|
302 |
if !$transaction->[0]->{invoice}; |
|
303 |
|
|
304 |
my @sub_transactions = $self->_group_sub_transactions($transaction); |
|
305 |
|
|
306 |
for my $sub_transaction (@sub_transactions) { |
|
307 |
$::lxdebug->leave_sub and return 0 |
|
308 |
if _is_split_transaction($sub_transaction) |
|
309 |
|| _is_simple_transaction($sub_transaction); |
|
310 |
|
|
311 |
my $split_side_entries = _get_splitted_side($sub_transaction); |
|
312 |
my $num_tax_rows; |
|
313 |
my $num_taxed_rows; |
|
314 |
for my $entry (@{ $split_side_entries }) { |
|
315 |
my $is_tax = grep { m/(?:AP_tax|AR_tax)/ } keys %{ $entry->{chartlinks} }; |
|
316 |
|
|
317 |
$num_tax_rows++ if $is_tax; |
|
318 |
$num_taxed_rows++ if !$is_tax && $entry->{tax_key} != 0; |
|
319 |
} |
|
320 |
|
|
321 |
# now if this has tax rows but NO taxed rows, something is wrong. |
|
322 |
if ($num_tax_rows > 0 && $num_taxed_rows == 0) { |
|
323 |
$params{problem}->{type} = 'missing_taxkeys_in_invoices'; |
|
324 |
push @{ $self->{missing_taxkeys_in_invoices} ||= [] }, $params{problem}; |
|
325 |
$found_broken = 1; |
|
326 |
} |
|
327 |
} |
|
328 |
|
|
329 |
$::lxdebug->leave_sub; |
|
330 |
|
|
331 |
return $found_broken; |
|
332 |
} |
|
333 |
|
|
291 | 334 |
# Problemfall: Kreditorenbuchungen, bei denen mit Umsatzsteuerschl?sseln |
292 | 335 |
# gebucht wurde und Debitorenbuchungen, bei denen mit Vorsteuerschl?sseln |
293 | 336 |
# gebucht wurde. |
... | ... | |
623 | 666 |
unshift @problems, $problem; |
624 | 667 |
} |
625 | 668 |
|
669 |
if (0 != scalar @{ $self->{missing_taxkeys_in_invoices} }) { |
|
670 |
my $problem = { |
|
671 |
'type' => 'missing_taxkeys_in_invoices', |
|
672 |
'ap_problems' => [ grep { $_->{data}->{module} eq 'ap' } @{ $self->{missing_taxkeys_in_invoices} } ], |
|
673 |
'ar_problems' => [ grep { $_->{data}->{module} eq 'ar' } @{ $self->{missing_taxkeys_in_invoices} } ], |
|
674 |
}; |
|
675 |
unshift @problems, $problem; |
|
676 |
} |
|
677 |
|
|
626 | 678 |
$main::lxdebug->leave_sub(); |
627 | 679 |
|
680 |
# $::lxdebug->dump(0, 'problems:', \@problems); |
|
628 | 681 |
|
629 | 682 |
return @problems; |
630 | 683 |
} |
locale/de/all | ||
---|---|---|
996 | 996 |
'Missing amount' => 'Fehlbetrag', |
997 | 997 |
'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.', |
998 | 998 |
'Missing parameter (at least one of #1) in call to sub #2.' => 'Fehlernder Parameter (mindestens einer aus \'#1\') in Funktionsaufruf \'#2\'.', |
999 |
'Missing taxkeys in invoices with taxes.' => 'Fehlende Steuerschlüssel in Rechnungen mit Steuern', |
|
999 | 1000 |
'Mitarbeiter' => 'Mitarbeiter', |
1000 | 1001 |
'Mobile1' => 'Mobile 1', |
1001 | 1002 |
'Mobile2' => 'Mobile 2', |
templates/webpages/acctranscorrections/analyze_overview_de.html | ||
---|---|---|
67 | 67 |
[%- END %] |
68 | 68 |
[%- END %] |
69 | 69 |
|
70 |
[%- ELSIF problem.type == 'missing_taxkeys_in_invoices' %] |
|
71 |
[%- IF problem.ar_problems.size %] |
|
72 |
Verkaufsrechnungen |
|
73 |
[%- FOREACH subproblem = problem.ar_problems %] |
|
74 |
[%- UNLESS loop.first %], [%- END %] |
|
75 |
<a href="[% subproblem.link %]">[% HTML.escape(subproblem.data.reference) %]</a> |
|
76 |
[%- END %] |
|
77 |
[%- END %] |
|
78 |
|
|
79 |
[%- IF problem.ap_problems.size %] |
|
80 |
[%- IF problem.ar_problems.size %]; [%- END %] |
|
81 |
Einkaufsrechnungen |
|
82 |
[%- FOREACH subproblem = problem.ap_problems %] |
|
83 |
[%- UNLESS loop.first %], [%- END %] |
|
84 |
<a href="[% subproblem.link %]">[% HTML.escape(subproblem.data.reference) %]</a> |
|
85 |
[%- END %] |
|
86 |
[%- END %] |
|
87 |
|
|
70 | 88 |
[%- ELSE %] |
71 | 89 |
|
72 | 90 |
<a href="[% problem.link %]"> |
... | ... | |
101 | 119 |
[%- ELSIF problem.type == 'invoice_inventory_with_taxkeys' %] |
102 | 120 |
Einkaufs- und Verkaufsrechnungen mit Warenbestandsbuchungen mit Steuerschl?sseln |
103 | 121 |
|
122 |
[%- ELSIF problem.type == 'missing_taxkeys_in_invoices' %] |
|
123 |
Fehlende Steuerschlüssel in Rechnungen mit Steuern |
|
124 |
|
|
104 | 125 |
[%- END %] |
105 | 126 |
</td> |
106 | 127 |
|
templates/webpages/acctranscorrections/analyze_overview_master.html | ||
---|---|---|
67 | 67 |
[%- END %] |
68 | 68 |
[%- END %] |
69 | 69 |
|
70 |
[%- ELSIF problem.type == 'missing_taxkeys_in_invoices' %] |
|
71 |
[%- IF problem.ar_problems.size %] |
|
72 |
<translate>Sales invoices</translate> |
|
73 |
[%- FOREACH subproblem = problem.ar_problems %] |
|
74 |
[%- UNLESS loop.first %], [%- END %] |
|
75 |
<a href="[% subproblem.link %]">[% HTML.escape(subproblem.data.reference) %]</a> |
|
76 |
[%- END %] |
|
77 |
[%- END %] |
|
78 |
|
|
79 |
[%- IF problem.ap_problems.size %] |
|
80 |
[%- IF problem.ar_problems.size %]; [%- END %] |
|
81 |
<translate>Purchase invoices</translate> |
|
82 |
[%- FOREACH subproblem = problem.ap_problems %] |
|
83 |
[%- UNLESS loop.first %], [%- END %] |
|
84 |
<a href="[% subproblem.link %]">[% HTML.escape(subproblem.data.reference) %]</a> |
|
85 |
[%- END %] |
|
86 |
[%- END %] |
|
87 |
|
|
70 | 88 |
[%- ELSE %] |
71 | 89 |
|
72 | 90 |
<a href="[% problem.link %]"> |
... | ... | |
101 | 119 |
[%- ELSIF problem.type == 'invoice_inventory_with_taxkeys' %] |
102 | 120 |
<translate>Sales and purchase invoices with inventory transactions with taxkeys</translate> |
103 | 121 |
|
122 |
[%- ELSIF problem.type == 'missing_taxkeys_in_invoices' %] |
|
123 |
<translate>Missing taxkeys in invoices with taxes.</translate> |
|
124 |
|
|
104 | 125 |
[%- END %] |
105 | 126 |
</td> |
106 | 127 |
|
Auch abrufbar als: Unified diff
Check in Acctrancorrections zu fehlenden Steuerschluesseln.