X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FManager%2FTaxZone.pm;h=25ec4425233a45635ba2f530933e7a9737b105b2;hb=b269674b6b0e99818c3643d4fc3271a8ce83b8c6;hp=6d61fad94e17e068b5a685a47fb274a713284331;hpb=f5c454e3855012bdb1928f3e4c4964403d4d8163;p=kivitendo-erp.git diff --git a/SL/DB/Manager/TaxZone.pm b/SL/DB/Manager/TaxZone.pm index 6d61fad94..25ec44252 100644 --- a/SL/DB/Manager/TaxZone.pm +++ b/SL/DB/Manager/TaxZone.pm @@ -17,4 +17,36 @@ sub _sort_spec { columns => { SIMPLE => 'ALL' } ); } +sub get_default { + return $_[0]->get_first(where => [ obsolete => 0 ], sort_by => 'sortkey'); +} + 1; +__END__ + +=pod + +=encoding utf8 + +=head1 NAME + +SL::DB::Manager::TaxZone - RDBO manager for the C table + +=head1 FUNCTIONS + +=over 4 + +=item C + +Returns an RDBO instance corresponding to the default taxzone. The default +taxzone is defined as the taxzone with the highest sort order (usually 1) that +is not set to obsolete. + +Example: + + my $default_taxzone_id = SL::DB::Manager::TaxZone->get_default->id; + + +=back + +=cut