Revision 7ac61a7e
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
- ID 7ac61a7e2daace7dd425f25a4d63f40f13bc8b72
- Vorgänger 67f4335c
SL/Presenter/CustomerVendor.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use strict; |
4 | 4 |
|
5 |
use SL::DB::Customer; |
|
6 |
use SL::DB::Vendor; |
|
7 |
use SL::Locale::String; |
|
5 | 8 |
use SL::Presenter::EscapedText qw(escape is_escaped); |
6 | 9 |
use SL::Presenter::Tag qw(input_tag html_tag name_to_id select_tag link_tag); |
7 | 10 |
|
... | ... | |
16 | 19 |
} |
17 | 20 |
|
18 | 21 |
sub customer { |
19 |
my ($customer, %params) = @_; |
|
22 |
my ($customer_or_id, %params) = @_; |
|
23 |
my $customer; |
|
24 |
if (ref($customer_or_id) eq 'SL::DB::Customer') { |
|
25 |
$customer = $customer_or_id; |
|
26 |
} else { |
|
27 |
$customer = SL::DB::Customer->new(id => $customer_or_id)->load; |
|
28 |
} |
|
20 | 29 |
return _customer_vendor($customer, 'customer', %params); |
21 | 30 |
} |
22 | 31 |
|
23 | 32 |
sub vendor { |
24 |
my ($vendor, %params) = @_; |
|
33 |
my ($vendor_or_id, %params) = @_; |
|
34 |
my $vendor; |
|
35 |
if (ref($vendor_or_id) eq 'SL::DB::Vendor') { |
|
36 |
$vendor = $vendor_or_id; |
|
37 |
} else { |
|
38 |
$vendor = SL::DB::Vendor->new(id => $vendor_or_id)->load; |
|
39 |
} |
|
25 | 40 |
return _customer_vendor($vendor, 'vendor', %params); |
26 | 41 |
} |
27 | 42 |
|
... | ... | |
32 | 47 |
|
33 | 48 |
croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/; |
34 | 49 |
|
35 |
my $text = escape($cv->name); |
|
50 |
my $text = escape(delete $params{text} || $cv->name);
|
|
36 | 51 |
if (! delete $params{no_link}) { |
37 | 52 |
my $href = 'controller.pl?action=CustomerVendor/edit&db=' . $type |
38 | 53 |
. '&id=' . escape($cv->id); |
... | ... | |
107 | 122 |
|
108 | 123 |
=over 4 |
109 | 124 |
|
110 |
=item C<customer $object, %params> |
|
125 |
=item C<customer $object_or_id, %params>
|
|
111 | 126 |
|
112 | 127 |
Returns a rendered version (actually an instance of |
113 | 128 |
L<SL::Presenter::EscapedText>) of the customer object C<$object>. |
... | ... | |
127 | 142 |
If falsish (the default) then the customer's name will be linked to |
128 | 143 |
the "edit customer" dialog from the master data menu. |
129 | 144 |
|
145 |
=item * text |
|
146 |
|
|
147 |
If falsish (the default) then the customer's name will be used, otherwise the |
|
148 |
value is displayed. |
|
149 |
|
|
130 | 150 |
=back |
131 | 151 |
|
132 |
=item C<vendor $object, %params> |
|
152 |
=item C<vendor $object_or_id, %params>
|
|
133 | 153 |
|
134 | 154 |
Returns a rendered version (actually an instance of |
135 | 155 |
L<SL::Presenter::EscapedText>) of the vendor object C<$object>. |
... | ... | |
149 | 169 |
If falsish (the default) then the vendor's name will be linked to |
150 | 170 |
the "edit vendor" dialog from the master data menu. |
151 | 171 |
|
172 |
=item * text |
|
173 |
|
|
174 |
If falsish (the default) then the vendor's name will be used, otherwise the |
|
175 |
value is displayed. |
|
176 |
|
|
152 | 177 |
=back |
153 | 178 |
|
154 | 179 |
=item C<customer_vendor $object, %params> |
Auch abrufbar als: Unified diff
Debitoren-/Kreditorenbuchung: Kunde/Lieferant in neuem Tab bearbeiten