Revision bf6510a2
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/ClientConfig.pm | ||
---|---|---|
19 | 19 |
__PACKAGE__->run_before('check_auth'); |
20 | 20 |
|
21 | 21 |
use Rose::Object::MakeMethods::Generic ( |
22 |
'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates all_parts_time_unit
|
|
22 |
'scalar --get_set_init' => [ qw(defaults all_warehouses all_weightunits all_languages all_currencies all_templates h_unit_name
|
|
23 | 23 |
posting_options payment_options accounting_options inventory_options profit_options accounts balance_startdate_method_options) ], |
24 | 24 |
); |
25 | 25 |
|
... | ... | |
143 | 143 |
sub init_all_currencies { SL::DB::Manager::Currency->get_all_sorted } |
144 | 144 |
sub init_all_weightunits { my $unit = SL::DB::Manager::Unit->find_by(name => 'kg'); $unit ? $unit->convertible_units : [] } |
145 | 145 |
sub init_all_templates { +{ SL::Template->available_templates } } |
146 |
|
|
147 |
sub init_all_parts_time_unit { |
|
148 |
my $h_unit = first { $_ } map { SL::DB::Manager::Unit->find_by(name => $_) } qw(Std h Stunde); |
|
149 |
return [] unless $h_unit; |
|
150 |
|
|
151 |
my @convertible_unit_names = map { $_->name } @{ $h_unit->convertible_units }; |
|
152 |
|
|
153 |
return SL::DB::Manager::Part->get_all_sorted(where => [ unit => \@convertible_unit_names ]); |
|
154 |
} |
|
146 |
sub init_h_unit_name { first { SL::DB::Manager::Unit->find_by(name => $_) } qw(Std h Stunde) }; |
|
155 | 147 |
|
156 | 148 |
sub init_posting_options { |
157 | 149 |
[ { title => t8("never"), value => 0 }, |
... | ... | |
226 | 218 |
sub edit_form { |
227 | 219 |
my ($self) = @_; |
228 | 220 |
|
221 |
$::request->layout->use_javascript("${_}.js") for qw(autocomplete_part); |
|
222 |
|
|
229 | 223 |
$self->render('client_config/form', title => t8('Client Configuration'), |
230 | 224 |
make_chart_title => sub { $_[0]->accno . '--' . $_[0]->description }, |
231 | 225 |
make_templates_value => sub { 'templates/' . $_[0] }, |
232 |
make_part_title => sub { $_[0]->partnumber . ' ' . $_[0]->description }, |
|
233 | 226 |
); |
234 | 227 |
} |
235 | 228 |
|
Auch abrufbar als: Unified diff
Mandantenkonfiguration: Pflichtenheftstandardartikel mit Partpicker auswählen