From af2f24b8a20ae59af3b72da2cdf3669987a19927 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 15 Jan 2014 10:51:20 +0100 Subject: [PATCH] =?utf8?q?Validierung=20eingegebener=20Kunden-=20und=20Lie?= =?utf8?q?ferantennamen=20konfigurierbar=20gemacht=20Ferner=20Konfiguratio?= =?utf8?q?nsvorbereitung=20f=C3=BCr=20die=20Umsetzung=20von=20Ticket=20201?= =?utf8?q?1=20(Validierung=20von=20part.notes=20und=20part.descriptions)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CustomerVendor.pm | 3 +++ SL/DB/MetaSetup/Default.pm | 2 ++ locale/de/all | 9 ++++----- sql/Pg-upgrade2/defaults_feature2.pl | 20 +++++++++++++++++++ .../webpages/client_config/_features.html | 11 ++++++++++ 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 sql/Pg-upgrade2/defaults_feature2.pl diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index dcb8b2d6c..3b6db2903 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -865,6 +865,9 @@ sub _pre_render { sub normalize_name { my ($self) = @_; + # check if feature is enabled (select normalize_vc_names from defaults) + return unless ($::instance_conf->get_normalize_vc_names); + return unless $self->{cv}; my $name = $self->{cv}->name; $name =~ s/\s+$//; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index f6e5ffcb3..0efdbe20e 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -55,6 +55,8 @@ __PACKAGE__->meta->columns( language_id => { type => 'integer' }, max_future_booking_interval => { type => 'integer', default => 360 }, mtime => { type => 'timestamp' }, + # normalize_part_descriptions => { type => 'boolean', default => 'true' }, + normalize_vc_names => { type => 'boolean', default => 'true' }, parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' }, parts_listing_image => { type => 'boolean', default => 'true' }, parts_show_image => { type => 'boolean', default => 'true' }, diff --git a/locale/de/all b/locale/de/all index 98d6920ed..7e3c8c8ae 100755 --- a/locale/de/all +++ b/locale/de/all @@ -256,6 +256,8 @@ $self->{texts} = { 'Authentification database creation' => 'Anlegen der Datenbank zur Benutzerauthentifizierung', 'Authentification tables creation' => 'Anlegen der Tabellen zur Benutzerauthentifizierung', 'Auto Send?' => 'Auto. Versand?', + 'Automatic deletion of leading, trailing and excessive (repetitive) spaces in customer or vendor names' => 'Automatisches Löschen von voran-, mehrfach wiederholenten oder nachgestellten Leerzeichen im Kunden- oder Lieferantennamen (Bspw.: " Schmidt    & Söhne GmbH" -> "Schmidt & Söhne GmbH"', + 'Automatic deletion of leading, trailing and excessive (repetitive) spaces in part description and part notes. Affects also the CSV-Import.' => '', 'Automatically created invoice for fee and interest for dunning %s' => 'Automatisch erzeugte Rechnung für Gebühren und Zinsen zu Mahnung %s', 'Available' => 'Verfügbar', 'Available qty' => 'Lagerbestand', @@ -792,9 +794,6 @@ $self->{texts} = { 'EB-Wert' => 'EB-Wert', 'EK' => 'EK', 'ELSE' => 'Zusatz', - 'ELSTER Export (Taxbird)' => 'ELSTER-Export nach Taxbird', - 'ELSTER Export (Winston)' => 'ELSTER Export nach Winston', - 'ELSTER Export nach Winston' => 'ELSTER Export nach Winston', 'ELSTER Tax Number' => 'ELSTER-Steuernummer', 'EQUITY' => 'EIGENTUM', 'EUER' => 'Einnahmen-/Überschussrechnung', @@ -1414,6 +1413,8 @@ $self->{texts} = { 'No.' => 'Position', 'None' => 'Kein', 'Normal users cannot log in.' => 'Normale Benutzer können sich nicht anmelden.', + 'Normalize Customer / Vendor names' => 'Normalisierung Kunden- / Lieferantennamen', + 'Normalize part description and part notes' => 'Normalisierung Artikelbeschreibung und Artikellangtext (Bemerkung)', 'Not Discountable' => 'Nicht rabattierfähig', 'Not delivered' => 'Nicht geliefert', 'Not done yet' => 'Noch nicht fertig', @@ -2405,7 +2406,6 @@ $self->{texts} = { 'USt-IdNr.' => 'USt-IdNr.', 'USt-Konto' => 'USt-Konto', 'UStVA' => 'UStVA', - 'UStVA (PDF-Dokument)' => 'UStVa als PDF-Dokument', 'UStVa' => 'UStVa', 'UStVa Einstellungen' => 'UStVa Einstellungen', 'Unbalanced Ledger' => 'Bilanzfehler', @@ -2518,7 +2518,6 @@ $self->{texts} = { 'Workflow sales_order' => 'Workflow Auftrag', 'Workflow sales_quotation' => 'Workflow Angebot', 'Write bin to default bin in part?' => 'Diesen Lagerplatz als Standardlagerplatz im Artikel setzen?', - 'Wrong Period' => 'Falscher Zeitraum', 'Wrong tax keys recorded' => 'Gespeicherte Steuerschlüssel sind falsch', 'Wrong taxes recorded' => 'Gespeicherte Steuern passen nicht zum Steuerschlüssel', 'YYYY' => 'JJJJ', diff --git a/sql/Pg-upgrade2/defaults_feature2.pl b/sql/Pg-upgrade2/defaults_feature2.pl new file mode 100644 index 000000000..3abcf469a --- /dev/null +++ b/sql/Pg-upgrade2/defaults_feature2.pl @@ -0,0 +1,20 @@ +# @tag: defaults_feature2 +# @description: Normalisieren von vc-Namen, als auch part.notes und part.descriptions als Feature konfigurierbar machen +# @depends: release_3_0_0 +package SL::DBUpgrade2::defaults_feature2; + +use utf8; + +use parent qw(SL::DBUpgrade2::Base); +use strict; + +sub run { + my ($self) = @_; + + # this query will fail if column already exist (new database) + $self->db_query(qq|ALTER TABLE defaults ADD COLUMN normalize_vc_names boolean DEFAULT true|); + $self->db_query(qq|ALTER TABLE defaults ADD COLUMN normalize_part_descriptions boolean DEFAULT true|); + return 1; +} + +1; diff --git a/templates/webpages/client_config/_features.html b/templates/webpages/client_config/_features.html index c260ce864..3d3b21678 100644 --- a/templates/webpages/client_config/_features.html +++ b/templates/webpages/client_config/_features.html @@ -21,6 +21,11 @@ [% L.yes_no_tag('defaults.vertreter', SELF.defaults.vertreter) %] [% LxERP.t8('Representative for Customer') %] + + [% LxERP.t8('Normalize Customer / Vendor names') %] + [% L.yes_no_tag('defaults.normalize_vc_names', SELF.defaults.normalize_vc_names) %] + [% LxERP.t8('Automatic deletion of leading, trailing and excessive (repetitive) spaces in customer or vendor names') %] + [% LxERP.t8("Parts Master Data") %] @@ -39,5 +44,11 @@ [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %] [% LxERP.t8('Style the picture with the following CSS code') %] + -- 2.20.1