]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/DB/Assembly.pm
Erzeugnisse: Gewicht aus einzelnen Bestandteilen ermitteln und speichern.
[kivitendo-erp.git] / SL / DB / Assembly.pm
index 42d155f4b8ddd4c1db04ce1110fccf343beb244d..fd645c2c98eaaa94b3961d2745095ebeae74c129 100644 (file)
@@ -23,4 +23,11 @@ sub linetotal_lastcost {
   return $self->qty * $self->part->lastcost / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 );
 }
 
+sub linetotal_weight {
+  my ($self) = @_;
+
+  return 0 unless $self->qty > 0 and ($self->part->weight||0) > 0;
+  return $self->qty * $self->part->weight;
+}
+
 1;