From cbcbf5fa5bab38f3bf90070b762ecd7711fec47e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 14 May 2009 10:46:12 +0000 Subject: [PATCH] =?utf8?q?=C3=9Cberraschend=20einfacher=20Fix=20f=C3=BCr?= =?utf8?q?=20Numemrnkreisproblem=20in=20Kunden/Lieferantentypen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Wenn ein Nummernkreis eines Kunden/Lieferantentyps leer ist, wird jetzt auf den STandardkreis ausgewichen. Fix für Bug: 906 --- SL/Form.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index c13422264..8f25bb9bb 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3245,6 +3245,19 @@ sub update_defaults { return $var; } +=item update_business + +PARAMS (not named): + \%config, - config hashref + $business_id, - business id + $dbh - optional database handle + +handles business (thats customer/vendor types) sequences. + +special behaviour for empty strings in customerinitnumber field: +will in this case not increase the value, and return undef. + +=cut sub update_business { $main::lxdebug->enter_sub(); @@ -3261,6 +3274,8 @@ sub update_business { WHERE id = ? FOR UPDATE|; my ($var) = selectrow_query($self, $dbh, $query, $business_id); + return undef unless $var; + if ($var =~ m/\d+$/) { my $new_var = (substr $var, $-[0]) * 1 + 1; my $len_diff = length($var) - $-[0] - length($new_var); -- 2.20.1