X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d91dbc1f9799e5ebfb2a5746a99ba5cc842d6617..ddec2dcd58e019a3386dce322985da9bec0c9501:/SL/DB/Assembly.pm diff --git a/SL/DB/Assembly.pm b/SL/DB/Assembly.pm index 2519c1a45..fd645c2c9 100644 --- a/SL/DB/Assembly.pm +++ b/SL/DB/Assembly.pm @@ -1,6 +1,3 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - package SL::DB::Assembly; use strict; @@ -26,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;