]> wagnertech.de Git - kivitendo-erp.git/commitdiff
SL::Helper::ShippedQty: chaining vervollständigt und dokumentiert
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 26 Jul 2017 11:42:53 +0000 (13:42 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 26 Jul 2017 11:43:46 +0000 (13:43 +0200)
SL/Helper/ShippedQty.pm

index 13efcb5a690f3c2d878327b01190f39410f88fa4..3bc8ee12a7ee5275f80f943c9cb5aa1377c2643f 100644 (file)
@@ -225,6 +225,7 @@ sub write_to {
       die "unknown reference '@{[ ref $obj ]}' for @{[ __PACKAGE__ ]}::write_to";
     }
   }
       die "unknown reference '@{[ ref $obj ]}' for @{[ __PACKAGE__ ]}::write_to";
     }
   }
+  $self;
 }
 
 sub write_to_objects {
 }
 
 sub write_to_objects {
@@ -332,6 +333,9 @@ SL::Helper::ShippedQty - Algorithmic module for calculating shipped qty
   # delivered by oe_id
   my $delivered = $helper->delievered->{$oi->id};
 
   # delivered by oe_id
   my $delivered = $helper->delievered->{$oi->id};
 
+  # calculate and write_to can be chained:
+  my $helper = SL::Helper::ShippedQty->new->calculate($orders)->write_to_objects;
+
 =head1 DESCRIPTION
 
 This module encapsulates the algorithm needed to compute the shipped qty for
 =head1 DESCRIPTION
 
 This module encapsulates the algorithm needed to compute the shipped qty for