From afb20e7cff40eac7a1f1e903da70602b4de7572a Mon Sep 17 00:00:00 2001 From: Niclas Zimmermann Date: Thu, 18 Apr 2013 13:47:23 +0200 Subject: [PATCH] =?utf8?q?Nummernkreis=20f=C3=BCr=20Erzeugnisse?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Für Erzeugnisse gibt es jetzt einen eigenen Nummernkreis. Lässt man das Feld frei, wird weiterhin der Nummernkreis von Waren auch für Erzeugnisse verwendet. --- SL/AM.pm | 2 ++ SL/TransNumber.pm | 7 ++++++- locale/de/all | 1 + templates/webpages/am/edit_defaults.html | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/SL/AM.pm b/SL/AM.pm index af2c25f91..502ebd905 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -1084,6 +1084,7 @@ sub save_defaults { vendornumber = ?, articlenumber = ?, servicenumber = ?, + assemblynumber = ?, sdonumber = ?, pdonumber = ?, curr = ?, @@ -1097,6 +1098,7 @@ sub save_defaults { $form->{sqnumber}, $form->{rfqnumber}, $form->{customernumber}, $form->{vendornumber}, $form->{articlenumber}, $form->{servicenumber}, + $form->{assemblynumber}, $form->{sdonumber}, $form->{pdonumber}, $currency, $form->{businessnumber}, $form->{weightunit}, diff --git a/SL/TransNumber.pm b/SL/TransNumber.pm index 210abc091..859ca6865 100644 --- a/SL/TransNumber.pm +++ b/SL/TransNumber.pm @@ -69,8 +69,9 @@ sub _get_filters { } elsif ($type =~ /part|service|assembly/) { $filters{trans_number} = "partnumber"; $filters{numberfield} = $type eq 'service' ? 'servicenumber' : 'articlenumber'; + $filters{numberfield} = $type eq 'assembly' ? 'assemblynumber' : $filters{numberfield}; $filters{table} = "parts"; - $filters{where} = 'COALESCE(inventory_accno_id, 0) ' . ($type eq 'service' ? '=' : '<>') . ' 0'; + $filters{where} = 'COALESCE(inventory_accno_id, 0) ' . ($type eq 'service' ? '= 0' : '<> 0 OR assembly'); } return %filters; @@ -129,6 +130,10 @@ SQL ($business_number) = selectfirst_array_query($form, $self->dbh, qq|SELECT customernumberinit FROM business WHERE id = ?|, $self->business_id) if $self->business_id; my $number = $business_number; ($number) = selectfirst_array_query($form, $self->dbh, qq|SELECT $filters{numberfield} FROM defaults|) if !$number; + if ($filters{numberfield} eq 'assemblynumber' and length($number) < 1) { + $filters{numberfield} = 'articlenumber'; + ($number) = selectfirst_array_query($form, $self->dbh, qq|SELECT $filters{numberfield} FROM defaults|) if !$number; + } $number ||= ''; my $sequence = SL::PrefixedNumber->new(number => $number); diff --git a/locale/de/all b/locale/de/all index 4b0b6d7cd..6a6dee509 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1110,6 +1110,7 @@ $self->{texts} = { 'Languages and translations' => 'Sprachen und Übersetzungen', 'Last Action' => 'Letzte Aktivität', 'Last Article Number' => 'Letzte Artikelnummer', + 'Last Assembly Number' => 'Letzte Erzeugnisnummer', 'Last Cost' => 'Einkaufspreis', 'Last Credit Note Number' => 'Letzte Gutschriftnummer', 'Last Customer Number' => 'Letzte Kundennummer', diff --git a/templates/webpages/am/edit_defaults.html b/templates/webpages/am/edit_defaults.html index 36033dbdf..248953cf3 100644 --- a/templates/webpages/am/edit_defaults.html +++ b/templates/webpages/am/edit_defaults.html @@ -49,11 +49,16 @@ [% 'Last RFQ Number' | $T8 %] + [% 'Last Assembly Number' | $T8 %] + [% 'Last Sales Delivery Order Number' | $T8 %] + + + [% 'Last Purchase Delivery Order Number' | $T8 %] -- 2.20.1