]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Part.pm
SL::DB::Chart inventory_accno_id Prüfung abgefangen
[mfinanz.git] / SL / DB / Part.pm
index 7fd35d80ef2e0120c4da93560b6c0b4a7219e907..2535efca9a2c427a448ed57eb04d1609f58ecb0b 100644 (file)
@@ -130,6 +130,11 @@ sub new_assortment {
   $class->new(%params, part_type => 'assortment');
 }
 
+sub last_modification {
+  my ($self) = @_;
+  return $self->mtime or $self->itime;
+};
+
 sub orphaned {
   my ($self) = @_;
   die 'not an accessor' if @_ > 1;
@@ -212,7 +217,7 @@ sub get_chart {
   if (!exists $charts->{$taxzone}->{$type}) {
     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)
+    my $chart_id = ($type eq 'inventory') ? ($self->is_part ? $bugru->inventory_accno_id : undef)
                  :                          $bugru->call_sub("${type}_accno_id", $taxzone);
 
     if ($chart_id) {