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);
+ map { $self->{$_} = SL::DB::Default->get->$_ } qw(warehouse_id bin_id);
+ $::form->get_lists('warehouses' => { 'key' => 'WAREHOUSES',
+ 'bins' => 'BINS', });
+ $self->{WAREHOUSES} = $::form->{WAREHOUSES};
+ # leerer lagerplatz mit id 0
+ my $no_default_bin_entry = { 'id' => '0', description => '--', 'BINS' => [ { id => '0', description => ''} ] };
+ push @ { $self->{WAREHOUSES} }, $no_default_bin_entry;
+
+ if (my $max = scalar @{ $self->{WAREHOUSES} }) {
+ $self->{warehouse_id} ||= $self->{WAREHOUSES}->[$max -1]->{id};
+ $self->{bin_id} ||= $self->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id};
+ }
++
+ $self->{show_weight} = SL::DB::Default->get->show_weight;
+
$self->render('client_config/form', title => $::locale->text('Client Configuration'));
}
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);
++<<<<<<< HEAD
+ # undef warehouse_id if the empty value is selected
+ if ( ($::form->{warehouse_id} == 0) && ($::form->{bin_id} == 0) ) {
+ undef $::form->{warehouse_id};
+ undef $::form->{bin_id};
+ }
+ map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(warehouse_id bin_id);
++=======
+ SL::DB::Default->get->update_attributes('show_weight' => $::form->{show_weight});
++>>>>>>> gewicht
flash_later('info', $::locale->text('Client Configuration saved!'));
ar_show_mark_as_paid => { type => 'boolean', default => 'true' },
ap_show_mark_as_paid => { type => 'boolean', default => 'true' },
assemblynumber => { type => 'text' },
+ warehouse_id => { type => 'integer' },
+ bin_id => { type => 'integer' },
+ currency_id => { type => 'integer', not_null => 1 },
+ show_weight => { type => 'boolean', default => 'false', not_null => 1 },
],
primary_key_columns => [ 'id' ],
c3.new_chart_id AS expense_new_chart,
date($transdate) - c3.valid_from AS expense_valid,
- p.unit, p.assembly, p.bin, p.onhand,
+ p.unit, p.assembly, p.onhand,
p.notes AS partnotes, p.notes AS longdescription,
p.not_discountable, p.formel, p.payment_id AS part_payment_id,
- p.price_factor_id,
+ p.price_factor_id, p.weight,
pfac.factor AS price_factor,
[% 'Any stock contents containing a best before date will be impossible to stock out otherwise.' | $T8 %]
</td>
</tr>
+ <tr> </tr>
+ <tr> </tr>
+ <tr>
+ <th align="right" nowrap="true">[% 'Default Warehouse' | $T8 %]</th>
+ <td>
+ <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
+ [%- FOREACH warehouse = SELF.WAREHOUSES %]
+ <option value="[% HTML.escape(warehouse.id) %]"[% IF SELF.warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
+ [%- END %]
+ </select>
+ </td>
+ <td>
+ [% 'This is the default bin for parts' | $T8 %]<br>
+ </td>
+ </tr>
+ <tr>
+ <th align="right" nowrap="true">[% 'Default Bin' | $T8 %]</th>
+ <td><select id="bin_id" name="bin_id"></select></td>
+ </tr>
+
+ <tr class='listheading'>
+ <th colspan="3">[% 'Weight' | $T8 %]</th>
+ </tr>
+ <tr>
+ <td align="right">[% 'Show weights' | $T8 %]</td>
+ <td>
+ [% L.yes_no_tag('show_weight', SELF.show_weight) %]
+ </td>
+ <td>
+ [% 'Show the weights of articles and the total weight in orders, invoices and delivery notes?' | $T8 %]<br>
+ </td>
+ </tr>
</table>
<br>