Revision f5c454e3
Von Niclas Zimmermann vor mehr als 10 Jahren hinzugefügt
SL/DB/TaxzoneChart.pm | ||
---|---|---|
6 | 6 |
use strict; |
7 | 7 |
|
8 | 8 |
use SL::DB::MetaSetup::TaxzoneChart; |
9 |
use SL::DB::Manager::TaxzoneChart; |
|
10 |
use SL::DB::MetaSetup::Buchungsgruppe; |
|
9 | 11 |
|
10 | 12 |
__PACKAGE__->meta->initialize; |
11 | 13 |
|
12 | 14 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
13 |
__PACKAGE__->meta->make_manager_class; |
|
15 |
#__PACKAGE__->meta->make_manager_class; |
|
16 |
|
|
17 |
sub get_all_accounts_by_buchungsgruppen_id { |
|
18 |
my ($self, $buchungsgruppen_id) = @_; |
|
19 |
|
|
20 |
my $all_taxzonecharts = SL::DB::Manager::TaxzoneChart->get_all(where => [ buchungsgruppen_id => $buchungsgruppen_id ], |
|
21 |
sort_by => 'taxzone_id'); |
|
22 |
|
|
23 |
my %list = (); |
|
24 |
|
|
25 |
#inventory_accno der Buchungsgruppe: |
|
26 |
$list{inventory_accno} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_accno; |
|
27 |
$list{inventory_accno_description} = SL::DB::Manager::Buchungsgruppe->find_by(id => $buchungsgruppen_id)->inventory_accno_description; |
|
28 |
|
|
29 |
foreach my $taxzonechart (@{ $all_taxzonecharts }) { |
|
30 |
$list{ $taxzonechart->taxzone_id }{taxzone_chart_id} = $taxzonechart->id; |
|
31 |
$list{ $taxzonechart->taxzone_id }{income_accno} = $taxzonechart->get_income_accno; |
|
32 |
$list{ $taxzonechart->taxzone_id }{expense_accno} = $taxzonechart->get_expense_accno; |
|
33 |
$list{ $taxzonechart->taxzone_id }{income_accno_id} = $taxzonechart->income_accno_id; |
|
34 |
$list{ $taxzonechart->taxzone_id }{expense_accno_id} = $taxzonechart->expense_accno_id; |
|
35 |
$list{ $taxzonechart->taxzone_id }{income_accno_description} = $taxzonechart->get_income_accno_description; |
|
36 |
$list{ $taxzonechart->taxzone_id }{expense_accno_description} = $taxzonechart->get_expense_accno_description; |
|
37 |
} |
|
38 |
return \%list; |
|
39 |
} |
|
40 |
|
|
41 |
sub get_all_accounts_by_taxzone_id { |
|
42 |
my ($self, $taxzone_id) = @_; |
|
43 |
|
|
44 |
my $all_taxzonecharts = SL::DB::Manager::TaxzoneChart->get_all(where => [ taxzone_id => $taxzone_id ]); |
|
45 |
|
|
46 |
my %list = (); |
|
47 |
|
|
48 |
foreach my $tzchart (@{ $all_taxzonecharts }) { |
|
49 |
$list{ $tzchart->buchungsgruppen_id }{taxzone_chart_id} = $tzchart->id; |
|
50 |
$list{ $tzchart->buchungsgruppen_id }{income_accno} = $tzchart->get_income_accno; |
|
51 |
$list{ $tzchart->buchungsgruppen_id }{expense_accno} = $tzchart->get_expense_accno; |
|
52 |
$list{ $tzchart->buchungsgruppen_id }{income_accno_id} = $tzchart->income_accno_id; |
|
53 |
$list{ $tzchart->buchungsgruppen_id }{expense_accno_id} = $tzchart->expense_accno_id; |
|
54 |
$list{ $tzchart->buchungsgruppen_id }{income_accno_description} = $tzchart->get_income_accno_description; |
|
55 |
$list{ $tzchart->buchungsgruppen_id }{expense_accno_description} = $tzchart->get_expense_accno_description; |
|
56 |
} |
|
57 |
|
|
58 |
return \%list; |
|
59 |
} |
|
60 |
|
|
61 |
sub get_income_accno { |
|
62 |
my $self = shift; |
|
63 |
require SL::DB::Manager::Chart; |
|
64 |
return SL::DB::Manager::Chart->find_by(id => $self->income_accno_id)->accno(); |
|
65 |
} |
|
66 |
|
|
67 |
sub get_expense_accno { |
|
68 |
my $self = shift; |
|
69 |
require SL::DB::Manager::Chart; |
|
70 |
return SL::DB::Manager::Chart->find_by(id => $self->expense_accno_id)->accno(); |
|
71 |
} |
|
72 |
|
|
73 |
sub get_income_accno_description { |
|
74 |
my $self = shift; |
|
75 |
require SL::DB::Manager::Chart; |
|
76 |
return SL::DB::Manager::Chart->find_by(id => $self->income_accno_id)->description(); |
|
77 |
} |
|
78 |
|
|
79 |
sub get_expense_accno_description { |
|
80 |
my $self = shift; |
|
81 |
require SL::DB::Manager::Chart; |
|
82 |
return SL::DB::Manager::Chart->find_by(id => $self->expense_accno_id)->description(); |
|
83 |
} |
|
14 | 84 |
|
15 | 85 |
1; |
Auch abrufbar als: Unified diff
Steuerzonen und Buchungsgruppen bearbeiten
Nachdem man Steuerzonen und Buchungsgruppen auf Datenbankebene
bearbeiten kann, ist jetzt auch eine Bearbeitung an der Ober-
fläche möglich.
Alter Code, der für die Anzeige/Bearbeitung/Erstellung von
Buchungsgruppen entwickelt wurde hat nicht mehr funktioniert
und wurde vollständig ersetzt.