X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=9fdf2bc8ca433a128cef1812eb8d95fa6b64d54c;hb=b2945bf61775161f9ce9be9bdbd106ad44247a14;hp=3d6704262eb34b87c566f0142be75c873f7342cf;hpb=5f4f93b36e5cac5cba49224bde12284034b44f49;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 3d6704262..9fdf2bc8c 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -1089,6 +1089,12 @@ sub post { $form->isblank("duedate", $locale->text('Due Date missing!')); $form->isblank("customer", $locale->text('Customer 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)); @@ -1121,13 +1127,12 @@ sub post { my ($customer) = split /--/, $form->{customer}; if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") { update(); - exit; + ::end_of_request(); } $form->{AR}{receivables} = $form->{ARselected}; $form->{storno} = 0; - $main::lxdebug->message(0, $form->{amount}); $form->{id} = 0 if $form->{postasnew}; $form->error($locale->text('Cannot post transaction!')) unless AR->post_transaction(\%myconfig, \%$form);