From ae906113e922e784aadaadf1681eede43d7967c2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 1 Jul 2014 09:37:33 +0200 Subject: [PATCH] =?utf8?q?SL::DB::(Delivery)Order,(Purchase)Invoice:=20Ali?= =?utf8?q?ase=20=C2=BBadd=5Fitems=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- SL/DB/DeliveryOrder.pm | 1 + SL/DB/Invoice.pm | 1 + SL/DB/Order.pm | 1 + SL/DB/PurchaseInvoice.pm | 1 + 4 files changed, 4 insertions(+) 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) = @_; -- 2.20.1