+ # Get pricegroup_id and save it. Unfortunately the interface
+ # also uses ID "0" for signalling that none is selected, but "0"
+ # must not be stored in the database. Therefore we cannot simply
+ # use conv_i().
+ my $pricegroup_id = $form->{"pricegroup_id_$i"} * 1;
+ $pricegroup_id = undef if !$pricegroup_id;
+