From 08b7390952bc97832d83d5597f8774b5e4d940e4 Mon Sep 17 00:00:00 2001 From: Martin Helmling Date: Tue, 7 Jan 2014 16:13:53 +0100 Subject: [PATCH] =?utf8?q?Direktes=20Speichern=20beim=20Hinzuf=C3=BCgen=20?= =?utf8?q?eines=20Artikels=20per=20eindeutiger=20Artikelnummer=20wird=20zu?= =?utf8?q?gelassen.=20Ein=20Hinzuf=C3=BCgen=20=C3=BCber=20Beschreibung=20o?= =?utf8?q?der=20Warengruppe=20wird=20ignoriert.=20Behebt=20#2040?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit 2bc376b9be6507cc0fdf Behebt #2047 Behebt #2400 --- SL/IC.pm | 17 ++++++++++++++++- locale/de/all | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/SL/IC.pm b/SL/IC.pm index b99ec2aad..3b7eb0848 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -457,6 +457,22 @@ sub save { # add assembly records if ($form->{item} eq 'assembly') { + # check additional assembly row + my $i = $form->{assembly_rows}; + # if last row is not empty add them + if ($form->{"partnumber_$i"} ne "") { + $query = qq|SELECT id FROM parts WHERE partnumber = ?|; + my ($partid) = selectrow_query($form, $dbh, $query,$form->{"partnumber_$i"} ); + if ( $partid ) { + $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); + $form->{"id_$i"} = $partid; + $form->{"bom_$i"} = 0; + $form->{assembly_rows}++; + } + else { + $::form->error($::locale->text("uncorrect partnumber ").$form->{"partnumber_$i"}); + } + } for my $i (1 .. $form->{assembly_rows}) { $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"}); @@ -469,7 +485,6 @@ sub save { do_query($form, $dbh, $query, @values); } } - my @a = localtime; $a[5] += 1900; $a[4]++; diff --git a/locale/de/all b/locale/de/all index e7c9de414..3fdc2a988 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2763,6 +2763,7 @@ $self->{texts} = { 'transferred out' => 'ausgelagert', 'trial_balance' => 'susa', 'unconfigured' => 'unkonfiguriert', + 'uncorrect partnumber ' => 'Unbekannte Teilenummer ', 'up' => 'hoch', 'use program settings' => 'benutze Programmeinstellungen', 'use user config' => 'Verwende Benutzereinstellung', -- 2.20.1