Überprüfung auf Nullbuchung und Übersetzungen
[kivitendo-erp.git] / bin / mozilla / cp.pl
index b68865a..f91e9e0 100644 (file)
@@ -178,7 +178,7 @@ sub form_header {
            </tr>
 | if $form->{selectdepartment};
 
-  $form->{jsscript} = $jscalendar;
+  $form->{jsscript} = 1;
   $jsscript = "";
   if ($form->{jsscript}) {
 
@@ -306,9 +306,9 @@ sub form_header {
                <td colspan=3><input name=source value="$form->{source}" size=10></td>
              </tr>
              <tr>
-               <th align=right nowrap>| . $locale->text('Amount') . qq|</th>
-               <td colspan=3><input name=amount size=10 value=|
-    . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq| onBlur=\"check_right_number_format(this)\"></td>
+               <th align="right" nowrap>| . $locale->text('Amount') . qq|</th>
+               <td colspan="3"><input name="amount" size="10" value="|
+    . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq|" onBlur=\"check_right_number_format(this)\"></td>
              </tr>
            </table>
          </td>
@@ -674,7 +674,7 @@ sub print {
 
   $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
 
-  $form->{decimal} .= "00";
+  #$form->{decimal} .= "00";
   $form->{decimal} = substr($form->{decimal}, 0, 2);
 
   $check = new CP $myconfig{countrycode};
@@ -695,11 +695,13 @@ sub print {
     $form->{pdf} = 1;
   }
 
+  delete $form->{OUT};
+
   if ($form->{media} eq 'printer') {
     $form->{OUT} = "| $myconfig{printer}";
   }
   if ($form->{media} eq 'queue') {
-    %queued = split / /, $form->{queued};
+    %queued = map { s|.*/|| } split / /, $form->{queued};
 
     if ($filename = $queued{ $form->{formname} }) {
       unlink "$spool/$filename";
@@ -745,6 +747,7 @@ sub check_form {
     exit;
   }
 
+  $form->error($locale->text('Zero amount posting!')) if !$form->parse_amount(\%myconfig, $form->{amount});
   $form->error($locale->text('Date missing!')) unless $form->{datepaid};
 
   $closedto = $form->datetonum($form->{closedto}, \%myconfig);