use SL::IR;
use SL::IS;
use SL::ReportGenerator;
+use SL::DB::Currency;
use SL::DB::Default;
use SL::DB::PurchaseInvoice;
use SL::Webdav;
# currencies
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- $form->{selectcurrency} = "";
- map { my $quoted = H($_); $form->{selectcurrency} .= "<option value=\"${quoted}\">${quoted}\n" } $form->get_all_currencies(\%myconfig);
-
# vendors
if (@{ $form->{all_vendor} || [] }) {
$form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|;
# type=submit $locale->text('Edit Accounts Payables Transaction')
# set option selected
- foreach my $item (qw(vendor currency)) {
+ foreach my $item (qw(vendor)) {
my $to_replace = H($form->{$item});
$form->{"select$item"} =~ s/ selected//;
$form->{"select$item"} =~ s/>\Q${to_replace}\E/ selected>${to_replace}/;
print $form->parse_html_template('ap/form_header', {
today => DateTime->today,
+ currencies => SL::DB::Manager::Currency->get_all_sorted,
});
$main::lxdebug->leave_sub();
<form method="post" action="[% script | html %]">
<input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
-<input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]">
<input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
<input type="hidden" name="vendor_id" value="[% vendor_id | html %]">
<tr>
<th align="right" nowrap>[% 'Currency' | $T8 %]</th>
- <td><select name="currency">[% selectcurrency %]</select></td>
+ <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
[% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
<th align=right>[% 'Exchangerate' | $T8 %]</th>