From: Moritz Bunkus Date: Wed, 8 Jan 2014 12:13:51 +0000 (+0100) Subject: AR.pm: SL::TransNumber anstelle von Form->update_defaults für Nummernkreise nutzen X-Git-Tag: release-3.1.0beta1~22^2~22^2~10^2^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ad0096b7c71511665bdf9fec9f3ecaae638072cd;p=kivitendo-erp.git AR.pm: SL::TransNumber anstelle von Form->update_defaults für Nummernkreise nutzen --- diff --git a/SL/AR.pm b/SL/AR.pm index c52a00fd5..3da550d68 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -40,6 +40,7 @@ use SL::DBUtils; use SL::IO; use SL::MoreCommon; use SL::DB::Default; +use SL::TransNumber; use strict; @@ -136,7 +137,10 @@ sub post_transaction { ($form->{id}) = selectrow_query($form, $dbh, $query); $query = qq|INSERT INTO ar (id, invnumber, employee_id, currency_id) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE name=?))|; do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency}); - $form->{invnumber} = $form->update_defaults($myconfig, "invnumber", $dbh) unless $form->{invnumber}; + if (!$form->{invnumber}) { + my $trans_number = SL::TransNumber->new(type => 'invoice', dbh => $dbh, number => $form->{partnumber}, id => $form->{id}); + $form->{invnumber} = $trans_number->create_unique; + } } } @@ -800,4 +804,3 @@ sub storno { 1; -