From f72c4ff407800ddd608cf7946165a374f6b3b409 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Thu, 8 Nov 2012 15:13:37 +0100 Subject: [PATCH] =?utf8?q?Falschmeldung=20beim=20Speichern=20eines=20vorha?= =?utf8?q?ndenen=20Kontos=20unterdr=C3=BCcken.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit behebt #2041 --- SL/AM.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SL/AM.pm b/SL/AM.pm index 6862eb773..0e64e5a66 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -244,11 +244,18 @@ sub save_account { } $query = ' - SELECT - accno + SELECT accno FROM chart WHERE accno = ?'; - my ($accno) = selectrow_query($form, $dbh, $query, $form->{accno}); + + my @values = ($form->{accno}); + + if ( $form->{id} ) { + $query .= ' AND NOT id = ?'; + push(@values, $form->{id}); + } + + my ($accno) = selectrow_query($form, $dbh, $query, @values); if ($accno) { $form->error($::locale->text('Account number not unique!')); -- 2.20.1