X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=8f25bb9bb763d97524fdeff86cda956ecde57ce5;hb=ba233a63330839f96a92a8001e13f7e1e120f7d5;hp=456cd2e59a80c982768bc455f9b1be0d965de495;hpb=560d94b29eddbd312fe0eae3726b368959f522eb;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 456cd2e59..8f25bb9bb 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -403,9 +403,9 @@ sub quote { $str =~ s/\"/"/g; } - $str; - $main::lxdebug->leave_sub(); + + return $str; } sub unquote { @@ -416,9 +416,9 @@ sub unquote { $str =~ s/"/\"/g; } - $str; - $main::lxdebug->leave_sub(); + + return $str; } sub hide_form { @@ -2829,7 +2829,7 @@ sub create_links { (startdate <= a.transdate) ORDER BY startdate DESC LIMIT 1)) WHERE a.trans_id = ? AND a.fx_transaction = '0' - ORDER BY a.oid, a.transdate|; + ORDER BY a.acc_trans_id, a.transdate|; $sth = $dbh->prepare($query); do_statement($self, $sth, $query, $self->{id}); @@ -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);