From: Moritz Bunkus Date: Wed, 8 Jan 2014 12:17:33 +0000 (+0100) Subject: DN.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~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a74b677c81ce768c63e63ab3ba459dae3f9f42c2;p=kivitendo-erp.git DN.pm: SL::TransNumber anstelle von Form->update_defaults für Nummernkreise nutzen --- 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});