+sub _stock_in_out_set_qty_display {
+ my $stock_info = shift;
+ my $form = $::form;
+ my $all_units = AM->retrieve_all_units();
+ my $sum = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info });
+ $form->{qty_display} = $form->format_amount_units(amount => $sum * 1,
+ part_unit => $form->{partunit},
+ amount_unit => $all_units->{ $form->{partunit} }->{base_unit},
+ conv_units => 'convertible_not_smaller',
+ max_places => 2);
+}
+