Revision b989d7cf
Von Kivitendo Admin vor mehr als 10 Jahren hinzugefügt
SL/DB/Buchungsgruppe.pm | ||
---|---|---|
11 | 11 |
class => 'SL::DB::Chart', |
12 | 12 |
column_map => { inventory_accno_id => 'id' }, |
13 | 13 |
}, |
14 |
income_account_0 => { |
|
15 |
type => 'many to one', |
|
16 |
class => 'SL::DB::Chart', |
|
17 |
column_map => { income_accno_id_0 => 'id' }, |
|
18 |
}, |
|
19 |
income_account_1 => { |
|
20 |
type => 'many to one', |
|
21 |
class => 'SL::DB::Chart', |
|
22 |
column_map => { income_accno_id_1 => 'id' }, |
|
23 |
}, |
|
24 |
income_account_2 => { |
|
25 |
type => 'many to one', |
|
26 |
class => 'SL::DB::Chart', |
|
27 |
column_map => { income_accno_id_2 => 'id' }, |
|
28 |
}, |
|
29 |
income_account_3 => { |
|
30 |
type => 'many to one', |
|
31 |
class => 'SL::DB::Chart', |
|
32 |
column_map => { income_accno_id_3 => 'id' }, |
|
33 |
}, |
|
34 |
expense_account_0 => { |
|
35 |
type => 'many to one', |
|
36 |
class => 'SL::DB::Chart', |
|
37 |
column_map => { expense_accno_id_0 => 'id' }, |
|
38 |
}, |
|
39 |
expense_account_1 => { |
|
40 |
type => 'many to one', |
|
41 |
class => 'SL::DB::Chart', |
|
42 |
column_map => { expense_accno_id_1 => 'id' }, |
|
43 |
}, |
|
44 |
expense_account_2 => { |
|
45 |
type => 'many to one', |
|
46 |
class => 'SL::DB::Chart', |
|
47 |
column_map => { expense_accno_id_2 => 'id' }, |
|
48 |
}, |
|
49 |
expense_account_3 => { |
|
50 |
type => 'many to one', |
|
51 |
class => 'SL::DB::Chart', |
|
52 |
column_map => { expense_accno_id_3 => 'id' }, |
|
53 |
}, |
|
54 | 14 |
); |
55 | 15 |
|
56 | 16 |
__PACKAGE__->meta->initialize; |
... | ... | |
59 | 19 |
sub income_accno_id { |
60 | 20 |
my ($self, $taxzone) = @_; |
61 | 21 |
my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone; |
62 |
my $method = 'income_accno_id_' . $taxzone_id; |
|
63 |
|
|
64 |
return $self->$method; |
|
22 |
my $taxzone_chart = SL::DB::Manager::TaxzoneChart->find_by(taxzone_id => $taxzone_id, buchungsgruppen_id => $self->id); |
|
23 |
return $taxzone_chart->income_accno_id if $taxzone_chart; |
|
65 | 24 |
} |
66 | 25 |
|
67 | 26 |
sub expense_accno_id { |
68 | 27 |
my ($self, $taxzone) = @_; |
69 | 28 |
my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone; |
70 |
my $method = 'expense_accno_id_' . $taxzone_id; |
|
71 |
|
|
72 |
return $self->$method; |
|
29 |
my $taxzone_chart = SL::DB::Manager::TaxzoneChart->find_by(taxzone_id => $taxzone_id, buchungsgruppen_id => $self->id); |
|
30 |
return $taxzone_chart->expense_accno_id if $taxzone_chart; |
|
73 | 31 |
} |
74 | 32 |
|
75 | 33 |
sub income_account { |
76 | 34 |
my ($self, $taxzone) = @_; |
77 | 35 |
my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone; |
78 |
my $method = 'income_account_' . $taxzone_id; |
|
79 |
|
|
80 |
return $self->$method; |
|
36 |
my $taxzone_chart = SL::DB::Manager::TaxzoneChart->find_by(taxzone_id => $taxzone_id, buchungsgruppen_id => $self->id); |
|
37 |
return $taxzone_chart->income_accno if $taxzone_chart; |
|
81 | 38 |
} |
82 | 39 |
|
83 | 40 |
sub expense_account { |
84 | 41 |
my ($self, $taxzone) = @_; |
85 | 42 |
my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone; |
86 |
my $method = 'expense_account_' . $taxzone_id; |
|
87 |
|
|
88 |
return $self->$method; |
|
43 |
my $taxzone_chart = SL::DB::Manager::TaxzoneChart->find_by(taxzone_id => $taxzone_id, buchungsgruppen_id => $self->id); |
|
44 |
return $taxzone_chart->expense_accno if $taxzone_chart; |
|
89 | 45 |
} |
90 | 46 |
|
91 | 47 |
1; |
Auch abrufbar als: Unified diff
Auf Datenbankebene Steuerzonen konfigurierbar gemacht
Damit können jetzt mehr als die 4 Standardsteuerzonen eingerichtet
werden. Die bisherigen Steuerzonen wurden aus der Tabelle
buchungsgruppen in die neue Tabelle taxzone_charts ausgelagert.
Konzeption siehe Ticket #2295
Es wurden noch keinerlei Veränderungen an der Kivitendo
Benutzeroberfläche durchgeführt, durch dieses Upgrade können die
Buchungsgruppen also nicht mehr konfiguriert werden, dies muß auf
Datenbankebene passieren.
Rose schon angepasst.
Conflicts: