From 40f3befb965dd6125c0da70ad292f41a5d168d1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 12 Apr 2022 09:36:17 +0200 Subject: [PATCH] =?utf8?q?Angebot/Auftrag:=20"Als=20neu=20speichern":=20Wa?= =?utf8?q?rnung=20bei=20ung=C3=BCltigen=20Artikeln?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Als Flash-Meldung im neuen Beleg. --- SL/Controller/Order.pm | 4 ++++ locale/de/all | 1 + locale/en/all | 1 + 3 files changed, 6 insertions(+) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 025078111..0dd06ebd4 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -259,6 +259,10 @@ sub action_save_as_new { # Update employee $new_attrs{employee} = SL::DB::Manager::Employee->current; + # Warn on obsolete items + my @obsolete_positions = map { $_->position } grep { $_->part->obsolete } @{ $order->items_sorted }; + flash_later('warning', t8('This record containts obsolete items at position #1', join ', ', @obsolete_positions)) if @obsolete_positions; + # Create new record from current one $self->order(SL::DB::Order->new_from($order, destination_type => $order->type, attributes => \%new_attrs)); diff --git a/locale/de/all b/locale/de/all index b4c12b76a..791e6e5f5 100755 --- a/locale/de/all +++ b/locale/de/all @@ -3915,6 +3915,7 @@ $self->{texts} = { 'This part was already counted for this bin:' => 'Dieser Artikel wurde für diesen Lagerplatz bereits erfasst:', 'This price has since gone down' => 'Dieser Preis ist mittlerweile niedriger', 'This price has since gone up' => 'Dieser Preis ist mittlerweile höher', + 'This record containts obsolete items at position #1' => 'Dieser Beleg enthält ungültige Artikel an Position #1', 'This record has already been closed.' => 'Dieser Beleg wurde bereits geschlossen.', 'This record has already been delivered.' => 'Dieser Beleg wurde bereits geliefert.', 'This record has not been saved yet.' => 'Der Beleg wurde noch nicht gespeichert.', diff --git a/locale/en/all b/locale/en/all index 0c0c44f41..f08787047 100644 --- a/locale/en/all +++ b/locale/en/all @@ -3914,6 +3914,7 @@ $self->{texts} = { 'This part was already counted for this bin:' => '', 'This price has since gone down' => '', 'This price has since gone up' => '', + 'This record containts obsolete items at position #1' => '', 'This record has already been closed.' => '', 'This record has already been delivered.' => '', 'This record has not been saved yet.' => '', -- 2.20.1