]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/cp.pl
Kontoauszug verbuchen: keine Multibox verwenden
[mfinanz.git] / bin / mozilla / cp.pl
index ee5e56d9f5274fba55d10057c76bde137cb5c619..4fdfd5ee93cb35bb743421e95f992f018ab5d048 100644 (file)
@@ -24,7 +24,8 @@
 # GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
 #======================================================================
 #
 # Payment module
@@ -73,10 +74,11 @@ sub payment {
   $form->{"select$form->{vc}"} = "";
 
   if ($form->{"all_$form->{vc}"}) {
-       $form->{"select$form->{vc}"} .= "<option value=\"\"></option>\n";
+    $form->{"select$form->{vc}"} .= "<option value=\"\"></option>\n";
     # s.o. jb 12.10.2010
     $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
-    map { $form->{"select$form->{vc}"} .= "<option value=\"$_->{name}--$_->{id}\">$_->{name}--$_->{id}</option>\n" }
+    # hotfix for 2450. TODO remove legacy code and use L
+    map { $form->{"select$form->{vc}"} .= "<option value=\"" . H($_->{name}) . "--$_->{id}\">" . H($_->{name}) . "--$_->{id}</option>\n" }
       @{ $form->{"all_$form->{vc}"} };
   }
   CP->paymentaccounts(\%myconfig, \%$form);
@@ -93,13 +95,6 @@ sub payment {
   map { $form->{selectaccount} .= "<option value=\"$_->{accno}--$_->{description}\">$_->{accno}--$_->{description}</option>\n";
         $form->{account}        = "$_->{accno}--$_->{description}" if ($_->{accno} eq $accno_arap) } @{ $form->{PR}{"$form->{ARAP}_paid"} };
 
-  # Braucht man das hier überhaupt? Erstmal auskommentieren .. jan 18.12.2010
-  #  map {
-  #    $form->{"select$form->{ARAP}"} .=
-  #      "<option>$_->{accno}--$_->{description}\n"
-  #  } @{ $form->{PR}{ $form->{ARAP} } };
-  # ENDE LOESCHMICH in 2012
-
   # currencies
   # oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei
   # der aktualisierung der form auch nicht mitübernommen. das konzept
@@ -147,6 +142,7 @@ sub form_header {
   #              <option value="asdf--2929">asdf--2929</option>
   # offen: $form->{ARAP} kann raus?
   for my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
+    $form->{$item} = H($form->{$item});
     $form->{"select$item"} =~ s/ selected//;
     $form->{"select$item"} =~ s/option value="\Q$form->{$item}\E">\Q$form->{$item}\E/option selected value="$form->{$item}">$form->{$item}/;
   }
@@ -323,13 +319,13 @@ sub update {
     $updated = &check_name($form->{vc});
   };
 
-  if ($new_name_selected || $updated) {
+  if ($new_name_selected || $updated) {
     # get open invoices from ar/ap using $form->{vc} and a.${vc}_id, i.e. customer_id
     CP->get_openinvoices(\%myconfig, \%$form);
     ($newvc) = split /--/, $form->{ $form->{vc} };
     $form->{"old$form->{vc}"} = qq|$newvc--$form->{"$form->{vc}_id"}|;
     $updated = 1;
-  }
+  }
 
   if ($form->{currency} ne $form->{oldcurrency}) {
     $form->{oldcurrency} = $form->{currency};
@@ -457,7 +453,7 @@ sub check_form {
 
   if ($form->{currency} ne $form->{oldcurrency}) {
     &update;
-    ::end_of_request();
+    $::dispatcher->end_request;
   }
   $form->error($locale->text('Date missing!')) unless $form->{datepaid};
   my $selected_check = 1;