From 13787dab589901763bd1b2f63cec22add35e0c65 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 23 Apr 2007 14:38:34 +0000 Subject: [PATCH] =?utf8?q?Beim=20Vergeben=20von=20neuen=20Angebotsnummern?= =?utf8?q?=20etc=20die=20"Breite"=20der=20Nummernkreisvorlagen=20ber=C3=BC?= =?utf8?q?cksichtigen=20(also=20wird=20aus=20z.B.=20"A00000"=20auch=20wirk?= =?utf8?q?lich=20"A00001"=20und=20nicht=20"A1").?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index b9a13a150..252c4c159 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2344,7 +2344,8 @@ sub update_defaults { $sth->finish; if ($var =~ /^(.*?)(\d+)$/) { - $var = "$1" . ($2 + 1); + my $new_num = sprintf '%0' . length($2) . 'd', $2 + 1; + $var = "${1}${new_num}"; } else { $var++; } @@ -2380,7 +2381,8 @@ sub update_business { if ($var ne "") { if ($var =~ /^(.*?)(\d+)$/) { - $var = "$1" . ($2 + 1); + my $new_num = sprintf '%0' . length($2) . 'd', $2 + 1; + $var = "${1}${new_num}"; } else { $var++; } -- 2.20.1