Revision 00b15715
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__ |
Auch abrufbar als: Unified diff
DeliveryOrder: Presenter für die Statuszeile