From 5f760f3059427a692faf14c6670f0539e95aab8a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 22 Nov 2006 16:47:00 +0000 Subject: [PATCH] Recommit von r1202 von skoehler: Bug 381, Auftrags-, Angebots-, Rechnungsnummern (Einkauf) wurden beim "Neu speichern" nicht hochgezaehlt. --- bin/mozilla/ir.pl | 5 +++++ bin/mozilla/oe.pl | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index c3374b6af..75b44c1e4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -993,6 +993,11 @@ sub post { $form->{id} = 0 if $form->{postasnew}; + # get new invnumber in sequence if no invnumber is given or if posasnew was requested + if (!$form->{invnumber} || $form->{postasnew}) { + $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber"); + } + $form->redirect( $locale->text('Invoice') . " $form->{invnumber} " . $locale->text('posted!')) diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 67c99bdfe..410a06eeb 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1943,8 +1943,10 @@ sub save_and_close { } - $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld) - unless $form->{$ordnumber}; + # get new number in sequence if no number is given or if saveasnew was requested + if (!$form->{$ordumber} || $form->{saveasnew}) { + $form->{$ordnumber} = $form->update_defaults(\%myconfig, $numberfld); + } $form->redirect( $form->{label} . " $form->{$ordnumber} " . $locale->text('saved!')) -- 2.20.1