</tr>|;
- $form->{selectcustomer} = $myconfig{vclimit} > scalar(@{ $form->{ALL_CUSTOMERS} });
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) {
+ push(@values, $item->{name}.qq|--|.$item->{"id"});
+ $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"};
+ }
+
+ $form->{selectcustomer} = ($myconfig{vclimit} > scalar(@values));
my $customers = qq|
<th align="right">| . $locale->text('Customer') . qq|</th>
- <td>|
- . $form->parse_html_template('generic/multibox',
- { 'name' => 'customer',
- 'default' => $form->{oldcustomer},
- 'style' => 'width: 250px',
- 'DATA' => $form->{ALL_CUSTOMERS},
- 'id_sub' => 'vc_keys',
- 'vc_keys' => sub { "$_[0]->{name}--$_[0]->{id}" },
- 'label_key' => 'name',
- 'select' => 'customer_or_vendor_selection_window(\'customer\', \'\', 0, 0);',
- 'limit' => $myconfig{vclimit},
- 'allow_textbox' => 1,
- 'onChange' => "document.getElementById('update_button').click();" })
- . qq| <input type="button" value="| . $locale->text('Details (one letter abbreviation)') . qq|" onclick="show_vc_details('customer')"></td>|;
+ <td>| .
+ (($myconfig{vclimit} <= scalar(@values))
+ ? qq|<input type="text" value="| . H($form->{customer}) . qq|" name="customer">|
+ : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
+ <input type="button" value="| . $locale->text('Details (one letter abbreviation)') . qq|" onclick="show_vc_details('customer')">
+ </td>|;
%labels = ();
@values = ("");
#write Trigger
$jsscript =
Form->write_trigger(\%myconfig, "3",
- "invdate", "BL", "trigger1",
+ "invdate", "BL", "trigger1",
"duedate", "BL", "trigger2",
"deliverydate", "BL", "trigger3");
}
<body onLoad="$onload">
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/delivery_customer_selection.js"></script>
-<script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
+<script type="text/javascript" src="js/vendor_selection.js"></script>
<script type="text/javascript" src="js/calculate_qty.js"></script>
<script type="text/javascript" src="js/follow_up.js"></script>
$form->hide_form(qw(id action type media format queued printed emailed title vc discount
creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id
max_dunning_level dunning_amount
- shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax
+ shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax
shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus
convert_from_do_ids convert_from_oe_ids),
map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} );
-
+
print qq|<p>$form->{saved_message}</p>| if $form->{saved_message};
print qq|
print qq| <tr>
<th align="right" nowrap>| . $locale->text('Credit Note Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+ $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
qq| </td>
</tr>
<tr>
print qq| <tr>
<th align="right" nowrap>| . $locale->text('Invoice Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+ $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
qq| </td>
</tr>
<tr>
<tr>
<th align="right" nowrap>| . $locale->text('Delivery Order Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) .
+ $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) .
qq| </td>
</tr>
<tr>
print qq| <tr>
<th align="right" nowrap>| . $locale->text('Order Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) .
+ $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) .
qq| </td>
</tr>
<tr>
<tr>
<th align="right" nowrap>| . $locale->text('Quotation Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) .
+ $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) .
qq| </td>
</tr>
<tr>
<tr>
<th align="right" nowrap>| . $locale->text('Customer Order Number') . qq|</th>
<td> |.
- $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) .
+ $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) .
qq| </td>
</tr>
<tr>
<tr>
<td>
</td>
- </tr>
+ </tr>
$jsscript
|;
print qq|<input type="hidden" name="webdav" value="$webdav">|;
. qq|"> |;
}
# /button for saving history
-
- # mark_as_paid button
- if($form->{id} ne "") {
- print qq|<input type="submit" class="submit" name="action" value="|
+
+ # mark_as_paid button
+ if($form->{id} ne "") {
+ print qq|<input type="submit" class="submit" name="action" value="|
. $locale->text('mark as paid') . qq|">|;
}
# /mark_as_paid button
$auth->assert('invoice_edit');
- &mark_as_paid_common(\%myconfig,"ar");
+ &mark_as_paid_common(\%myconfig,"ar");
$lxdebug->leave_sub();
}
map { $form->{item_list}[$i]{$_} =~ s/\"/"/g } qw(partnumber description unit);
map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
-
+
$form->{payment_id} = $form->{"part_payment_id_$i"} if $form->{"part_payment_id_$i"} ne "";
$form->{"discount_$i"} = 0 if $form->{"not_discountable_$i"};