Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / bin / mozilla / ap.pl
index 4531e99..7b16657 100644 (file)
@@ -375,6 +375,10 @@ sub form_header {
   if ( $form->{'paid_'. $form->{paidaccounts}} ) {
     $form->{paidaccounts}++;
   }
+
+  # default account for current assets (i.e. 1801 - SKR04)
+  $form->{accno_arap} = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
+
   for my $i (1 .. $form->{paidaccounts}) {
     $form->{totalpaid} += $form->{"paid_$i"};
 
@@ -606,10 +610,11 @@ sub post {
 
   my ($inline) = @_;
 
-  # check if there is a vendor, invoice and due date
+  # check if there is a vendor, invoice, due date and invnumber
   $form->isblank("transdate", $locale->text("Invoice Date missing!"));
   $form->isblank("duedate",   $locale->text("Due Date missing!"));
   $form->isblank("vendor",    $locale->text('Vendor missing!'));
+  $form->isblank("invnumber", $locale->text('Invoice Number missing!'));
 
   if ($myconfig{mandatory_departments} && !$form->{department}) {
     $form->{saved_message} = $::locale->text('You have to specify a department.');
@@ -795,7 +800,7 @@ sub yes {
 sub search {
   $main::lxdebug->enter_sub();
 
-  $main::auth->assert('general_ledger | vendor_invoice_edit');
+  $main::auth->assert('vendor_invoice_edit');
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
@@ -847,7 +852,7 @@ sub ap_transactions {
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
 
-  $main::auth->assert('general_ledger | vendor_invoice_edit');
+  $main::auth->assert('vendor_invoice_edit');
 
   ($form->{vendor}, $form->{vendor_id}) = split(/--/, $form->{vendor});