Uebernahme der kompletten Version, so wie sie Philip als "Demo-Version" gezeigt hat...
[kivitendo-erp.git] / bin / mozilla / rp.pl
index f6dc985..fbcc4e8 100644 (file)
@@ -1188,10 +1188,10 @@ sub generate_income_statement {
     $longfromdate  = $locale->date(\%myconfig, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
-      . qq|<br>\n$longfromdate |
+      . qq|\n$longfromdate |
       . $locale->text('Bis')
       . qq| $longtodate|;
   }
@@ -1205,9 +1205,9 @@ sub generate_income_statement {
     $longcomparetodate  = $locale->date(\%myconfig, $form->{comparetodate}, 1);
     $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0);
 
-    $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
+    $form->{last_period} = "$shortcomparefromdate\n$shortcomparetodate";
     $form->{period} .=
-        "<br>\n$longcomparefromdate "
+        "\n$longcomparefromdate "
       . $locale->text('Bis')
       . qq| $longcomparetodate|;
   }
@@ -1215,7 +1215,6 @@ sub generate_income_statement {
   # setup variables for the form
   @a = qw(company address businessnumber);
   map { $form->{$_} = $myconfig{$_} } @a;
-  $form->{address} =~ s/\\n/<br>/g;
 
   $form->{templates} = $myconfig{templates};
 
@@ -1256,7 +1255,6 @@ sub generate_balance_sheet {
   # setup company variables for the form
   map { $form->{$_} = $myconfig{$_} }
     (qw(company address businessnumber nativecurr));
-  $form->{address} =~ s/\\n/<br>/g;
 
   $form->{templates} = $myconfig{templates};
 
@@ -1883,6 +1881,66 @@ sub select_all {
   $lxdebug->leave_sub();
 }
 
+sub print_options {
+  $lxdebug->enter_sub();
+
+  $form->{sendmode} = "attachment";
+  $form->{copies}   = 2 unless $form->{copies};
+
+  $form->{PD}{ $form->{type} }     = "selected";
+  $form->{DF}{ $form->{format} }   = "selected";
+  $form->{OP}{ $form->{media} }    = "selected";
+  $form->{SM}{ $form->{sendmode} } = "selected";
+
+  $type = qq|
+           <option value=statement $form->{PD}{statement}>|
+    . $locale->text('Statement');
+
+  if ($form->{media} eq 'email') {
+    $media = qq|
+           <option value=attachment $form->{SM}{attachment}>|
+      . $locale->text('Attachment') . qq|
+           <option value=inline $form->{SM}{inline}>| . $locale->text('In-line');
+  } else {
+    $media = qq|
+           <option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
+    if ($myconfig{printer} && $latex_templates) {
+      $media .= qq|
+            <option value=printer $form->{OP}{printer}>|
+        . $locale->text('Printer');
+    }
+  }
+
+  if ($latex_templates) {
+    $format .= qq|
+            <option value=postscript $form->{DF}{postscript}>|
+      . $locale->text('Postscript') . qq|
+           <option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF');
+  }
+
+  print qq|
+<table>
+  <tr>
+    <td><select name=type>$type</select></td>
+    <td><select name=format>$format</select></td>
+    <td><select name=media>$media</select></td>
+|;
+
+  if ($myconfig{printer} && $latex_templates && $form->{media} ne 'email') {
+    print qq|
+      <td>| . $locale->text('Copies') . qq|
+      <input name=copies size=2 value=$form->{copies}></td>
+|;
+  }
+
+  print qq|
+  </tr>
+</table>
+|;
+
+  $lxdebug->leave_sub();
+}
+
 sub e_mail {
   $lxdebug->enter_sub();
 
@@ -2049,11 +2107,6 @@ sub print_form {
 
   $form->{templates} = "$myconfig{templates}";
 
-  # setup variables for the form
-  @a = qw(company address businessnumber tel fax);
-  map { $form->{$_} = $myconfig{$_} } @a;
-  $form->format_string(@a);
-
   $form->{IN} = "$form->{type}.html";
 
   if ($form->{format} eq 'postscript') {
@@ -2081,7 +2134,6 @@ sub print_form {
           (name, street, zipcode, city, country, contact, email,
            "$form->{ct}phone", "$form->{ct}fax");
         map { $form->{$_} = $ref->{$_} } @a;
-        $form->format_string(@a);
 
         $form->{ $form->{ct} } = $form->{name};
         $form->{"$form->{ct}_id"} = $ref->{ctid};
@@ -2885,10 +2937,10 @@ sub generate_bwa {
     $longfromdate  = $locale->date(\%germandate, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%germandate, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
-      . qq|<br>\n$longfromdate |
+      . qq|\n$longfromdate |
       . $locale->text('bis')
       . qq| $longtodate|;
   }
@@ -2896,7 +2948,6 @@ sub generate_bwa {
   # setup variables for the form
   @a = qw(company address businessnumber);
   map { $form->{$_} = $myconfig{$_} } @a;
-  $form->{address} =~ s/\\n/<br>/g;
   $form->{templates} = $myconfig{templates};
 
   $form->{IN} = "bwa.html";
@@ -3065,7 +3116,7 @@ sub generate_ustva {
     $longfromdate  = $locale->date(\%myconfig, $form->{fromdate}, 1);
     $shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0);
 
-    $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+    $form->{this_period} = "$shortfromdate\n$shorttodate";
     $form->{period}      =
         $locale->text('for Period')
       . qq|<br>\n$longfromdate |
@@ -3082,9 +3133,9 @@ sub generate_ustva {
     $longcomparetodate  = $locale->date(\%myconfig, $form->{comparetodate}, 1);
     $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0);
 
-    $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
+    $form->{last_period} = "$shortcomparefromdate\n$shortcomparetodate";
     $form->{period} .=
-        "<br>\n$longcomparefromdate "
+        "\n$longcomparefromdate "
       . $locale->text('bis')
       . qq| $longcomparetodate|;
   }