Revision ca099d9f
Von Jan Büren vor mehr als 11 Jahren hinzugefügt
SL/Controller/ClientConfig.pm | ||
---|---|---|
43 | 43 |
|
44 | 44 |
map { $self->{$_} = SL::DB::Default->get->$_ } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); |
45 | 45 |
|
46 |
map { $self->{$_} = SL::DB::Default->get->$_ } qw(warehouse_id bin_id); |
|
47 |
$::form->get_lists('warehouses' => { 'key' => 'WAREHOUSES', |
|
48 |
'bins' => 'BINS', }); |
|
49 |
$self->{WAREHOUSES} = $::form->{WAREHOUSES}; |
|
50 |
# leerer lagerplatz mit id 0 |
|
51 |
my $no_default_bin_entry = { 'id' => '0', description => '--', 'BINS' => [ { id => '0', description => ''} ] }; |
|
52 |
push @ { $self->{WAREHOUSES} }, $no_default_bin_entry; |
|
53 |
|
|
54 |
if (my $max = scalar @{ $self->{WAREHOUSES} }) { |
|
55 |
$self->{warehouse_id} ||= $self->{WAREHOUSES}->[$max -1]->{id}; |
|
56 |
$self->{bin_id} ||= $self->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id}; |
|
57 |
} |
|
46 | 58 |
$self->render('client_config/form', title => $::locale->text('Client Configuration')); |
47 | 59 |
} |
48 | 60 |
|
... | ... | |
64 | 76 |
|
65 | 77 |
map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); |
66 | 78 |
|
79 |
# undef warehouse_id if the empty value is selected |
|
80 |
if ( ($::form->{warehouse_id} == 0) && ($::form->{bin_id} == 0) ) { |
|
81 |
undef $::form->{warehouse_id}; |
|
82 |
undef $::form->{bin_id}; |
|
83 |
} |
|
84 |
map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(warehouse_id bin_id); |
|
85 |
|
|
67 | 86 |
flash_later('info', $::locale->text('Client Configuration saved!')); |
68 | 87 |
|
69 | 88 |
$self->redirect_to(action => 'edit'); |
templates/webpages/client_config/form.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %][%- USE L %][% USE LxERP %] |
2 | 2 |
|
3 |
[% PROCESS 'common/select_warehouse_bin.html' warehouses=FORM.warehouses %] |
|
3 | 4 |
<h1>[% title | html %]</h1> |
4 | 5 |
|
5 | 6 |
[% PROCESS 'common/flash.html' %] |
... | ... | |
176 | 177 |
[% 'Any stock contents containing a best before date will be impossible to stock out otherwise.' | $T8 %] |
177 | 178 |
</td> |
178 | 179 |
</tr> |
180 |
<tr> </tr> |
|
181 |
<tr> </tr> |
|
182 |
<tr> |
|
183 |
<th align="right" nowrap="true">[% 'Default Warehouse' | $T8 %]</th> |
|
184 |
<td> |
|
185 |
<select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)"> |
|
186 |
[%- FOREACH warehouse = SELF.WAREHOUSES %] |
|
187 |
<option value="[% HTML.escape(warehouse.id) %]"[% IF SELF.warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option> |
|
188 |
[%- END %] |
|
189 |
</select> |
|
190 |
</td> |
|
191 |
<td> |
|
192 |
[% 'This is the default bin for parts' | $T8 %]<br> |
|
193 |
</td> |
|
194 |
</tr> |
|
195 |
<tr> |
|
196 |
<th align="right" nowrap="true">[% 'Default Bin' | $T8 %]</th> |
|
197 |
<td><select id="bin_id" name="bin_id"></select></td> |
|
198 |
</tr> |
|
199 |
|
|
179 | 200 |
|
180 | 201 |
</table> |
181 | 202 |
|
Auch abrufbar als: Unified diff
Standardlager und Standardlagerplatz über Mandantenkonfiguration einstellbar