From 69f73331f02259ae3c819a6726881b8409e1f1b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 13 Mar 2013 20:57:46 +0100 Subject: [PATCH] Transnumber zum Erzeugen der Auftragsnummer verwenden. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Vorher bekamen mehrere zu importierende Aufträge die selbe Nummer. --- SL/Controller/CsvImport/Order.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index 81b9fd317..689a6bb77 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -11,6 +11,7 @@ use SL::DB::OrderItem; use SL::DB::Part; use SL::DB::PaymentTerm; use SL::DB::Contact; +use SL::TransNumber; use parent qw(SL::Controller::CsvImport::BaseMulti); @@ -403,7 +404,9 @@ sub save_objects { next if @{ $entry->{errors} }; if ($entry->{raw_data}->{datatype} eq $self->settings->{'order_column'} && !$entry->{object}->ordnumber) { - $entry->{object}->create_trans_number; + my $number = SL::TransNumber->new(type => 'sales_order', + save => 1); + $entry->{object}->ordnumber($number->create_unique()); } push @{ $objects_to_save }, $entry; -- 2.20.1