Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0d5564ee

Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt

  • ID 0d5564ee4eaf6af6cbcc0c59b08e9ed16c828b49
  • Vorgänger 723a1158
  • Nachfolger 79cd754f

Neue Part-Methoden für Erzeugnis- und Sortimentssummen

derzeit noch nicht rekursiv (wenn ein Sortiment wiederum aus anderen
Sortimenten besteht).

Unterschiede anzeigen:

SL/DB/Part.pm
16 16
  module      => 'IC',
17 17
  cvars_alias => 1,
18 18
);
19
use List::Util qw(sum);
19 20

  
20 21
__PACKAGE__->meta->add_relationships(
21 22
  assemblies                     => {
......
284 285
  return $clone;
285 286
}
286 287

  
288
sub assembly_sellprice_sum {
289
  my ($self) = @_;
290

  
291
  return unless $self->is_assembly;
292
  sum map { $_->linetotal } @{$self->part->assemblies};
293
};
294

  
295
sub assembly_lastcost_sum {
296
  my ($self) = @_;
297

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

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

  
305
  return unless $self->is_assortment;
306
  sum map { $_->linetotal } @{$self->part->assortment_items};
307
};
308

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

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

  
287 316
1;
288 317

  
289 318
__END__
......
422 451
Please note, that this is a write only accessor, the original Buchungsgruppe can
423 452
not be retrieved from an article once set.
424 453

  
454
=item C<assembly_sellprice_sum>
455

  
456
Non-recursive sellprice sum of all the assembly item sellprices.
457

  
458
=item C<assortment_sellprice_sum>
459

  
460
Non-recursive sellprice sum of all the assortment item sellprices.
461

  
462
=item C<assembly_lastcost_sum>
463

  
464
Non-recursive lastcost sum of all the assembly item lastcosts.
465

  
466
=item C<assortment_lastcost_sum>
467

  
468
Non-recursive lastcost sum of all the assortment item lastcosts.
469

  
425 470
=back
426 471

  
427 472
=head1 AUTHORS

Auch abrufbar als: Unified diff