]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/ap.pl
Abteilungen in Belegen sind nun Pflichtfelder, wenn der Benutzer das Flag "mandatory_...
[mfinanz.git] / bin / mozilla / ap.pl
index 62edff23ecaf063fd9ca3c2e7cc357628541b89e..91836ebb7aad6e58567affe7d131b10c366d76e9 100644 (file)
@@ -1017,6 +1017,12 @@ sub post {
   $form->isblank("duedate",   $locale->text("Due Date missing!"));
   $form->isblank("vendor",    $locale->text('Vendor missing!'));
 
+  if ($myconfig{mandatory_departments} && !$form->{department}) {
+    $form->{saved_message} = $::locale->text('You have to specify a department.');
+    update();
+    exit;
+  }
+
   my $closedto  = $form->datetonum($form->{closedto},  \%myconfig);
   my $transdate = $form->datetonum($form->{transdate}, \%myconfig);
   $form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig));