From 678e8763a0724b2f3c4bf0dca78524c88ee2a2f6 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sat, 29 Apr 2023 23:14:03 +0200 Subject: [PATCH] Don't create a new part when no parts match Note that the "no parts match" condition *only* occurs when the system holds *no* other parts, because the UI will fill in the first part's number when there *are* parts defined. To prevent setting the expectation that this is how parts are created, don't do it for the first one either. Closes #6530 --- old/bin/ir.pl | 22 ---------------------- old/bin/is.pl | 22 ---------------------- old/bin/oe.pl | 19 ------------------- 3 files changed, 63 deletions(-) diff --git a/old/bin/ir.pl b/old/bin/ir.pl index 4d8d0431aa..c8c5189f4e 100644 --- a/old/bin/ir.pl +++ b/old/bin/ir.pl @@ -1215,28 +1215,6 @@ sub update { $form->format_amount( \%myconfig, $form->{"${_}_$i"} ); } - } else { - - # ok, so this is a new part - # ask if it is a part or service item - - if ( $form->{"partsgroup_$i"} - && ( $form->{"partsnumber_$i"} eq "" ) - && ( $form->{"description_$i"} eq "" ) ) - { - $form->{rowcount}--; - $form->{id} = $form_id; - &display_form; - } - else { - - $form->{"id_$i"} = 0; - $form->{"unit_$i"} = $locale->text('ea'); - - $form->{id} = $form_id; - &new_item; - - } } } } diff --git a/old/bin/is.pl b/old/bin/is.pl index e9fc6a2057..ff90df3b9e 100644 --- a/old/bin/is.pl +++ b/old/bin/is.pl @@ -1323,28 +1323,6 @@ sub update { $form->format_amount( \%myconfig, $form->{"${_}_$i"} ); } - } else { - - # ok, so this is a new part - # ask if it is a part or service item - - if ( $form->{"partsgroup_$i"} - && ( $form->{"partsnumber_$i"} eq "" ) - && ( $form->{"description_$i"} eq "" ) ) - { - $form->{rowcount}--; - $form->{id} = $form_id; - &display_form; - } - else { - - $form->{"id_$i"} = 0; - $form->{"unit_$i"} = $locale->text('ea'); - - $form->{id} = $form_id; - &new_item; - - } } } } diff --git a/old/bin/oe.pl b/old/bin/oe.pl index c74cbf7bc8..532a07a79e 100644 --- a/old/bin/oe.pl +++ b/old/bin/oe.pl @@ -1202,25 +1202,6 @@ sub update { } } - else { - - # ok, so this is a new part - # ask if it is a part or service item - - if ( $form->{"partsgroup_$i"} - && ( $form->{"partsnumber_$i"} eq "" ) - && ( $form->{"description_$i"} eq "" ) ) - { - $form->{rowcount}--; - &display_form; - } - else { - - $form->{"id_$i"} = 0; - $form->{"unit_$i"} = $locale->text('ea'); - &new_item; - } - } } } $form->all_vc(\%myconfig, $form->{vc}, $form->{transdate}, 1) if ! @{$form->{"all_$form->{vc}"}};