Merge pull request #7 from freiphone/master
authorsschoeling <s.schoeling@linet-services.de>
Tue, 6 Jun 2017 09:33:56 +0000 (11:33 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2017 09:33:56 +0000 (11:33 +0200)
Bug-Fix: Drucken

bin/mozilla/is.pl
bin/mozilla/oe.pl
locale/de/all
templates/webpages/is/form_header.html

index 1fe448f..1f7bbcf 100644 (file)
@@ -344,6 +344,11 @@ sub setup_is_action_bar {
           checks   => [ @req_trans_desc ],
           disabled => !$form->{id} && $form->{locked} ? t8('The billing period has already been locked.') : undef,
         ],
+        action => [ t8('Print and Post'),
+          call     => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'print_and_post' ],
+          checks   => [ @req_trans_desc ],
+          disabled => $form->{id} ? t8('This invoice has already been posted.') : undef,,
+        ],
         action => [ t8('E Mail'),
           call     => [ 'kivi.SalesPurchase.show_email_dialog' ],
           checks   => [ @req_trans_desc ],
index 8f4f28a..4c2d059 100644 (file)
@@ -581,9 +581,9 @@ sub form_header {
   if ($form->{resubmit} && ($form->{format} eq "html")) {
       $dispatch_to_popup  = "window.open('about:blank','Beleg'); document.oe.target = 'Beleg';";
       $dispatch_to_popup .= "document.do.submit();";
-  } elsif ($form->{resubmit}) {
+  } elsif ($form->{resubmit}  && $form->{action_print}) {
     # emulate click for resubmitting actions
-    $dispatch_to_popup  = "document.oe.${_}.click(); " for grep { /^action_/ } keys %$form;
+    $dispatch_to_popup  = "kivi.SalesPurchase.show_print_dialog(); kivi.SalesPurchase.print_record();";
   } elsif ($creditwarning) {
     $::request->{layout}->add_javascripts_inline("alert('$credittext');");
   }
index f27c0e1..e3457c7 100755 (executable)
@@ -2221,6 +2221,7 @@ $self->{texts} = {
   'Pricegroups'                 => 'Preisgruppen',
   'Prices'                      => 'Preise',
   'Print'                       => 'Drucken',
+  'Print and Post'              => 'Drucken und Buchen',
   'Print automatically'         => 'Automatisch ausdrucken',
   'Print both sided'            => 'Beidseitig ausdrucken',
   'Print delivery orders'       => 'Drucke Lieferscheine',
index 66367ef..133ff7d 100644 (file)
 [% IF resubmit && is_format_html %]
        window.open('about:blank','Beleg');
        document.invoice.target = 'Beleg';
-       $('#action_print').click();
+       kivi.SalesPurchase.show_print_dialog();
+       kivi.SalesPurchase.print_record();
 [% ELSIF resubmit %]
-       $('#action_print').click();
+       kivi.SalesPurchase.show_print_dialog();
+       kivi.SalesPurchase.print_record();
 [% ELSIF creditwarning != '' %]
        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
 [% ELSE %]