From 31347b09de4258cab0dd7c251ea69a4485e5f40b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 5 Oct 2015 11:45:27 +0200 Subject: [PATCH] =?utf8?q?OrderItem=20POD=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hinweis auf entfernte Funktionen und Verbesserungsmöglichkeiten. --- SL/DB/OrderItem.pm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/SL/DB/OrderItem.pm b/SL/DB/OrderItem.pm index 1eb524734..5fcb8be2a 100644 --- a/SL/DB/OrderItem.pm +++ b/SL/DB/OrderItem.pm @@ -44,3 +44,47 @@ sub record { goto &order } 1; +__END__ + +=pod + +=head1 NAME + +SL::DB::OrderItems: Rose model for orderitems + +=head1 FUNCTIONS + +=over 4 + +=item C + +returns the number of orderitems which are already linked to Delivery Orders. +The linked key is parts_id and not orderitems (id) -> delivery_order_items (id). +Therefore this function is not safe for identical parts_id. +Sample call: +C<$::form-Eformat_amount(\%::myconfig, $_[0]-Eshipped_qty);> + +=back + +=head1 TODO + +Older versions of OrderItem.pm had more functions which where used for calculating the +qty for the different states of the Delivery Order. +For example to get the qty in already marked as delivered Delivery Orders: + +C + +return $self-E_delivered_qty; + + sub _delivered_qty { + (..) + my @d_orders_delivered = grep { $_-Edelivered } @$d_orders; + my @doi_delivered = grep { $_-Eparts_id == $self-Eparts_id } map { $_-Eorderitems } @d_orders_delivered; + } + +In general the function C and all (project) related functions should be marked deprecate, + because of the better linked item to item data in the record_links table. + + + + -- 2.20.1