]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/ar.pl
Zusätzliche Auftragsfelder beim Laden von Rechnungen holen.
[mfinanz.git] / bin / mozilla / ar.pl
index 88c0aefc9d394d8097180e0b345dee1be4f7b140..2094ead3ac34c7bce7ca99ec54a91d92392667e0 100644 (file)
@@ -48,10 +48,6 @@ require "bin/mozilla/reportgenerator.pl";
 use strict;
 #use warnings;
 
-1;
-
-# end of main
-
 # this is for our long dates
 # $locale->text('January')
 # $locale->text('February')
@@ -177,30 +173,30 @@ sub create_links {
   map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
 
   # customers
-  if (@{ $form->{all_customer} }) {
+  if (@{ $form->{all_customer} || [] }) {
     $form->{customer} = "$form->{customer}--$form->{customer_id}";
     map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" }
       (@{ $form->{all_customer} });
   }
 
   # 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}";
 
   # sales staff
-  if (@{ $form->{all_employees} }) {
+  if (@{ $form->{all_employees} || [] }) {
     $form->{selectemployee} = "";
     map { $form->{selectemployee} .= "<option>$_->{name}--$_->{id}\n" }
-      (@{ $form->{all_employees} });
+      (@{ $form->{all_employees} || [] });
   }
 
   # build the popup menus
@@ -1273,7 +1269,7 @@ sub search {
   # setup customer selection
   $form->all_vc(\%myconfig, "customer", "AR");
 
-  if (@{ $form->{all_customer} }) {
+  if (@{ $form->{all_customer} || [] }) {
     map { $customer .= "<option>$_->{name}--$_->{id}\n" }
       @{ $form->{all_customer} };
     $customer = qq|<select name=customer><option>\n$customer</select>|;
@@ -1282,13 +1278,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} || [] });
   }
 
   $department = qq|
@@ -1753,3 +1749,5 @@ sub storno {
 
   $main::lxdebug->leave_sub();
 }
+
+1;