X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBuchungsgruppe.pm;h=eb467c541b5791ed5aca4c235fd52b0a16d09e2a;hb=978a03de40e5710c6ca346a3dafb93352ecc7775;hp=3504e2a41dbd594c885f73f41ae22612f6ae7b89;hpb=f80a17face29cff2f398622cebc2321802a8662f;p=kivitendo-erp.git diff --git a/SL/DB/Buchungsgruppe.pm b/SL/DB/Buchungsgruppe.pm index 3504e2a41..eb467c541 100644 --- a/SL/DB/Buchungsgruppe.pm +++ b/SL/DB/Buchungsgruppe.pm @@ -73,6 +73,15 @@ sub taxzonecharts { return SL::DB::Manager::TaxzoneChart->get_all(where => [ buchungsgruppen_id => $self->id ]); } +sub orphaned { + my ($self) = @_; + die 'not an accessor' if @_ > 1; + + require SL::DB::Part; + return 0 if SL::DB::Manager::Part->get_all_count(query => [ buchungsgruppen_id => $self->id ]); + return 1; +} + 1; __END__ @@ -111,6 +120,10 @@ Return the chart (an instance of L) for the income account for the given taxzone (either the DB id or an instance of L). +=item C + +Checks whether this Buchungsgruppe is assigned to any parts. + =back =head1 BUGS