From ad0096b7c71511665bdf9fec9f3ecaae638072cd Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 8 Jan 2014 13:13:51 +0100 Subject: [PATCH] =?utf8?q?AR.pm:=20SL::TransNumber=20anstelle=20von=20Form?= =?utf8?q?->update=5Fdefaults=20f=C3=BCr=20Nummernkreise=20nutzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AR.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; - -- 2.20.1