X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=8f25bb9bb763d97524fdeff86cda956ecde57ce5;hb=015f7118b8398596eb3656a343b5cf0141929fb7;hp=11a2b4e04a3edc9837e008b2ac69d93cae4e5244;hpb=41b8891d96b1ea8b22b06e9a14eb20eb96cc0300;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 11a2b4e04..8f25bb9bb 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -195,6 +195,7 @@ sub _request_to_hash { } sub _recode_recursively { + $main::lxdebug->enter_sub(); my ($iconv, $param) = @_; if (ref $param eq 'HASH') { @@ -215,6 +216,7 @@ sub _recode_recursively { } } } + $main::lxdebug->leave_sub(); } sub new { @@ -394,28 +396,33 @@ sub unescape { } sub quote { + $main::lxdebug->enter_sub(); my ($self, $str) = @_; if ($str && !ref($str)) { $str =~ s/\"/"/g; } - $str; + $main::lxdebug->leave_sub(); + return $str; } sub unquote { + $main::lxdebug->enter_sub(); my ($self, $str) = @_; if ($str && !ref($str)) { $str =~ s/"/\"/g; } - $str; + $main::lxdebug->leave_sub(); + return $str; } sub hide_form { + $main::lxdebug->enter_sub(); my $self = shift; if (@_) { @@ -426,7 +433,7 @@ sub hide_form { print($main::cgi->hidden("-name" => $_, "-default" => $self->{$_}) . "\n"); } } - + $main::lxdebug->leave_sub(); } sub error { @@ -1312,6 +1319,7 @@ Content-Length: $numbytes } sub get_formname_translation { + $main::lxdebug->enter_sub(); my ($self, $formname) = @_; $formname ||= $self->{formname}; @@ -1333,10 +1341,12 @@ sub get_formname_translation { purchase_delivery_order => $main::locale->text('Delivery Order'), ); + $main::lxdebug->leave_sub(); return $formname_translations{$formname} } sub get_number_prefix_for_type { + $main::lxdebug->enter_sub(); my ($self) = @_; my $prefix = @@ -1345,10 +1355,12 @@ sub get_number_prefix_for_type { : ($self->{type} =~ /_delivery_order$/) ? 'do' : 'ord'; + $main::lxdebug->leave_sub(); return $prefix; } sub get_extension_for_format { + $main::lxdebug->enter_sub(); my ($self) = @_; my $extension = $self->{format} =~ /pdf/i ? ".pdf" @@ -1357,10 +1369,12 @@ sub get_extension_for_format { : $self->{format} =~ /html/i ? ".html" : ""; + $main::lxdebug->leave_sub(); return $extension; } sub generate_attachment_filename { + $main::lxdebug->enter_sub(); my ($self) = @_; my $attachment_filename = $main::locale->unquote_special_chars('HTML', $self->get_formname_translation()); @@ -1379,10 +1393,12 @@ sub generate_attachment_filename { $attachment_filename = $main::locale->quote_special_chars('filenames', $attachment_filename); $attachment_filename =~ s|[\s/\\]+|_|g; + $main::lxdebug->leave_sub(); return $attachment_filename; } sub generate_email_subject { + $main::lxdebug->enter_sub(); my ($self) = @_; my $subject = $main::locale->unquote_special_chars('HTML', $self->get_formname_translation()); @@ -1392,6 +1408,7 @@ sub generate_email_subject { $subject .= " " . $self->{"${prefix}number"} } + $main::lxdebug->leave_sub(); return $subject; } @@ -2812,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}); @@ -3228,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(); @@ -3244,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);