From a74b677c81ce768c63e63ab3ba459dae3f9f42c2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 8 Jan 2014 13:17:33 +0100 Subject: [PATCH] =?utf8?q?DN.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/DO.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SL/DO.pm b/SL/DO.pm index 3d4cb23bf..31b01c424 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -44,6 +44,7 @@ use SL::DB::Status; use SL::DBUtils; use SL::RecordLinks; use SL::IC; +use SL::TransNumber; use strict; @@ -224,7 +225,8 @@ sub save { my $ic_cvar_configs = CVar->get_configs(module => 'IC', dbh => $dbh); - $form->{donumber} = $form->update_defaults($myconfig, $form->{type} eq 'sales_delivery_order' ? 'sdonumber' : 'pdonumber', $dbh) unless $form->{donumber}; + my $trans_number = SL::TransNumber->new(type => $form->{type}, dbh => $dbh, number => $form->{donumber}, id => $form->{id}); + $form->{donumber} ||= $trans_number->create_unique; $form->{employee_id} = (split /--/, $form->{employee})[1] if !$form->{employee_id}; $form->get_employee($dbh) unless ($form->{employee_id}); -- 2.20.1