Revision 122f91e7
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
42 | 42 |
use SL::IR; |
43 | 43 |
use SL::IS; |
44 | 44 |
use SL::ReportGenerator; |
45 |
use SL::DB::Currency; |
|
45 | 46 |
use SL::DB::Default; |
46 | 47 |
use SL::DB::PurchaseInvoice; |
47 | 48 |
use SL::Webdav; |
... | ... | |
185 | 186 |
# currencies |
186 | 187 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
187 | 188 |
|
188 |
$form->{selectcurrency} = ""; |
|
189 |
map { my $quoted = H($_); $form->{selectcurrency} .= "<option value=\"${quoted}\">${quoted}\n" } $form->get_all_currencies(\%myconfig); |
|
190 |
|
|
191 | 189 |
# vendors |
192 | 190 |
if (@{ $form->{all_vendor} || [] }) { |
193 | 191 |
$form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|; |
... | ... | |
248 | 246 |
# type=submit $locale->text('Edit Accounts Payables Transaction') |
249 | 247 |
|
250 | 248 |
# set option selected |
251 |
foreach my $item (qw(vendor currency)) {
|
|
249 |
foreach my $item (qw(vendor)) { |
|
252 | 250 |
my $to_replace = H($form->{$item}); |
253 | 251 |
$form->{"select$item"} =~ s/ selected//; |
254 | 252 |
$form->{"select$item"} =~ s/>\Q${to_replace}\E/ selected>${to_replace}/; |
... | ... | |
427 | 425 |
|
428 | 426 |
print $form->parse_html_template('ap/form_header', { |
429 | 427 |
today => DateTime->today, |
428 |
currencies => SL::DB::Manager::Currency->get_all_sorted, |
|
430 | 429 |
}); |
431 | 430 |
|
432 | 431 |
$main::lxdebug->leave_sub(); |
templates/webpages/ap/form_header.html | ||
---|---|---|
6 | 6 |
<form method="post" action="[% script | html %]"> |
7 | 7 |
|
8 | 8 |
<input type="hidden" name="selectvendor" value="[% selectvendor | html %]"> |
9 |
<input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]"> |
|
10 | 9 |
|
11 | 10 |
<input type="hidden" name="oldvendor" value="[% oldvendor | html %]"> |
12 | 11 |
<input type="hidden" name="vendor_id" value="[% vendor_id | html %]"> |
... | ... | |
113 | 112 |
|
114 | 113 |
<tr> |
115 | 114 |
<th align="right" nowrap>[% 'Currency' | $T8 %]</th> |
116 |
<td><select name="currency">[% selectcurrency %]</select></td>
|
|
115 |
<td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
|
|
117 | 116 |
|
118 | 117 |
[% IF ( defaultcurrency && (currency != defaultcurrency) ) %] |
119 | 118 |
<th align=right>[% 'Exchangerate' | $T8 %]</th> |
Auch abrufbar als: Unified diff
Kreditorenbuchungen: Währungs-Drop-Down nicht als Hidden mitschleifen