Revision b4b71434
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2357 | 2357 |
my ($var) = $sth->fetchrow_array; |
2358 | 2358 |
$sth->finish; |
2359 | 2359 |
|
2360 |
if ($var =~ /^(.*?)(\d+)$/) { |
|
2361 |
my $new_num = sprintf '%0*d', length($2), $2 + 1; |
|
2362 |
$var = "${1}${new_num}"; |
|
2363 |
} else { |
|
2364 |
$var++; |
|
2365 |
} |
|
2360 |
$var =~ s/\d+$/ sprintf '%0*d', length($&), $&+1 /e; |
|
2361 |
$var ||= 1; |
|
2366 | 2362 |
|
2367 | 2363 |
$query = qq|UPDATE defaults SET $fld = ?|; |
2368 | 2364 |
do_query($self, $dbh, $query, $var); |
... | ... | |
2393 | 2389 |
WHERE id = ? FOR UPDATE|; |
2394 | 2390 |
my ($var) = selectrow_query($self, $dbh, $query, $business_id); |
2395 | 2391 |
|
2396 |
if ($var ne "") { |
|
2397 |
if ($var =~ /^(.*?)(\d+)$/) { |
|
2398 |
my $new_num = sprintf '%0*d', length($2), $2 + 1; |
|
2399 |
$var = "${1}${new_num}"; |
|
2400 |
} else { |
|
2401 |
$var++; |
|
2402 |
} |
|
2403 |
} |
|
2392 |
$var =~ s/\d+$/ sprintf '%0*d', length($&), $&+1 /e; |
|
2393 |
|
|
2404 | 2394 |
$query = qq|UPDATE business |
2405 | 2395 |
SET customernumberinit = ? |
2406 | 2396 |
WHERE id = ?|; |
Auch abrufbar als: Unified diff
Substitute mit execute reimt sich.