]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/sepa.pl
Entfernt dpt_trans
[mfinanz.git] / bin / mozilla / sepa.pl
index 40d2dff79f4b62864f26527783855cd5b4598fbb..3b6ba95dfc060f2538314a96776771015b05d731 100755 (executable)
@@ -40,7 +40,12 @@ sub bank_transfer_add {
     return;
   }
 
-  $_->{checked} = $_->{direct_debit} for @{ $invoices };
+  # Only include those per default that require manual action from our
+  # side. For sales invoices these are the ones for which direct debit
+  # has been selected. For purchase invoices it's the other way
+  # around: if direct debit is active then the vendor will collect
+  # from us automatically and we don't have to send money manually.
+  $_->{checked} = ($vc eq 'customer' ? $_->{direct_debit} : !$_->{direct_debit}) for @{ $invoices };
 
   my $bank_account_label_sub = sub { $locale->text('Account number #1, bank code #2, #3', $_[0]->{account_number}, $_[0]->{bank_code}, $_[0]->{bank}) };
 
@@ -53,6 +58,7 @@ sub bank_transfer_add {
     $invoice->{reference_prefix}  = $prefix;
   }
 
+  $::request->layout->use_javascript('jquery.checkall.js');
   $form->header();
   print $form->parse_html_template('sepa/bank_transfer_add',
                                    { 'INVOICES'           => $invoices,
@@ -181,6 +187,8 @@ sub bank_transfer_list {
   my $cgi    = $::request->{cgi};
   my $vc     = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
 
+  $::request->layout->use_javascript('jquery.checkall.js');
+
   $form->{title}     = $vc eq 'customer' ? $::locale->text('List of bank collections') : $locale->text('List of bank transfers');
 
   $form->{sort}    ||= 'id';
@@ -325,6 +333,7 @@ sub bank_transfer_edit {
     $form->error($locale->text('That export does not exist.'));
   }
 
+  $::request->layout->use_javascript('jquery.checkall.js');
   $form->{jsscript} = 1;
   $form->{title}    = $locale->text('View SEPA export');
   $form->header();