Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d91dbc1f

Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt

  • ID d91dbc1f9799e5ebfb2a5746a99ba5cc842d6617
  • Vorgänger 7bbdbf2b
  • Nachfolger f2779405

Part Controller - Helper Funktionen für linetotals

Unterschiede anzeigen:

SL/DB/Assembly.pm
12 12

  
13 13
__PACKAGE__->meta->initialize;
14 14

  
15
sub linetotal {
15
sub linetotal_sellprice {
16 16
  my ($self) = @_;
17 17

  
18 18
  return 0 unless $self->qty > 0 and $self->part->sellprice > 0;
SL/DB/AssortmentItem.pm
11 11

  
12 12
__PACKAGE__->meta->initialize;
13 13

  
14
sub linetotal {
14
sub linetotal_sellprice {
15 15
  my ($self) = @_;
16 16

  
17 17
  return 0 unless $self->qty > 0 and $self->part->sellprice > 0;
SL/DB/Part.pm
296 296
  my ($self) = @_;
297 297

  
298 298
  return unless $self->is_assembly;
299
  sum map { $_->linetotal } @{$self->part->assemblies};
299
  sum map { $_->linetotal_sellprice } @{$self->assemblies};
300 300
};
301 301

  
302 302
sub assembly_lastcost_sum {
303 303
  my ($self) = @_;
304 304

  
305 305
  return unless $self->is_assembly;
306
  sum map { $_->linetotal } @{$self->part->assemblies};
306
  sum map { $_->linetotal_lastcost } @{$self->assemblies};
307 307
};
308 308

  
309 309
sub assortment_sellprice_sum {
310 310
  my ($self) = @_;
311 311

  
312 312
  return unless $self->is_assortment;
313
  sum map { $_->linetotal } @{$self->part->assortment_items};
313
  sum map { $_->linetotal_sellprice } @{$self->assortment_items};
314 314
};
315 315

  
316 316
sub assortment_lastcost_sum {
317 317
  my ($self) = @_;
318 318

  
319 319
  return unless $self->is_assortment;
320
  sum map { $_->linetotal } @{$self->part->assortment_items};
320
  sum map { $_->linetotal_lastcost } @{$self->assortment_items};
321 321
};
322 322

  
323 323
1;

Auch abrufbar als: Unified diff