From: Moritz Bunkus Date: Wed, 22 May 2013 14:12:56 +0000 (+0200) Subject: DB-Upgrade Eindeutige Artikelnummern: Fixes & Spalte "Gültig" anzeigen X-Git-Tag: release-3.1.0beta1~405^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ac3ca512767b7167a30f2de6f287475f69015335;p=kivitendo-erp.git DB-Upgrade Eindeutige Artikelnummern: Fixes & Spalte "Gültig" anzeigen --- diff --git a/locale/de/all b/locale/de/all index ddb7cd4af..dbfe63586 100755 --- a/locale/de/all +++ b/locale/de/all @@ -284,7 +284,7 @@ $self->{texts} = { 'Batch Printing' => 'Druck', 'Bcc' => 'Bcc', 'Bcc E-mail' => 'BCC (E-Mail)', - 'Because the useability gets worse if one partnumber is used for several parts (for example if you are searching a position for an invoice), partnumbers should be unique.' => 'translation', + 'Because the useability gets worse if one partnumber is used for several parts (for example if you are searching a position for an invoice), partnumbers should be unique.' => 'Da die Benutzerfreundlichkeit durch doppelte Artikelnummern erheblich verschlechtert wird (zum Beispiel, wenn man einen Artikel für eine Rechnung sucht), sollten Artikelnummern eindeutig vergeben sein.', 'Belegnummer' => 'Buchungsnummer', 'Beratername' => 'Beratername', 'Beraternummer' => 'Beraternummer', diff --git a/sql/Pg-upgrade2/erzeugnisnummern.pl b/sql/Pg-upgrade2/erzeugnisnummern.pl index 81c024160..414689461 100644 --- a/sql/Pg-upgrade2/erzeugnisnummern.pl +++ b/sql/Pg-upgrade2/erzeugnisnummern.pl @@ -8,6 +8,8 @@ use utf8; use parent qw(SL::DBUpgrade2::Base); +use SL::DBUtils; + sub run { my ($self) = @_; @@ -21,7 +23,7 @@ sub run { $self->dbh->commit(); } - my $query = qq|SELECT id, partnumber, description, unit, notes, assembly, ean, inventory_accno_id + my $query = qq|SELECT id, partnumber, description, unit, notes, assembly, ean, inventory_accno_id, obsolete FROM parts pa WHERE (SELECT COUNT(*) FROM parts p @@ -29,14 +31,7 @@ sub run { > 1 ORDER BY partnumber;|; - my $sth = $self->dbh->prepare($query); - $sth->execute || $::form->dberror($query); - - $::form->{PARTS} = []; - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - map {$ref->{$_} = $::locale->{iconv_utf8}->convert($ref->{$_})} keys %$ref; - push @{ $::form->{PARTS} }, $ref; - } + $::form->{PARTS} = [ selectall_hashref_query($::form, $self->dbh, $query) ]; if ( scalar @{ $::form->{PARTS} } > 0 ) { &print_error_message; diff --git a/templates/webpages/dbupgrade/erzeugnisnummern.html b/templates/webpages/dbupgrade/erzeugnisnummern.html index 800370f80..646685493 100644 --- a/templates/webpages/dbupgrade/erzeugnisnummern.html +++ b/templates/webpages/dbupgrade/erzeugnisnummern.html @@ -1,5 +1,5 @@ [%- USE T8 %] -[% USE HTML %]
[% 'Double partnumbers' | $T8 %]
+[% USE HTML %][%- USE LxERP -%]
[% 'Double partnumbers' | $T8 %]
@@ -19,6 +19,7 @@ [% 'Notes' | $T8 %] [% 'EAN' | $T8 %] [% 'Service, assembly or part' | $T8 %] + [% 'Obsolete' | $T8 %] [% SET row_odd = '1' %][% FOREACH row = PARTS %] @@ -30,6 +31,7 @@ [% HTML.escape(row.notes) %] [% HTML.escape(row.ean) %] [% IF row.assembly %] [% 'assembly' | $T8 %] [% ELSE %] [% IF row.inventory_accno_id %] [% 'part' | $T8 %] [% ELSE %] [% 'service' | $T8 %] [% END %] [% END %] + [% IF row.obsolete %][%- LxERP.t8("Obsolete") %][%- ELSE %][%- LxERP.t8("Not obsolete") %][%- END %] [% SET rowcount = loop.count %] [% END %]