From 8925999b50cb9e0bc179347e52743c79eed8ee9b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 1 Apr 2016 09:34:42 +0200 Subject: [PATCH] CustomerVendor-Presenter: neue Funktion customer_vendor() Damit der Aufrufer nicht im Vorfeld entscheiden muss, ob $object ein Kunde oder ein Lieferant ist. --- SL/Presenter/CustomerVendor.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/SL/Presenter/CustomerVendor.pm b/SL/Presenter/CustomerVendor.pm index 5f41a2a50..fccfa1daf 100644 --- a/SL/Presenter/CustomerVendor.pm +++ b/SL/Presenter/CustomerVendor.pm @@ -5,10 +5,15 @@ use strict; use parent qw(Exporter); use Exporter qw(import); -our @EXPORT = qw(customer vendor customer_vendor_picker); +our @EXPORT = qw(customer_vendor customer vendor customer_vendor_picker); use Carp; +sub customer_vendor { + my ($self, $customer_vendor, %params) = @_; + return _customer_vendor($self, $customer_vendor, ref($customer_vendor) eq 'SL::DB::Customer' ? 'customer' : 'vendor', %params); +} + sub customer { my ($self, $customer, %params) = @_; return _customer_vendor($self, $customer, 'customer', %params); @@ -136,6 +141,14 @@ the "edit vendor" dialog from the master data menu. =back +=item C + +Returns a rendered version (actually an instance of +L) of the customer or vendor object +C<$object> by calling either L or L depending on +C<$object>'s type. See the respective functions for available +parameters. + =back =head1 BUGS -- 2.20.1