From 2879330bd173831981bdd8b25fc1900292efaeac Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Mon, 9 Jan 2012 14:25:47 +0100 Subject: [PATCH] =?utf8?q?Fix=20f=C3=BCr=20Bug=201770=20-=20W=C3=A4hrung?= =?utf8?q?=20/=20currency=20=C3=BCberlebt=20Workflow=20=C3=BCber=20Liefers?= =?utf8?q?chein=20nicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DO.pm | 7 +++++-- SL/Form.pm | 2 +- bin/mozilla/ir.pl | 8 +++++++- bin/mozilla/is.pl | 4 ++-- doc/changelog | 1 + templates/webpages/do/form_header.html | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index 0d2a5ec21..f241cdfb7 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -350,7 +350,7 @@ sub save { conv_i($form->{salesman_id}), conv_i($form->{cp_id}), $form->{transaction_description}, $form->{type} =~ /^sales/ ? 't' : 'f', - conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{curr}, + conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), substr($form->{currency}, 0, 3), conv_i($form->{id})); do_query($form, $dbh, $query, @values); @@ -601,7 +601,7 @@ sub retrieve { d.description AS department, dord.language_id, dord.shipto_id, dord.globalproject_id, dord.delivered, dord.transaction_description, - dord.taxzone_id, dord.taxincluded, dord.terms, dord.curr + dord.taxzone_id, dord.taxincluded, dord.terms, dord.curr AS currency FROM delivery_orders dord JOIN ${vc} cv ON (dord.${vc}_id = cv.id) LEFT JOIN employee e ON (dord.employee_id = e.id) @@ -623,6 +623,9 @@ sub retrieve { } $sth->finish(); + # remove any trailing whitespace + $form->{currency} =~ s/\s*$//; + $form->{donumber_array} =~ s/\s*$//g; $form->{saved_donumber} = $form->{donumber}; diff --git a/SL/Form.pm b/SL/Form.pm index 38d87ad01..9433173c6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2860,7 +2860,7 @@ sub create_links { if ($self->{"$self->{vc}_id"}) { # only setup currency - ($self->{currency}) = split(/:/, $self->{currencies}); + ($self->{currency}) = split(/:/, $self->{currencies}) if !$self->{currency}; } else { diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index b550532ed..2ace9a7b4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -116,7 +116,7 @@ sub invoice_links { } } - my ($payment_id, $language_id, $taxzone_id); + my ($payment_id, $language_id, $taxzone_id, $currency); if ($form->{payment_id}) { $payment_id = $form->{payment_id}; } @@ -126,6 +126,9 @@ sub invoice_links { if ($form->{taxzone_id}) { $taxzone_id = $form->{taxzone_id}; } + if ($form->{currency}) { + $currency = $form->{currency}; + } my $cp_id = $form->{cp_id}; IR->get_vendor(\%myconfig, \%$form); @@ -141,6 +144,9 @@ sub invoice_links { if ($taxzone_id) { $form->{taxzone_id} = $taxzone_id; } + if ($currency) { + $form->{currency} = $currency; + } my @curr = split(/:/, $form->{currencies}); #seems to be missing map { $form->{selectcurrency} .= "