__PACKAGE__->meta->initialize;
-sub linetotal {
+sub linetotal_sellprice {
my ($self) = @_;
return 0 unless $self->qty > 0 and $self->part->sellprice > 0;
my ($self) = @_;
return unless $self->is_assembly;
- sum map { $_->linetotal } @{$self->part->assemblies};
+ sum map { $_->linetotal_sellprice } @{$self->assemblies};
};
sub assembly_lastcost_sum {
my ($self) = @_;
return unless $self->is_assembly;
- sum map { $_->linetotal } @{$self->part->assemblies};
+ sum map { $_->linetotal_lastcost } @{$self->assemblies};
};
sub assortment_sellprice_sum {
my ($self) = @_;
return unless $self->is_assortment;
- sum map { $_->linetotal } @{$self->part->assortment_items};
+ sum map { $_->linetotal_sellprice } @{$self->assortment_items};
};
sub assortment_lastcost_sum {
my ($self) = @_;
return unless $self->is_assortment;
- sum map { $_->linetotal } @{$self->part->assortment_items};
+ sum map { $_->linetotal_lastcost } @{$self->assortment_items};
};
1;