From: Bernd Bleßmann Date: Mon, 17 May 2021 14:39:19 +0000 (+0200) Subject: Zeiterfassung: mehr Validierungen beim Speichern X-Git-Tag: kivitendo-mebil_0.1-0~9^2~221 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9acca8265cf669c44b6a642aabfa14d970397ab8;p=kivitendo-erp.git Zeiterfassung: mehr Validierungen beim Speichern --- diff --git a/SL/DB/TimeRecording.pm b/SL/DB/TimeRecording.pm index 13329b782..3749dab8f 100644 --- a/SL/DB/TimeRecording.pm +++ b/SL/DB/TimeRecording.pm @@ -38,6 +38,11 @@ sub validate { push @errors, t8('Employee must not be empty.') if !$self->employee_id; push @errors, t8('Description must not be empty.') if !$self->description; push @errors, t8('Start time must be earlier than end time.') if $self->is_time_in_wrong_order; + push @errors, t8('Assigned order must be a sales order.') if $self->order_id && 'sales_order' eq !$self->order->type; + push @errors, t8('Customer of assigned order must match customer.') if $self->order_id && $self->order->customer_id != $self->customer_id; + push @errors, t8('Customer of assigned project must match customer.') if $self->project_id && $self->project->customer_id && $self->project->customer_id != $self->customer_id; + push @errors, t8('Project of assigned order must match assigned project.') + if $self->project_id && $self->order_id && $self->order->globalproject_id && $self->project_id != $self->order->globalproject_id; my $conflict = $self->is_time_overlapping; push @errors, t8('Entry overlaps with "#1".', $conflict->displayable_times) if $conflict; diff --git a/locale/de/all b/locale/de/all index d3b79a2d4..3f44f3238 100755 --- a/locale/de/all +++ b/locale/de/all @@ -358,6 +358,7 @@ $self->{texts} = { 'Assign the following article to all sections' => 'Den folgenden Artikel allen Abschnitten zuweisen', 'Assigned' => 'Zugewiesen', 'Assigned invoices with amount' => 'Zugewiesene Rechnungen mit Betrag', + 'Assigned order must be a sales order.' => 'Zugeordneter Auftrag muss ein Verkaufsauftrag sein.', 'Assignment of articles to sections' => 'Zuweisung von Artikeln zu Abschnitten', 'Assistant for general ledger corrections' => 'Assistent für die Korrektur von Hauptbucheinträgen', 'Assortment' => 'Sortiment', @@ -867,6 +868,8 @@ $self->{texts} = { 'Customer missing!' => 'Kundenname fehlt!', 'Customer must not be empty.' => 'Kunden darf nicht leer sein.', 'Customer not found' => 'Kunde nicht gefunden', + 'Customer of assigned order must match customer.' => 'Kunde des zugeordneten Auftrags muss mit dem gewählten Kunden übereinstimmen.', + 'Customer of assigned project must match customer.' => 'Kunde des zugeordneten Projekts muss mit dem gewählten Kunden übereinstimmen.', 'Customer saved' => 'Kunde gespeichert', 'Customer saved!' => 'Kunde gespeichert!', 'Customer specific Price' => 'Kundenpreis', @@ -2592,6 +2595,7 @@ $self->{texts} = { 'Project Type' => 'Projekttyp', 'Project Types' => 'Projekttypen', 'Project link actions' => 'Projektverknüpfungs-Aktionen', + 'Project of assigned order must match assigned project.' => 'Projekt des zugeordneten Auftrags muss mit dem gewählten Projekt übereinstimmen.', 'Project picker' => 'Projektauswahl', 'Project statuses' => 'Projektstatus', 'Project type' => 'Projekttyp', diff --git a/locale/en/all b/locale/en/all index 03887a33a..1c687f713 100644 --- a/locale/en/all +++ b/locale/en/all @@ -358,6 +358,7 @@ $self->{texts} = { 'Assign the following article to all sections' => '', 'Assigned' => '', 'Assigned invoices with amount' => '', + 'Assigned order must be a sales order.' => '', 'Assignment of articles to sections' => '', 'Assistant for general ledger corrections' => '', 'Assortment' => '', @@ -867,6 +868,8 @@ $self->{texts} = { 'Customer missing!' => '', 'Customer must not be empty.' => '', 'Customer not found' => '', + 'Customer of assigned order must match customer.' => '', + 'Customer of assigned project must match customer.' => '', 'Customer saved' => '', 'Customer saved!' => '', 'Customer specific Price' => '', @@ -2592,6 +2595,7 @@ $self->{texts} = { 'Project Type' => '', 'Project Types' => '', 'Project link actions' => '', + 'Project of assigned order must match assigned project.' => '', 'Project picker' => '', 'Project statuses' => '', 'Project type' => '',