Merge branch 'gewicht'
authorNiclas Zimmermann <niclas@kivitendo-premium.de>
Mon, 3 Jun 2013 11:49:40 +0000 (13:49 +0200)
committerNiclas Zimmermann <niclas@kivitendo-premium.de>
Mon, 3 Jun 2013 11:49:40 +0000 (13:49 +0200)
Conflicts:
SL/Controller/ClientConfig.pm
SL/DB/MetaSetup/Default.pm

1  2 
SL/Controller/ClientConfig.pm
SL/DB/Helper/FlattenToForm.pm
SL/DB/MetaSetup/Default.pm
SL/DO.pm
SL/IS.pm
SL/OE.pm
locale/de/all
templates/webpages/client_config/form.html

@@@ -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!'));
  
Simple merge
@@@ -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/DO.pm
Simple merge
diff --cc 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 SL/OE.pm
Simple merge
diff --cc locale/de/all
Simple merge
       [% '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>