From d91dbc1f9799e5ebfb2a5746a99ba5cc842d6617 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Sun, 13 Nov 2016 11:28:28 +0100 Subject: [PATCH] =?utf8?q?Part=20Controller=20-=20Helper=20Funktionen=20f?= =?utf8?q?=C3=BCr=20linetotals?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Assembly.pm | 2 +- SL/DB/AssortmentItem.pm | 2 +- SL/DB/Part.pm | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/DB/Assembly.pm b/SL/DB/Assembly.pm index a77e34b54..2519c1a45 100644 --- a/SL/DB/Assembly.pm +++ b/SL/DB/Assembly.pm @@ -12,7 +12,7 @@ __PACKAGE__->meta->make_manager_class; __PACKAGE__->meta->initialize; -sub linetotal { +sub linetotal_sellprice { my ($self) = @_; return 0 unless $self->qty > 0 and $self->part->sellprice > 0; diff --git a/SL/DB/AssortmentItem.pm b/SL/DB/AssortmentItem.pm index 1f53f969f..4aca0c1b4 100644 --- a/SL/DB/AssortmentItem.pm +++ b/SL/DB/AssortmentItem.pm @@ -11,7 +11,7 @@ use Rose::DB::Object::Helpers qw(clone); __PACKAGE__->meta->initialize; -sub linetotal { +sub linetotal_sellprice { my ($self) = @_; return 0 unless $self->qty > 0 and $self->part->sellprice > 0; diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 32571276b..be6851eec 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -296,28 +296,28 @@ sub assembly_sellprice_sum { 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; -- 2.20.1