X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f7cdb6db874f2c71d6c13d0733021e23d71e68f3..15b2640059:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 7800daa0d..3f337f103 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -240,9 +240,14 @@ sub post { require SL::DB::Chart; if (!$params{ar_id}) { - my $chart = SL::DB::Manager::Chart->get_all(query => [ SL::DB::Manager::Chart->link_filter('AR') ], - sort_by => 'id ASC', - limit => 1)->[0]; + my $chart; + if ($::instance_conf->get_ar_chart_id) { + $chart = SL::DB::Manager::Chart->find_by(id => $::instance_conf->get_ar_chart_id); + } else { + $chart = SL::DB::Manager::Chart->get_all(query => [ SL::DB::Manager::Chart->link_filter('AR') ], + sort_by => 'id ASC', + limit => 1)->[0]; + }; croak("No AR chart found and no parameter 'ar_id' given") unless $chart; $params{ar_id} = $chart->id; }