+ # 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 };
+