From: Moritz Bunkus Date: Tue, 1 Jul 2014 07:37:33 +0000 (+0200) Subject: SL::DB::(Delivery)Order,(Purchase)Invoice: Aliase »add_items« X-Git-Tag: release-3.2.0beta~406 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ae906113e922e784aadaadf1681eede43d7967c2;p=kivitendo-erp.git SL::DB::(Delivery)Order,(Purchase)Invoice: Aliase »add_items« Die Relationships für die Positionen heißen in allen Klassen unterschiedlich. Daher gibt es schon seit Längerem den Alias »items« in allen Klassen. Das Hinzufügen von Positionen hingegen erforderte bisher, dass man den Namen der Relationship kennt, z.B. für Invoice: $obj->add_invoiceitems. Um das zu Vereinfachen: neuer Alias »add_items« in allen vier Klassen. --- diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index 06024855f..824689353 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -44,6 +44,7 @@ sub _before_save_set_donumber { # methods sub items { goto &orderitems; } +sub add_items { goto &add_orderitems; } sub items_sorted { my ($self) = @_; diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 502654ba2..f0f3d0a1d 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -63,6 +63,7 @@ sub _before_save_set_invnumber { # methods sub items { goto &invoiceitems; } +sub add_items { goto &add_invoiceitems; } sub items_sorted { my ($self) = @_; diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index a605a3689..9e7817344 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -60,6 +60,7 @@ sub _before_save_set_ord_quo_number { # methods sub items { goto &orderitems; } +sub add_items { goto &add_orderitems; } sub items_sorted { my ($self) = @_; diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index 2457cdefb..3245e4b91 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -34,6 +34,7 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; sub items { goto &invoiceitems; } +sub add_items { goto &add_invoiceitems; } sub items_sorted { my ($self) = @_;