X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDB%2FAssembly.pm;h=fd645c2c98eaaa94b3961d2745095ebeae74c129;hb=52d62341eb8fd6c0d1affb1fad4500d011953b6f;hp=42d155f4b8ddd4c1db04ce1110fccf343beb244d;hpb=5d711a25d9257690164f396b25f57095776790d6;p=kivitendo-erp.git diff --git a/SL/DB/Assembly.pm b/SL/DB/Assembly.pm index 42d155f4b..fd645c2c9 100644 --- a/SL/DB/Assembly.pm +++ b/SL/DB/Assembly.pm @@ -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;