Revision 36d7ceb2
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Presenter/Order.pm | ||
---|---|---|
6 | 6 |
use SL::Presenter::Tag qw(link_tag); |
7 | 7 |
|
8 | 8 |
use Exporter qw(import); |
9 |
our @EXPORT_OK = qw(sales_quotation sales_order request_quotation purchase_order); |
|
9 |
our @EXPORT_OK = qw(show order sales_quotation sales_order request_quotation purchase_order);
|
|
10 | 10 |
|
11 | 11 |
use Carp; |
12 | 12 |
|
13 |
sub sales_quotation { |
|
14 |
my ($order, %params) = @_; |
|
13 |
sub show {goto &order} |
|
15 | 14 |
|
16 |
return _oe_record($order, 'sales_quotation', %params); |
|
17 |
} |
|
15 |
sub sales_quotation {goto &order} |
|
18 | 16 |
|
19 |
sub sales_order_intake { |
|
20 |
my ($order, %params) = @_; |
|
17 |
sub sales_order_intake {goto &order} |
|
21 | 18 |
|
22 |
return _oe_record($order, 'sales_order_intake', %params); |
|
23 |
} |
|
19 |
sub sales_order {goto &order} |
|
24 | 20 |
|
25 |
sub sales_order { |
|
26 |
my ($order, %params) = @_; |
|
21 |
sub request_quotation {goto &order} |
|
27 | 22 |
|
28 |
return _oe_record($order, 'sales_order', %params); |
|
29 |
} |
|
23 |
sub purchase_quotation_intake {goto &order} |
|
30 | 24 |
|
31 |
sub request_quotation { |
|
32 |
my ($order, %params) = @_; |
|
25 |
sub purchase_order {goto &order} |
|
33 | 26 |
|
34 |
return _oe_record($order, 'request_quotation', %params); |
|
35 |
} |
|
36 |
|
|
37 |
sub purchase_quotation_intake { |
|
27 |
sub order { |
|
38 | 28 |
my ($order, %params) = @_; |
39 |
|
|
40 |
return _oe_record($order, 'purchase_quotation_intake', %params); |
|
41 |
} |
|
42 |
|
|
43 |
sub purchase_order { |
|
44 |
my ($order, %params) = @_; |
|
45 |
|
|
46 |
return _oe_record($order, 'purchase_order', %params); |
|
47 |
} |
|
48 |
|
|
49 |
sub _oe_record { |
|
50 |
my ($order, $type, %params) = @_; |
|
29 |
my $type = $order->record_type; |
|
51 | 30 |
|
52 | 31 |
$params{display} ||= 'inline'; |
53 | 32 |
|
... | ... | |
100 | 79 |
my $object = SL::DB::Manager::Order->get_first(where => [ SL::DB::Manager::Order->type_filter('purchase_order') ]); |
101 | 80 |
my $html = SL::Presenter::Order::purchase_order($object, display => 'inline'); |
102 | 81 |
|
82 |
# or for all types: |
|
83 |
my $html = SL::Presenter::Order::order($object); |
|
84 |
my $html = $object->presenter->show(); |
|
85 |
|
|
103 | 86 |
=head1 FUNCTIONS |
104 | 87 |
|
105 | 88 |
=over 4 |
106 | 89 |
|
107 |
=item C<sales_quotation $object, %params> |
|
108 |
|
|
109 |
Returns a rendered version (actually an instance of |
|
110 |
L<SL::Presenter::EscapedText>) of the sales quotation object |
|
111 |
C<$object>. |
|
112 |
|
|
113 |
Remaining C<%params> are passed to the function |
|
114 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
115 |
|
|
116 |
=over 2 |
|
117 |
|
|
118 |
=item * display |
|
119 |
|
|
120 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
121 |
C<SL::Presenter::Tag::link_tag>. |
|
122 |
|
|
123 |
=item * no_link |
|
124 |
|
|
125 |
If falsish (the default) then the order number will be linked to the |
|
126 |
"edit quotation" dialog from the sales menu. |
|
127 |
|
|
128 |
=back |
|
129 |
|
|
130 |
=item C<sales_order $object, %params> |
|
131 |
|
|
132 |
Returns a rendered version (actually an instance of |
|
133 |
L<SL::Presenter::EscapedText>) of the sales order object C<$object>. |
|
134 |
|
|
135 |
Remaining C<%params> are passed to the function |
|
136 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
137 |
|
|
138 |
=over 2 |
|
139 |
|
|
140 |
=item * display |
|
90 |
=item C<show $object %params> |
|
141 | 91 |
|
142 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
143 |
C<SL::Presenter::Tag::link_tag>. |
|
92 |
Alias for C<order $object %params>. |
|
144 | 93 |
|
145 |
=item * no_link
|
|
94 |
=item C<sales_quotation $object %params>
|
|
146 | 95 |
|
147 |
If falsish (the default) then the order number will be linked |
|
148 |
to the "edit order" dialog from the sales menu. |
|
96 |
Alias for C<order $object %params>. |
|
149 | 97 |
|
150 |
=back
|
|
98 |
=item C<sales_order_intake $object %params>
|
|
151 | 99 |
|
152 |
=item C<request_quotation $object, %params>
|
|
100 |
Alias for C<order $object %params>.
|
|
153 | 101 |
|
154 |
Returns a rendered version (actually an instance of |
|
155 |
L<SL::Presenter::EscapedText>) of the request for quotation object |
|
156 |
C<$object>. |
|
102 |
=item C<sales_order $object %params> |
|
157 | 103 |
|
158 |
Remaining C<%params> are passed to the function |
|
159 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
104 |
Alias for C<order $object %params>. |
|
160 | 105 |
|
161 |
=over 2
|
|
106 |
=item C<request_quotation $object %params>
|
|
162 | 107 |
|
163 |
=item * display
|
|
108 |
Alias for C<order $object %params>.
|
|
164 | 109 |
|
165 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
166 |
C<SL::Presenter::Tag::link_tag>. |
|
110 |
=item C<purchase_quotation_intake $object %params> |
|
167 | 111 |
|
168 |
=item * no_link
|
|
112 |
Alias for C<order $object %params>.
|
|
169 | 113 |
|
170 |
If falsish (the default) then the order number will be linked to the |
|
171 |
"edit request for quotation" dialog from the purchase menu. |
|
114 |
=item C<purchase_order $object %params> |
|
172 | 115 |
|
173 |
=back
|
|
116 |
Alias for C<order $object %params>.
|
|
174 | 117 |
|
175 |
=item C<purchase_order $object, %params>
|
|
118 |
=item C<order $object %params>
|
|
176 | 119 |
|
177 | 120 |
Returns a rendered version (actually an instance of |
178 | 121 |
L<SL::Presenter::EscapedText>) of the purchase order object |
... | ... | |
191 | 134 |
=item * no_link |
192 | 135 |
|
193 | 136 |
If falsish (the default) then the order number will be linked |
194 |
to the "edit order" dialog from the purchase menu.
|
|
137 |
to the "edit order" dialog. |
|
195 | 138 |
|
196 | 139 |
=back |
197 | 140 |
|
Auch abrufbar als: Unified diff
S:Presenter:Record: Alias Funktion "show" in verwendeten Objekten