From 93e82bab24ec05ffe820ad264328e55e7b62ba6f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Sun, 5 Dec 2021 20:44:59 +0100 Subject: [PATCH] =?utf8?q?CsvImport:=20Anpassungen=20f=C3=BCr=20order=5Fty?= =?utf8?q?pe=20in=20Lieferscheinen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CsvImport/DeliveryOrder.pm | 19 ++++++++++++++----- js/locale/de.js | 2 +- locale/de/all | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/SL/Controller/CsvImport/DeliveryOrder.pm b/SL/Controller/CsvImport/DeliveryOrder.pm index b93455a4e..2e5a9e9ab 100644 --- a/SL/Controller/CsvImport/DeliveryOrder.pm +++ b/SL/Controller/CsvImport/DeliveryOrder.pm @@ -9,6 +9,7 @@ use DateTime; use SL::Controller::CsvImport::Helper::Consistency; use SL::DB::DeliveryOrder; +use SL::DB::DeliveryOrder::TypeData qw(:types); use SL::DB::DeliveryOrderItem; use SL::DB::DeliveryOrderItemsStock; use SL::DB::Part; @@ -215,10 +216,10 @@ sub setup_displayable_columns { { name => 'globalprojectnumber', description => $::locale->text('Document Project (number)') }, { name => 'globalproject_id', description => $::locale->text('Document Project (database ID)') }, { name => 'intnotes', description => $::locale->text('Internal Notes') }, - { name => 'is_sales', description => $::locale->text('Is sales') }, { name => 'language', description => $::locale->text('Language (name)') }, { name => 'language_id', description => $::locale->text('Language (database ID)') }, { name => 'notes', description => $::locale->text('Notes') }, + { name => 'order_type', description => $::locale->text('Delivery Order Type') }, { name => 'ordnumber', description => $::locale->text('Order Number') }, { name => 'payment', description => $::locale->text('Payment terms (name)') }, { name => 'payment_id', description => $::locale->text('Payment terms (database ID)') }, @@ -553,7 +554,7 @@ sub handle_order { push @{ $entry->{errors} }, $::locale->text('Error: Customer/vendor missing'); } - $self->handle_is_sales($entry); + $self->handle_type($entry); $self->check_contact($entry); $self->check_language($entry); $self->check_payment($entry); @@ -685,11 +686,19 @@ sub handle_stock { } } -sub handle_is_sales { +sub handle_type { my ($self, $entry) = @_; - if (!exists $entry->{raw_data}->{is_sales}) { - $entry->{object}->is_sales(!!$entry->{object}->customer_id); + if (!exists $entry->{raw_data}->{order_type}) { + # if no type is present - set to sales delivery order or purchase delivery + # order depending on is_sales or customer/vendor + + $entry->{object}->order_type( + $entry->{object}->customer_id ? SALES_DELIVERY_ORDER_TYPE : + $entry->{object}->vendor_id ? PURCHASE_DELIVERY_ORDER_TYPE : + $entry->{raw_data}->{is_sales} ? SALES_DELIVERY_ORDER_TYPE : + PURCHASE_DELIVERY_ORDER_TYPE + ); } } diff --git a/js/locale/de.js b/js/locale/de.js index 412d04700..859fe0e15 100644 --- a/js/locale/de.js +++ b/js/locale/de.js @@ -178,7 +178,7 @@ namespace("kivi").setupLocale({ "Today":"heute", "Toggle marker":"Markierung umschalten", "Transaction description":"Vorgangsbezeichnung", -"Transfer stock":"Lagerbewebungen", +"Transfer stock":"Lagerbewegungen", "Tue":"Di", "Tuesday":"Dienstag", "Update":"Erneuern", diff --git a/locale/de/all b/locale/de/all index 28180e1df..966406237 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1060,6 +1060,7 @@ $self->{texts} = { 'Delivery Order Date' => 'Lieferscheindatum', 'Delivery Order Date missing!' => 'Lieferscheindatum fehlt!', 'Delivery Order Number' => 'Lieferscheinnummer', + 'Delivery Order Type' => 'Lieferschein Typ', 'Delivery Order created' => 'Lieferschein erstellt', 'Delivery Order deleted!' => 'Lieferschein gelöscht!', 'Delivery Order has been deleted' => 'Lieferschein wurde gelöscht', @@ -1905,7 +1906,6 @@ $self->{texts} = { 'Invoices with payments cannot be canceled.' => 'Rechnungen mit Zahlungen können nicht storniert werden.', 'Invoices, Credit Notes & AR Transactions' => 'Rechnungen, Gutschriften & Debitorenbuchungen', 'Is Searchable' => 'Durchsuchbar', - 'Is sales' => 'Verkauf', 'Is this a summary account to record' => 'Sammelkonto für', 'It can be changed later but must be unique within the installation.' => 'Er ist nachträglich änderbar, muss aber im System eindeutig sein.', 'It is not allowed that a summary account occurs in a drop-down menu!' => 'Ein Sammelkonto darf nicht in Aufklappmenüs aufgenommen werden!', -- 2.20.1