Hilfsfunktionen fuer die Ausgabe von HTML-gequoteten Strings.
[kivitendo-erp.git] / bin / mozilla / is.pl
index 879d3d1..765635f 100644 (file)
@@ -138,6 +138,10 @@ sub invoice_links {
 
   $cp_id = $form->{cp_id};
   IS->get_customer(\%myconfig, \%$form);
+  #quote all_customer Bug 133
+  foreach $ref (@{ $form->{all_customer} }) {
+    $ref->{name} = $form->quote($ref->{name});
+  }
   if ($id) {
     $form->{id} = $id;
   }
@@ -158,7 +162,7 @@ sub invoice_links {
   }
 
   # currencies
-  @curr = split /:/, $form->{currencies};
+  @curr = split(/:/, $form->{currencies});
   chomp $curr[0];
   $form->{defaultcurrency} = $curr[0];
 
@@ -351,12 +355,12 @@ sub form_header {
   if (@{ $form->{SHIPTO} }) {
     $form->{selectshipto} = "<option value=0></option>";
     foreach $item (@{ $form->{SHIPTO} }) {
-      if ($item->{id} == $form->{shipto_id}) {
+      if ($item->{shipto_id} == $form->{shipto_id}) {
         $form->{selectshipto} .=
-          "<option value=$item->{id} selected>$item->{shiptoname}</option>";
+          "<option value=$item->{shipto_id} selected>$item->{shiptoname} $item->{shiptodepartment_1}</option>";
       } else {
         $form->{selectshipto} .=
-          "<option value=$item->{id}>$item->{shiptoname}</option>";
+          "<option value=$item->{shipto_id}>$item->{shiptoname} $item->{shiptodepartment}</option>";
       }
 
     }
@@ -369,7 +373,7 @@ sub form_header {
 
   $shipto = qq|
                <th align=right>| . $locale->text('Shipping Address') . qq|</th>
-               <td><select name=shipto_id>$form->{selectshipto}</select></td>
+               <td><select name=shipto_id style="width:200px;">$form->{selectshipto}</select></td>
                <input type=hidden name=selectshipto value="$form->{selectshipto}">|;
 
 
@@ -381,6 +385,9 @@ sub form_header {
       s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
   }
 
+  #quote customer Bug 133
+  $form->{selectcustomer} = $form->quote($form->{selectcustomer});
+  
   #build contacts
   if ($form->{all_contacts}) {
 
@@ -652,7 +659,7 @@ sub form_header {
               $dunning
              <tr>
                <th align=right nowrap>| . $locale->text('Record in') . qq|</th>
-               <td colspan=3><select name=AR>$form->{selectAR}</select></td>
+               <td colspan=3><select name=AR style="width:280px;">$form->{selectAR}</select></td>
                <input type=hidden name=selectAR value="$form->{selectAR}">
              </tr>
               $taxzone
@@ -1209,7 +1216,7 @@ sub update {
 
       } else {
 
-        $sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
+        $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
 
         map { $form->{item_list}[$i]{$_} =~ s/\"/&quot;/g }
           qw(partnumber description unit);
@@ -1360,7 +1367,7 @@ sub post {
     if ($form->{currency} ne $form->{defaultcurrency});
 
   for $i (1 .. $form->{paidaccounts}) {
-    if ($form->{"paid_$i"}) {
+    if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
       $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
 
       $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));