Revision 1c62d23e
Von Kivitendo Admin vor mehr als 10 Jahren hinzugefügt
SL/DB/Buchungsgruppe.pm | ||
---|---|---|
103 | 103 |
=item C<expense_accno_id $taxzone> |
104 | 104 |
|
105 | 105 |
Return the chart ID for the expense account for the given taxzone |
106 |
(either an integer between 0 and 3 inclusively or an instance of |
|
107 |
L<SL::DB::TaxZone>). |
|
106 |
(either the DB id or an instance of L<SL::DB::TaxZone>). |
|
108 | 107 |
|
109 | 108 |
=item C<expense_account> |
110 | 109 |
|
111 | 110 |
Return the chart (an instance of L<SL::DB::Chart>) for the expense |
112 |
account for the given taxzone (either an integer between 0 and 3
|
|
113 |
inclusively or an instance of L<SL::DB::TaxZone>).
|
|
111 |
account for the given taxzone (either the DB id or an instance of
|
|
112 |
L<SL::DB::TaxZone>). |
|
114 | 113 |
|
115 | 114 |
=item C<income_accno_id> |
116 | 115 |
|
117 | 116 |
Return the chart ID for the income account for the given taxzone |
118 |
(either an integer between 0 and 3 inclusively or an instance of
|
|
117 |
(either the DB id or an instance of L<SL::DB::TaxZone>).
|
|
119 | 118 |
L<SL::DB::TaxZone>). |
120 | 119 |
|
121 | 120 |
=item C<income_account> |
122 | 121 |
|
123 | 122 |
Return the chart (an instance of L<SL::DB::Chart>) for the income |
124 |
account for the given taxzone (either an integer between 0 and 3
|
|
125 |
inclusively or an instance of L<SL::DB::TaxZone>).
|
|
123 |
account for the given taxzone (either the DB id or an instance of
|
|
124 |
L<SL::DB::TaxZone>). |
|
126 | 125 |
|
127 | 126 |
=back |
128 | 127 |
|
SL/DB/Manager/TaxZone.pm | ||
---|---|---|
17 | 17 |
columns => { SIMPLE => 'ALL' } ); |
18 | 18 |
} |
19 | 19 |
|
20 |
sub get_default { |
|
21 |
return $_[0]->get_first(where => [ obsolete => 0 ], sort_by => 'sortkey'); |
|
22 |
} |
|
23 |
|
|
20 | 24 |
1; |
25 |
__END__ |
|
26 |
|
|
27 |
=pod |
|
28 |
|
|
29 |
=encoding utf8 |
|
30 |
|
|
31 |
=head1 NAME |
|
32 |
|
|
33 |
SL::DB::Manager::TaxZone - RDBO manager for the C<tax_zones> table |
|
34 |
|
|
35 |
=head1 FUNCTIONS |
|
36 |
|
|
37 |
=over 4 |
|
38 |
|
|
39 |
=item C<get_default> |
|
40 |
|
|
41 |
Returns an RDBO instance corresponding to the default taxzone. The default |
|
42 |
taxzone is defined as the taxzone with the highest sort order (usually 1) that |
|
43 |
is not set to obsolete. |
|
44 |
|
|
45 |
Example: |
|
46 |
|
|
47 |
my $default_taxzone_id = SL::DB::Manager::TaxZone->get_default->id; |
|
48 |
|
|
49 |
|
|
50 |
=back |
|
51 |
|
|
52 |
=cut |
SL/DB/Part.pm | ||
---|---|---|
318 | 318 |
C<$params{is_sales}>) or expense (for falsish values of |
319 | 319 |
C<$params{is_sales}>) account for the current part. It uses the part's |
320 | 320 |
associated buchungsgruppe and uses the fields belonging to the tax |
321 |
zone given by C<$params{taxzone}> (range 0..3).
|
|
321 |
zone given by C<$params{taxzone}>. |
|
322 | 322 |
|
323 | 323 |
The information retrieved by the function is cached. |
324 | 324 |
|
... | ... | |
330 | 330 |
the three key words C<income>, C<expense> and C<inventory>. |
331 | 331 |
|
332 | 332 |
This function uses the part's associated buchungsgruppe and uses the |
333 |
fields belonging to the tax zone given by C<$params{taxzone}> (range |
|
334 |
0..3). |
|
333 |
fields belonging to the tax zone given by C<$params{taxzone}>. |
|
335 | 334 |
|
336 | 335 |
The information retrieved by the function is cached. |
337 | 336 |
|
SL/IR.pm | ||
---|---|---|
46 | 46 |
use SL::IO; |
47 | 47 |
use SL::MoreCommon; |
48 | 48 |
use SL::DB::Default; |
49 |
use SL::DB::TaxZone; |
|
49 | 50 |
use List::Util qw(min); |
50 | 51 |
|
51 | 52 |
use strict; |
... | ... | |
672 | 673 |
|
673 | 674 |
# set values which could be empty |
674 | 675 |
my $taxzone_id = $form->{taxzone_id} * 1; |
676 |
$taxzone_id = SL::DB::Manager::TaxZone->get_default->id unless SL::DB::Manager::TaxZone->find_by(id => $taxzone_id); |
|
675 | 677 |
|
676 | 678 |
# Seit neuestem wird die department_id schon übergeben UND $form->department nicht mehr |
677 | 679 |
# korrekt zusammengebaut. Sehr wahrscheinlich beim Umstieg auf T8 kaputt gegangen |
... | ... | |
682 | 684 |
} |
683 | 685 |
$form->{invnumber} = $form->{id} unless $form->{invnumber}; |
684 | 686 |
|
685 |
$taxzone_id = 0 if (3 < $taxzone_id) || (0 > $taxzone_id); |
|
686 |
|
|
687 | 687 |
# save AP record |
688 | 688 |
$query = qq|UPDATE ap SET |
689 | 689 |
invnumber = ?, ordnumber = ?, quonumber = ?, transdate = ?, |
... | ... | |
963 | 963 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
964 | 964 |
|
965 | 965 |
my $transdate = $form->{invdate} ? $dbh->quote($form->{invdate}) : "current_date"; |
966 |
my $taxzone_id = $form->{taxzone_id} * 1; |
|
967 | 966 |
|
968 |
$taxzone_id = 0 if ((3 < $taxzone_id) || (0 > $taxzone_id)); |
|
967 |
my $taxzone_id = $form->{taxzone_id} * 1; |
|
968 |
$taxzone_id = SL::DB::Manager::TaxZone->get_default->id unless SL::DB::Manager::TaxZone->find_by(id => $taxzone_id); |
|
969 | 969 |
|
970 | 970 |
# retrieve individual items |
971 | 971 |
$query = |
... | ... | |
1219 | 1219 |
} |
1220 | 1220 |
|
1221 | 1221 |
my $taxzone_id = $form->{taxzone_id} * 1; |
1222 |
$taxzone_id = 0 if ((3 < $taxzone_id) || (0 > $taxzone_id));
|
|
1222 |
$taxzone_id = SL::DB::Manager::TaxZone->get_default->id unless SL::DB::Manager::TaxZone->find_by(id => $taxzone_id);
|
|
1223 | 1223 |
|
1224 | 1224 |
my $query = |
1225 | 1225 |
qq|SELECT |
SL/IS.pm | ||
---|---|---|
51 | 51 |
use SL::TransNumber; |
52 | 52 |
use SL::DB::Default; |
53 | 53 |
use SL::DB::Tax; |
54 |
use SL::DB::TaxZone; |
|
54 | 55 |
use SL::TransNumber; |
55 | 56 |
use Data::Dumper; |
56 | 57 |
|
... | ... | |
1638 | 1639 |
|
1639 | 1640 |
|
1640 | 1641 |
my $taxzone_id = $form->{taxzone_id} *= 1; |
1641 |
$taxzone_id = 0 if (0 > $taxzone_id) || (3 < $taxzone_id);
|
|
1642 |
$taxzone_id = SL::DB::Manager::TaxZone->get_default->id unless SL::DB::Manager::TaxZone->find_by(id => $taxzone_id);
|
|
1642 | 1643 |
|
1643 | 1644 |
# retrieve individual items |
1644 | 1645 |
$query = |
Auch abrufbar als: Unified diff
Steuerzone - Default eingeführt (statt id 0)
Als Defaultsteuerzone gilt nun die Steuerzone mit dem höchsten Sortcode, der
nicht obsolet ist (in der Regel also id 1).
Bernd hatte noch ein paar Stellen gefunden, wo als Default 0 gesetzt wird.
Außerdem Doku angepasst, taxzone_id ist nun nicht mehr im Bereich 0-3.