]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Assembly.pm
Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[mfinanz.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;