+ %labels = ();
+ @values = ();
+
+ foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
+ push(@values, $item->{name}.qq|--|.$item->{"id"});
+ $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
+ }
+
+ $vc = qq|
+ <input type="hidden" name="$form->{vc}_id" value="| . H($form->{"$form->{vc}_id"}) . qq|">
+ <input type="hidden" name="old$form->{vc}" value="| . H($form->{"old$form->{vc}"}) . qq|">
+ <th align="right">| . $locale->text(ucfirst($form->{vc})) . qq|</th>
+ <td>| .
+ (($myconfig{vclimit} <= scalar(@values))
+ ? qq|<input type="text" value="| . H($form->{"old$form->{vc}"}) . qq|" name="$form->{vc}">|
+ : (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"},
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels)))) . qq|
+ </td><input type=hidden name="select$form->{vc}" value="| .
+ Q($form->{"select$form->{vc}"}) . qq|">|;
+
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_PAYMENTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
+ }
+
+ $payments = qq|
+ <th align="right">| . $locale->text('Payment Terms') . qq|</th>
+ <td>| .
+ NTI($cgi->popup_menu('-name' => 'payment_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{payment_id}))
+ . qq|</td>|;
+