X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0682dd7ebd3f16a8b7cf282df5c8343d6fa10068..f6ed86e:/SL/DB/Part.pm diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 1380c4d2b..a25b64a74 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -153,7 +153,6 @@ sub get_taxkey { if (!exists $cache->{$date}) { $cache->{$date} = $self->get_chart(type => $is_sales ? 'income' : 'expense', taxzone => $taxzone) - ->load ->get_active_taxkey($date); } @@ -172,12 +171,13 @@ sub get_chart { $charts->{$taxzone} ||= { }; if (!exists $charts->{$taxzone}->{$type}) { - my $bugru = $self->buchungsgruppe; + require SL::DB::Buchungsgruppe; + my $bugru = SL::DB::Buchungsgruppe->load_cached($self->buchungsgruppen_id); my $chart_id = ($type eq 'inventory') ? ($self->inventory_accno_id ? $bugru->inventory_accno_id : undef) - : $bugru->call_sub("${type}_accno_id_${taxzone}"); + : $bugru->call_sub("${type}_accno_id", $taxzone); if ($chart_id) { - my $chart = $all_charts->{$chart_id} // SL::DB::Chart->new(id => $chart_id)->load; + my $chart = $all_charts->{$chart_id} // SL::DB::Chart->load_cached($chart_id)->load; $all_charts->{$chart_id} = $chart; $charts->{$taxzone}->{$type} = $chart; } @@ -318,7 +318,7 @@ This function looks up the income (for trueish values of C<$params{is_sales}>) or expense (for falsish values of C<$params{is_sales}>) account for the current part. It uses the part's associated buchungsgruppe and uses the fields belonging to the tax -zone given by C<$params{taxzone}> (range 0..3). +zone given by C<$params{taxzone}>. The information retrieved by the function is cached. @@ -330,8 +330,7 @@ C<$params{type}> and tax zone C<$params{taxzone}> the three key words C, C and C. This function uses the part's associated buchungsgruppe and uses the -fields belonging to the tax zone given by C<$params{taxzone}> (range -0..3). +fields belonging to the tax zone given by C<$params{taxzone}>. The information retrieved by the function is cached.