Bug 528 solved. Better Taxbird export for USTVA.
[kivitendo-erp.git] / bin / mozilla / dn.pl
index 6bb5614..f0f2a57 100644 (file)
@@ -207,14 +207,7 @@ sub edit_config {
 <input type=hidden name=password value=$form->{password}>
 
 <input class=submit type=submit name=action value="|
-    . $locale->text('Save') . qq|">|;
-
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
+    . $locale->text('Save') . qq|">
 
   </form>
 
@@ -517,8 +510,8 @@ sub show_invoices {
   <td><hr size=3 noshade></td>
   </tr>
 </table>|;
-&print_options;
-print qq|
+  &print_options;
+  print qq|
 <br>
 <form method=post action=$form->{script}>
 
@@ -533,13 +526,7 @@ print qq|
 <input type=hidden name=password value=$form->{password}>
 <input type="hidden" name="action">
 <input type="submit" name="dummy" value="|
-    . $locale->text('Continue') . qq|" onclick="this.disabled=true; this.value='| . $locale->text("The dunning process is started") . qq|'; document.Form.action.value='| . lc($locale->text('Continue') . qq|'; document.Form.submit()">|;
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
+    . $locale->text('Continue') . qq|" onclick="this.disabled=true; this.value='| . $locale->text("The dunning process started") . qq|'; document.Form.action.value='| . $locale->text('Continue') . qq|'; document.Form.submit()">
 
   </form>
 
@@ -911,7 +898,7 @@ sub show_dunning {
   $dunning = qq|<select name=next_dunning_id_$i>$form->{selectdunning}</select>|;
 
 
-    $column_data{dunning_description}           = qq|<td>$ref->{dunning_description}</td>|;
+    $column_data{dunning_description}           = qq|<td><a href=dn.pl?action=print_dunning&dunning_id=$ref->{dunning_id}&format=pdf&media=screen&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$form->{callback}>$ref->{dunning_description}</a></td>|;
     my $active = "checked";
     $column_data{dunning_date}           = qq|<td>$ref->{dunning_date}</td>|;
     $column_data{next_duedate}           = qq|<td>$ref->{dunning_duedate}</td>|;
@@ -955,14 +942,6 @@ sub show_dunning {
 <input type=hidden name=path value=$form->{path}>
 <input type=hidden name=login value=$form->{login}>
 <input type=hidden name=password value=$form->{password}>
-|;
-
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
 
   </form>
 
@@ -974,5 +953,21 @@ sub show_dunning {
   $lxdebug->leave_sub();
 
 }
+
+sub print_dunning {
+  $lxdebug->enter_sub();
+
+  DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $userspath,$spool, $sendmail);
+
+  if($form->{DUNNING_PDFS}) {
+    DN->melt_pdfs(\%myconfig, \%$form,$spool);
+  } else {
+    $form->redirect($locale->text('Could not create dunning copy!'));
+  }
+
+  $lxdebug->leave_sub();
+
+}
+
 # end of main