]> wagnertech.de Git - kivitendo-erp.git/commitdiff
SEPA-Überweisung: Rechnungen mit NICHT gesetztem "Lastschrifteinzug" vorauswählen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 11 Feb 2013 09:53:07 +0000 (10:53 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 11 Feb 2013 09:54:08 +0000 (10:54 +0100)
Die Logik ist im Einkauf genau umgekehrt zum
Verkauf. "Lastschrifteinzug" bedeutet im Verkauf, dass wir einziehen,
also dass wir die Rechnung via SEPA anweisen müssen.

Im Einkauf bedeutet es, dass der Lieferant direkt von uns einzieht und
wir deshalb nichts manuell machen müssen.

bin/mozilla/sepa.pl

index 40d2dff79f4b62864f26527783855cd5b4598fbb..518b9a8fcea3a7d11194c13ee2dbaeb7003353fb 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}) };