Revision 0779f095
Von Sven Schöling vor fast 3 Jahren hinzugefügt
SL/Presenter/DeliveryOrder.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use strict; |
4 | 4 |
|
5 |
use SL::DB::DeliveryOrder::TypeData (); |
|
6 |
use SL::Locale::String qw(t8); |
|
5 | 7 |
use SL::Presenter::EscapedText qw(escape is_escaped); |
6 | 8 |
|
7 | 9 |
use Exporter qw(import); |
8 |
our @EXPORT_OK = qw(sales_delivery_order purchase_delivery_order); |
|
10 |
our @EXPORT_OK = qw(sales_delivery_order purchase_delivery_order delivery_order_status_line);
|
|
9 | 11 |
|
10 | 12 |
use Carp; |
11 | 13 |
|
... | ... | |
63 | 65 |
is_escaped($text); |
64 | 66 |
} |
65 | 67 |
|
68 |
sub stock_status { |
|
69 |
my ($delivery_order) = @_; |
|
70 |
|
|
71 |
my $in_out = SL::DB::DeliveryOrder::TypeData::get3($delivery_order->type, "properties", "transfer"); |
|
72 |
|
|
73 |
if ($in_out eq 'in') { |
|
74 |
return escape($delivery_order->delivered ? t8('transferred in') : t8('not transferred in yet')); |
|
75 |
} |
|
76 |
|
|
77 |
if ($in_out eq 'out') { |
|
78 |
return escape($delivery_order->delivered ? t8('transferred out') : t8('not transferred out yet')); |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
82 |
sub closed_status { |
|
83 |
my ($delivery_order) = @_; |
|
84 |
|
|
85 |
return escape($delivery_order->closed ? t8('Closed') : t8('Open')) |
|
86 |
} |
|
87 |
|
|
88 |
sub status_line { |
|
89 |
my ($delivery_order) = @_; |
|
90 |
|
|
91 |
return "" unless $delivery_order->id; |
|
92 |
|
|
93 |
stock_status($delivery_order) . " ; " . closed_status($delivery_order) |
|
94 |
} |
|
95 |
|
|
96 |
sub delivery_order_status_line { goto &status_line }; |
|
97 |
|
|
66 | 98 |
1; |
67 | 99 |
|
68 | 100 |
__END__ |
templates/webpages/delivery_order/tabs/basic_data.html | ||
---|---|---|
98 | 98 |
<table> |
99 | 99 |
|
100 | 100 |
<tr> |
101 |
<td colspan="2" align="center"> |
|
102 |
[%- IF SELF.order.id %] |
|
103 |
[%- IF SELF.order.delivered %] |
|
104 |
[%- IF SELF.type_data.transfer == 'out' %] |
|
105 |
[% 'transferred out' | $T8 %] |
|
106 |
[%- ELSE %] |
|
107 |
[% 'transferred in' | $T8 %] |
|
108 |
[%- END %] |
|
109 |
[%- ELSE %] |
|
110 |
[%- IF SELF.type_data.transfer == 'out' %] |
|
111 |
[% 'not transferred out yet' | $T8 %] |
|
112 |
[%- ELSE %] |
|
113 |
[% 'not transferred in yet' | $T8 %] |
|
114 |
[%- END %] |
|
115 |
[%- END %] |
|
116 |
; |
|
117 |
[%- IF SEF.order.closed %] |
|
118 |
[% 'Closed' | $T8 %] |
|
119 |
[%- ELSE %] |
|
120 |
[% 'Open' | $T8 %] |
|
121 |
[%- END %] |
|
122 |
[%- END %] |
|
123 |
</td> |
|
101 |
<td colspan="2" align="center" id="data-status-line">[% SELF.order.presenter.status_line %]</td> |
|
124 | 102 |
</tr> |
125 | 103 |
|
126 | 104 |
<tr> |
Auch abrufbar als: Unified diff
DeliveryOrder: Presenter für die Statuszeile