From 06bbc8e75360fbbf73ee10b78d73ef95590d2fa2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 21 Mar 2007 15:13:42 +0000 Subject: [PATCH] =?utf8?q?Bei=20"Als=20Neu=20Speichern"=20nur=20dann=20ein?= =?utf8?q?e=20neue=20Anfrage-/Auftragsnummer=20vergeben,=20wenn=20der=20Be?= =?utf8?q?nutzer=20die=20bisherige=20nicht=20manuell=20ver=C3=A4ndert=20ha?= =?utf8?q?t;=20ansonsten=20die=20ver=C3=A4nderte=20=C3=BCbernehmen.=20Fix?= =?utf8?q?=20f=C3=BCr=20Bug=20598.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/OE.pm | 6 +++++- bin/mozilla/oe.pl | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/SL/OE.pm b/SL/OE.pm index 609f8a9f1..27f57f99a 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -484,6 +484,9 @@ Message: $form->{message}\r| if $form->{message}; my $rc = $dbh->commit; $dbh->disconnect; + $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? + "quonumber" : "ordnumber"}; + Common::webdav_folder($form) if ($main::webdav); $main::lxdebug->leave_sub(); @@ -698,7 +701,8 @@ sub retrieve { $ref = $sth->fetchrow_hashref(NAME_lc); map { $form->{$_} = $ref->{$_} } keys %$ref; - + $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? + "quonumber" : "ordnumber"}; # set all entries for multiple ids blank that yield different information while ($ref = $sth->fetchrow_hashref(NAME_lc)) { diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 1e105aac2..f7eb689bc 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1115,6 +1115,8 @@ sub form_footer { |; } + $form->hide_form("saved_xyznumber"); + print qq| {rowcount}> @@ -2419,7 +2421,15 @@ sub save_as_new { $form->{saveasnew} = 1; $form->{closed} = 0; - map { delete $form->{$_} } qw(printed emailed queued ordnumber quonumber); + map { delete $form->{$_} } qw(printed emailed queued); + + # Let Lx-Office assign a new order number if the user hasn't changed the + # previous one. If it has been changed manually then use it as-is. + my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"; + if ($form->{saved_xyznumber} && + ($form->{saved_xyznumber} eq $form->{$idx})) { + delete($form->{$idx}); + } &save; -- 2.20.1