From: Niclas Zimmermann Date: Mon, 3 Jun 2013 11:49:40 +0000 (+0200) Subject: Merge branch 'gewicht' X-Git-Tag: release-3.1.0beta1~388 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c6b2257945060625bcb86fa7e2efd27c737480ff;p=kivitendo-erp.git Merge branch 'gewicht' Conflicts: SL/Controller/ClientConfig.pm SL/DB/MetaSetup/Default.pm --- c6b2257945060625bcb86fa7e2efd27c737480ff diff --cc SL/Controller/ClientConfig.pm index 1bfa615ac,74bc8b597..148054e4e --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@@ -43,18 -43,8 +43,21 @@@ sub action_edit 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')); } @@@ -76,12 -66,7 +79,16 @@@ sub action_save 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!')); diff --cc SL/DB/MetaSetup/Default.pm index d6b6b8458,d45a7cfb4..6c1e5ecfb --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@@ -67,9 -68,7 +67,10 @@@ __PACKAGE__->meta->setup 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' ], diff --cc SL/IS.pm index 8f91a2360,2db51a5ae..1dc1eff60 --- a/SL/IS.pm +++ b/SL/IS.pm @@@ -1938,10 -1959,10 +1951,10 @@@ sub retrieve_item 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, diff --cc templates/webpages/client_config/form.html index dd9856353,6a3c0f582..bcbf845be --- a/templates/webpages/client_config/form.html +++ b/templates/webpages/client_config/form.html @@@ -177,27 -176,19 +177,39 @@@ [% 'Any stock contents containing a best before date will be impossible to stock out otherwise.' | $T8 %] + + + + [% 'Default Warehouse' | $T8 %] + + + + + [% 'This is the default bin for parts' | $T8 %]
+ + + + [% 'Default Bin' | $T8 %] + + + + + [% 'Weight' | $T8 %] + + + [% 'Show weights' | $T8 %] + + [% L.yes_no_tag('show_weight', SELF.show_weight) %] + + + [% 'Show the weights of articles and the total weight in orders, invoices and delivery notes?' | $T8 %]
+ +