Zum Vergleich des Buchabschlusses das höchste Zahlungsdatum heranziehen.
[kivitendo-erp.git] / bin / mozilla / ap.pl
index 8f643e5..551b0ee 100644 (file)
@@ -163,21 +163,21 @@ sub create_links {
   map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
 
   # vendors
-  if (@{ $form->{all_vendor} }) {
+  if (@{ $form->{all_vendor} || [] }) {
     $form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|;
     map { $form->{selectvendor} .= "<option>$_->{name}--$_->{id}\n" }
       (@{ $form->{all_vendor} });
   }
 
   # departments
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
     $form->{department}       = "$form->{department}--$form->{department_id}";
 
     map {
       $form->{selectdepartment} .=
         "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
+    } (@{ $form->{all_departments} || [] });
   }
 
   $form->{employee} = "$form->{employee}--$form->{employee_id}";
@@ -1070,8 +1070,8 @@ sub post {
   my ($debitaccno,    $debittaxkey)    = split /--/, $form->{AP_amountselected};
   my ($taxkey,        $NULL)           = split /--/, $form->{taxchartselected};
   my ($payablesaccno, $payablestaxkey) = split /--/, $form->{APselected};
-  $form->{AP}{amount_1} = $debitaccno;
-  $form->{AP}{payables} = $payablesaccno;
+  $form->{AP_amount_1}  = $debitaccno;
+  $form->{AP_payables}  = $payablesaccno;
   $form->{taxkey}       = $taxkey;
   $form->{storno}       = 0;
 
@@ -1222,13 +1222,13 @@ sub search {
   }
 
   # departments
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
 
     map {
       $form->{selectdepartment} .=
         "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
+    } (@{ $form->{all_departments} || [] });
   }
 
   my $department = qq|