commit 758efd36cc63776b603d8e3d0f38a79da4d851f2
Author: Bernd Bleßmann <bernd@kivitendo-premium.de>
Date:   Tue Jan 5 10:34:25 2021 +0100

    Kunden/Lieferanten: UStId/Steuernr. eindeutig: Mandantenkonfiguration

diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm
index 5f3f6f320..790e054a0 100644
--- a/SL/DB/MetaSetup/Default.pm
+++ b/SL/DB/MetaSetup/Default.pm
@@ -47,6 +47,7 @@ __PACKAGE__->meta->columns(
   currency_id                               => { type => 'integer', not_null => 1 },
   customer_hourly_rate                      => { type => 'numeric', precision => 8, scale => 2 },
   customer_projects_only_in_sales           => { type => 'boolean', default => 'false', not_null => 1 },
+  customer_ustid_taxnummer_unique           => { type => 'boolean', default => 'false' },
   customernumber                            => { type => 'text' },
   datev_check_on_ap_transaction             => { type => 'boolean', default => 'true' },
   datev_check_on_ar_transaction             => { type => 'boolean', default => 'true' },
@@ -173,6 +174,7 @@ __PACKAGE__->meta->columns(
   transfer_default_warehouse_for_assembly   => { type => 'boolean', default => 'false' },
   transport_cost_reminder_article_number_id => { type => 'integer' },
   vc_greetings_use_textfield                => { type => 'boolean' },
+  vendor_ustid_taxnummer_unique             => { type => 'boolean', default => 'false' },
   vendornumber                              => { type => 'text' },
   version                                   => { type => 'varchar', length => 8 },
   vertreter                                 => { type => 'boolean', default => 'false' },
diff --git a/locale/de/all b/locale/de/all
index df16a8f58..60fccd6fa 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -875,6 +875,7 @@ $self->{texts} = {
   'Customerorderlock'           => 'Shopauftragssperre',
   'Customers'                   => 'Kunden',
   'Customers and vendors'       => 'Kunden und Lieferanten',
+  'Customers: VAT ID / taxnumber unique' => 'Kunden: UStID / Steuernummer eindeutig',
   'Customized Report'           => 'Vorgewählte Zeiträume',
   'Cutoff Date'                 => 'Stichtag',
   'Czech Republic'              => 'Tschechien',
@@ -2982,6 +2983,8 @@ $self->{texts} = {
   'Shoporders'                  => 'Shopbestellungen',
   'Shops'                       => 'Webshops',
   'Short'                       => 'Knapp',
+  'Should VAT ID or taxnumber be unique for all vendors? This is checked when saving a vendor\'s master data. One of the fields is sufficient and required.' => 'Soll die UStID oder Steuernummer eindeutig über alle Lieferanten sein? Dies wird beim Speichern von Lieferantenstammdaten geprüft. Eines dieser Felder reicht aus und muss angegeben sein.',
+  'Should VAT ID or taxnumber be unique for customers? This is checked when saving a customer\'s master data. One of the fields is sufficient and required.' => 'Soll die UStID oder Steuernummer eindeutig über alle Kunden sein? Dies wird beim Speichern von Kundenstammdaten geprüft. Eines dieser Felder reicht aus und muss angegeben sein.',
   'Should ap transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Kreditorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
   'Should ar transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Debitorenbuchungen nach der Buchung zu ändern oder zu löschen sein?',
   'Should gl transactions be and when should they be changeable or deleteable after posting?' => 'Sollen Dialogbuchungen nach der Buchung zu ändern oder zu löschen sein?',
@@ -3951,6 +3954,7 @@ $self->{texts} = {
   'Vendor saved!'               => 'Lieferant gespeichert!',
   'Vendor type'                 => 'Lieferantentyp',
   'Vendors'                     => 'Lieferanten',
+  'Vendors: VAT ID / taxnumber unique' => 'Lieferanten: UStID / Steuernummer eindeutig',
   'Verrechnungseinheit'         => 'Verrechnungseinheit',
   'Version'                     => 'Version',
   'Version actions'             => 'Aktionen für Versionen',
diff --git a/locale/en/all b/locale/en/all
index 200238be2..680427cbb 100644
--- a/locale/en/all
+++ b/locale/en/all
@@ -875,6 +875,7 @@ $self->{texts} = {
   'Customerorderlock'           => '',
   'Customers'                   => '',
   'Customers and vendors'       => '',
+  'Customers: VAT ID / taxnumber unique' => '',
   'Customized Report'           => '',
   'Cutoff Date'                 => '',
   'Czech Republic'              => '',
@@ -2982,6 +2983,8 @@ $self->{texts} = {
   'Shoporders'                  => '',
   'Shops'                       => '',
   'Short'                       => '',
+  'Should VAT ID or taxnumber be unique for all vendors? This is checked when saving a vendor\'s master data. One of the fields is sufficient and required.' => '',
+  'Should VAT ID or taxnumber be unique for customers? This is checked when saving a customer\'s master data. One of the fields is sufficient and required.' => '',
   'Should ap transactions be and when should they be changeable or deleteable after posting?' => '',
   'Should ar transactions be and when should they be changeable or deleteable after posting?' => '',
   'Should gl transactions be and when should they be changeable or deleteable after posting?' => '',
@@ -3950,6 +3953,7 @@ $self->{texts} = {
   'Vendor saved!'               => '',
   'Vendor type'                 => '',
   'Vendors'                     => '',
+  'Vendors: VAT ID / taxnumber unique' => '',
   'Verrechnungseinheit'         => '',
   'Version'                     => '',
   'Version actions'             => '',
diff --git a/sql/Pg-upgrade2/defaults_customer_vendor_ustid_taxnummer_unique.sql b/sql/Pg-upgrade2/defaults_customer_vendor_ustid_taxnummer_unique.sql
new file mode 100644
index 000000000..8b4c0d442
--- /dev/null
+++ b/sql/Pg-upgrade2/defaults_customer_vendor_ustid_taxnummer_unique.sql
@@ -0,0 +1,6 @@
+-- @tag: defaults_customer_vendor_ustid_taxnummer_unique
+-- @description: Mandanteneinstellung, ob UStId bzw. Steuernummer eindeutig sein sollen
+-- @depends: release_3_5_6_1
+
+ALTER TABLE defaults ADD customer_ustid_taxnummer_unique BOOLEAN DEFAULT FALSE;
+ALTER TABLE defaults ADD vendor_ustid_taxnummer_unique   BOOLEAN DEFAULT FALSE;
diff --git a/templates/webpages/client_config/_features.html b/templates/webpages/client_config/_features.html
index ad5f8f722..c5278adcd 100644
--- a/templates/webpages/client_config/_features.html
+++ b/templates/webpages/client_config/_features.html
@@ -156,6 +156,17 @@
    <td>[% LxERP.t8('Default hourly rate for new customers') %]</td>
   </tr>
 
+  <tr>
+   <td align="right">[% LxERP.t8('Customers: VAT ID / taxnumber unique') %]</td>
+   <td>[% L.yes_no_tag('defaults.customer_ustid_taxnummer_unique', SELF.defaults.customer_ustid_taxnummer_unique) %]</td>
+   <td>[% LxERP.t8('Should VAT ID or taxnumber be unique for customers? This is checked when saving a customer\'s master data. One of the fields is sufficient and required.') %]</td>
+  </tr>
+  <tr>
+   <td align="right">[% LxERP.t8('Vendors: VAT ID / taxnumber unique') %]</td>
+   <td>[% L.yes_no_tag('defaults.vendor_ustid_taxnummer_unique', SELF.defaults.vendor_ustid_taxnummer_unique) %]</td>
+   <td>[% LxERP.t8('Should VAT ID or taxnumber be unique for all vendors? This is checked when saving a vendor\'s master data. One of the fields is sufficient and required.') %]</td>
+  </tr>
+
   <tr><td class="listheading" colspan="4">[% LxERP.t8("Parts Master Data") %]</td></tr>
 
   <tr>
