Revision 3b249feb
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
SL/DB/Assembly.pm | ||
---|---|---|
12 | 12 |
|
13 | 13 |
__PACKAGE__->meta->initialize; |
14 | 14 |
|
15 |
sub linetotal { |
|
16 |
my ($self) = @_; |
|
17 |
|
|
18 |
return 0 unless $self->qty > 0 and $self->part->sellprice > 0; |
|
19 |
return $self->qty * $self->part->sellprice / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 ); |
|
20 |
} |
|
21 |
|
|
22 |
sub linetotal_lastcost { |
|
23 |
my ($self) = @_; |
|
24 |
|
|
25 |
return 0 unless $self->qty > 0 and $self->part->lastcost > 0; |
|
26 |
return $self->qty * $self->part->lastcost / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 ); |
|
27 |
} |
|
28 |
|
|
15 | 29 |
1; |
Auch abrufbar als: Unified diff
Assembly - linetotal Helperfunktionen