From 8add0ccd27ab0ff17256b74dccd1f761c0d09182 Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Wed, 12 Oct 2011 15:48:33 +0200 Subject: [PATCH] Leerzeichen am Ende bei curr(ency) entfernen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In der Datenbank werden f. Währungen drei Zeichen gespeichert. Eine Währung mit zwei Zeichen hat dann ein Leerzeichen am Ende und der Vergleich in den Maske schlägt fehl, wenn es dort bleibt. --- SL/Form.pm | 6 ++++++ SL/IR.pm | 3 +++ SL/IS.pm | 2 ++ SL/OE.pm | 3 +++ 4 files changed, 14 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index b21f94c71..a5c2abec9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2968,6 +2968,9 @@ sub create_links { $self->{$key} = $ref->{$key}; } + # remove any trailing whitespace + $self->{currency} =~ s/\s*$//; + my $transdate = "current_date"; if ($self->{transdate}) { $transdate = $dbh->quote($self->{transdate}); @@ -3144,6 +3147,9 @@ sub lastname_used { map { $self->{$_} = $ref->{$_} } values %column_map; + # remove any trailing whitespace + $self->{currency} =~ s/\s*$// if $self->{currency}; + $main::lxdebug->leave_sub(); } diff --git a/SL/IR.pm b/SL/IR.pm index 8536aad4f..2bb56a720 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -853,6 +853,9 @@ sub retrieve_invoice { $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id})); map { $form->{$_} = $ref->{$_} } keys %$ref; + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; + $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "sell"); # get shipto diff --git a/SL/IS.pm b/SL/IS.pm index da801fd52..d90a0d0db 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1478,6 +1478,8 @@ sub retrieve_invoice { $ref = selectfirst_hashref_query($form, $dbh, $query, $id); map { $form->{$_} = $ref->{$_} } keys %{ $ref }; + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "buy"); diff --git a/SL/OE.pm b/SL/OE.pm index 61360996b..5bf2a3da9 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -806,6 +806,9 @@ sub retrieve { if ($ref) { map { $form->{$_} = $ref->{$_} } keys %$ref; + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; + $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"}; # set all entries for multiple ids blank that yield different information -- 2.20.1