Zum einen den unsaeglichen Algorithmus zum setzen von exchangerate und forex im ganzen Porgramm geaendert.
Dann einen Bug mit der Angzeige der Wechselkurseingabe in oe.pl gefixt.
Ausserdem Bug 666 gefixt.
if ($form->{currency} eq $form->{defaultcurrency}) {
$form->{exchangerate} = 1;
} else {
- $exchangerate =
- $form->check_exchangerate($myconfig, $form->{currency},
- $form->{transdate}, 'sell');
-
- $form->{exchangerate} =
- ($exchangerate)
- ? $exchangerate
- : $form->parse_amount($myconfig, $form->{exchangerate});
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'sell');
+ $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
}
for $i (1 .. $form->{rowcount}) {
if ($form->{currency} eq $form->{defaultcurrency}) {
$form->{"exchangerate_$i"} = 1;
} else {
- $exchangerate =
- $form->check_exchangerate($myconfig, $form->{currency},
- $form->{"datepaid_$i"}, 'sell');
-
- $form->{"exchangerate_$i"} =
- ($exchangerate)
- ? $exchangerate
- : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+ $form->{"exchangerate_$i"} = $exchangerate || $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
}
$form->{"AP_paid_$i"} =~ s/\"//g;
my ($exchangerate) = selectrow_query($self, $dbh, $query, $currency, $transdate);
- $exchangerate = 1 if ($exchangerate eq "");
-
$main::lxdebug->leave_sub();
return $exchangerate;
if ($form->{currency} eq $defaultcurrency) {
$form->{exchangerate} = 1;
} else {
- $exchangerate =
- $form->check_exchangerate($myconfig, $form->{currency},
- $form->{transdate}, 'buy');
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy');
}
$form->{exchangerate} =
if ($form->{currency} eq $defaultcurrency) {
$form->{"exchangerate_$i"} = 1;
} else {
- $exchangerate =
- $form->check_exchangerate($myconfig, $form->{currency},
- $form->{"datepaid_$i"}, 'buy');
-
- $form->{"exchangerate_$i"} =
- $exchangerate ? $exchangerate
- : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"exchangerate_$i"} = $exchangerate || $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
}
# record AR
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? 'buy' : 'sell');
}
- $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+ $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
}
$readonly = ($form->{id}) ? "readonly" : "";
- $form->{radier} =
- ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
- $readonly = ($form->{radier}) ? "" : $readonly;
+ $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+ $readonly = ($form->{radier}) ? "" : $readonly;
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, 'sell'
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
# format amounts
map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, 'sell'
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
$form->{invdate} = $form->{transdate};
$save_AP = $form->{AP};
$totalpaid += $form->{"paid_$i"};
- $form->{"exchangerate_$i"} = $exchangerate
- if (
- $form->{"forex_$i"} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell'
- )));
+ $form->{"forex_$i"} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+ $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
}
}
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
}
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, 'buy'
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
# format amounts
$form->{exchangerate} =
$form->{rowcount} = $count + 1;
map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, 'buy'
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
$form->{invdate} = $form->{transdate};
my $save_AR = $form->{AR};
$totalpaid += $form->{"paid_$i"};
- $form->{"exchangerate_$i"} = $exchangerate
- if (
- $form->{"forex_$i"} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy'
- )));
+ $form->{"forex_$i"} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
}
}
}
}
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{datepaid}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell);
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
$amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
$form->{currency} = $currency;
$form->{exchangerate} = "";
- $form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell));
- $form->{exchangerate} = $exchangerate if ($form->{forex});
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} if ($form->{forex});
prepare_invoice();
&order_links;
$form->{currency} = $currency;
- $form->{exchangerate} = "";
- $form->{forex} = "";
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} || '';
for $i (1 .. $form->{rowcount}) {
- map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
- $form->{"${_}_${i}"})
+ map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"})
if ($form->{"${_}_${i}"}) }
qw(ship qty sellprice listprice basefactor));
}
&order_links;
$form->{currency} = $currency;
- $form->{exchangerate} = "";
- $form->{forex} = "";
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} || '';
for $i (1 .. $form->{rowcount}) {
map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
&check_name(vendor);
- $form->{exchangerate} = $exchangerate if
- $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell');
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
for $i (1 .. $form->{paidaccounts}) {
next unless $form->{"paid_$i"};
map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
- $form->{"exchangerate_$i"} = $exchangerate if
- $form->{"forex_$i"} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+ $form->{"forex_$i"} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+ $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
}
$i = $form->{rowcount};
$form->{taxincluded} ||= $taxincluded;
- $form->{exchangerate} = $exchangerate if
- $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
for $i (1 .. $form->{paidaccounts}) {
next unless $form->{"paid_$i"};
map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
- $form->{"exchangerate_$i"} = $exchangerate if
- $form->{"forex_$i"} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"forex_$i"} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+ $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
}
$i = $form->{rowcount};
&invoice_links;
$form->{currency} = $currency;
- $form->{exchangerate} = "";
- $form->{forex} = "";
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{invdate}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} || '';
$form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
@values = map { $_ } @{ $form->{ALL_CURRENCIES} };
%labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} };
$form->{currency} = $form->{defaultcurrency} unless $form->{currency};
- $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency} && $form->{exchangerate};
+ $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency};
$TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
'-values' => \@values, '-labels' => \%labels)) if scalar @values;
push @custom_hiddens, "forex";
$buysell = 'buy';
$buysell = 'sell' if ($form->{vc} eq 'vendor');
- $form->{exchangerate} = $exchangerate if
- $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
+ $form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} if $form->{forex};
$exchangerate = $form->{exchangerate} || 1;
&invoice_links;
$form->{currency} = $currency;
- $form->{exchangerate} = "";
- $form->{forex} = "";
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{invdate}, $buysell
- )));
+ $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
+ $form->{exchangerate} = $form->{forex} || '';
$form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
<th align="right">Wechselkurs</th>
<td>
[%- IF forex %]
- [% LxERP.format_amount(exchangerate, 0) %]
+ [% LxERP.format_amount(exchangerate, 2) %]
[%- ELSE %]
<input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
[%- END %]
<th align="right"><translate>Exchangerate</translate></th>
<td>
[%- IF forex %]
- [% LxERP.format_amount(exchangerate, 0) %]
+ [% LxERP.format_amount(exchangerate, 2) %]
[%- ELSE %]
<input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
[%- END %]