+ # get vendor or customer discount
+ my $vc_discount;
+ my $saved_form = save_form();
+ if ($form->{vc} eq 'vendor') {
+ IR->get_vendor(\%myconfig, \%$form);
+ $vc_discount = $form->{vendor_discount};
+ } else {
+ IS->get_customer(\%myconfig, \%$form);
+ $vc_discount = $form->parse_amount(\%myconfig, $form->{customer_discount});
+ }
+ restore_form($saved_form);
+