From: Moritz Bunkus Date: Fri, 1 Apr 2016 07:34:42 +0000 (+0200) Subject: CustomerVendor-Presenter: neue Funktion customer_vendor() X-Git-Tag: release-3.4.1~272 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8925999b50cb9e0bc179347e52743c79eed8ee9b;p=kivitendo-erp.git CustomerVendor-Presenter: neue Funktion customer_vendor() Damit der Aufrufer nicht im Vorfeld entscheiden muss, ob $object ein Kunde oder ein Lieferant ist. --- 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