From fba4f72dc6a7177d46be67bf4689502b5d53cd19 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Mon, 29 Oct 2012 14:27:41 +0100 Subject: [PATCH] =?utf8?q?Bei=20doppelten=20Kontonummern=20eine=20verst?= =?utf8?q?=C3=A4ndliche=20Fehlermeldung=20ausgeben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit behebt #2030 --- SL/AM.pm | 11 +++++++++++ locale/de/all | 1 + 2 files changed, 12 insertions(+) diff --git a/SL/AM.pm b/SL/AM.pm index 59e9c785c..1a085b8bd 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -269,6 +269,17 @@ sub save_account { $form->{valid_from} = ''; }; + $query = ' + SELECT + accno + FROM chart + WHERE accno = ?'; + my ($accno) = selectrow_query($form, $dbh, $query, $form->{accno}); + + if ($accno) { + $form->error($::locale->text('Account number not unique!')); + } + $query = qq|UPDATE chart SET accno = ?, description = ?, diff --git a/locale/de/all b/locale/de/all index b396e1794..e6d9521f8 100644 --- a/locale/de/all +++ b/locale/de/all @@ -93,6 +93,7 @@ $self->{texts} = { 'Account for interest' => 'Konto für Zinsen', 'Account number' => 'Kontonummer', 'Account number #1, bank code #2, #3' => 'Kontonummer #1, BLZ #2, #3', + 'Account number not unique!' => 'Kontonummer bereits vorhanden!', 'Account saved!' => 'Konto gespeichert!', 'Accounting Group deleted!' => 'Buchungsgruppe gelöscht!', 'Accounting Group saved!' => 'Buchungsgruppe gespeichert!', -- 2.20.1