1 package SL::DB::Buchungsgruppe;
5 use SL::DB::MetaSetup::Buchungsgruppe;
6 use SL::DB::Manager::Buchungsgruppe;
8 __PACKAGE__->meta->add_relationship(
10 type => 'many to one',
11 class => 'SL::DB::Chart',
12 column_map => { income_accno_id_0 => 'id' },
15 type => 'many to one',
16 class => 'SL::DB::Chart',
17 column_map => { income_accno_id_0 => 'id' },
20 type => 'many to one',
21 class => 'SL::DB::Chart',
22 column_map => { income_accno_id_1 => 'id' },
25 type => 'many to one',
26 class => 'SL::DB::Chart',
27 column_map => { income_accno_id_2 => 'id' },
30 type => 'many to one',
31 class => 'SL::DB::Chart',
32 column_map => { income_accno_id_3 => 'id' },
34 expense_account_0 => {
35 type => 'many to one',
36 class => 'SL::DB::Chart',
37 column_map => { expense_accno_id_0 => 'id' },
39 expense_account_1 => {
40 type => 'many to one',
41 class => 'SL::DB::Chart',
42 column_map => { expense_accno_id_1 => 'id' },
44 expense_account_2 => {
45 type => 'many to one',
46 class => 'SL::DB::Chart',
47 column_map => { expense_accno_id_2 => 'id' },
49 expense_account_3 => {
50 type => 'many to one',
51 class => 'SL::DB::Chart',
52 column_map => { expense_accno_id_3 => 'id' },
56 __PACKAGE__->meta->initialize;
60 my ($self, $taxzone) = @_;
61 my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
62 my $method = 'income_accno_id_' . $taxzone_id;
64 return $self->$method;
67 sub expense_accno_id {
68 my ($self, $taxzone) = @_;
69 my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
70 my $method = 'expense_accno_id_' . $taxzone_id;
72 return $self->$method;
76 my ($self, $taxzone) = @_;
77 my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
78 my $method = 'income_account_' . $taxzone_id;
80 return $self->$method;
84 my ($self, $taxzone) = @_;
85 my $taxzone_id = ref $taxzone && $taxzone->isa('SL::DB::TaxZone') ? $taxzone->id : $taxzone;
86 my $method = 'expense_account_' . $taxzone_id;
88 return $self->$method;
100 SL::DB::Buchungsgruppe - RDBO wrapper for the C<buchungsgruppen> table
106 =item C<expense_accno_id $taxzone>
108 Return the chart ID for the expense account for the given taxzone
109 (either an integer between 0 and 3 inclusively or an instance of
112 =item C<expense_account>
114 Return the chart (an instance of L<SL::DB::Chart>) for the expense
115 account for the given taxzone (either an integer between 0 and 3
116 inclusively or an instance of L<SL::DB::TaxZone>).
118 =item C<income_accno_id>
120 Return the chart ID for the income account for the given taxzone
121 (either an integer between 0 and 3 inclusively or an instance of
124 =item C<income_account>
126 Return the chart (an instance of L<SL::DB::Chart>) for the income
127 account for the given taxzone (either an integer between 0 and 3
128 inclusively or an instance of L<SL::DB::TaxZone>).
138 Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>,
139 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>