Fixed wrong condition to determine direct debit month.
authorAndreas Schiermeier <andreas@schiermeier.name>
Mon, 17 Feb 2014 22:52:12 +0000 (23:52 +0100)
committerAndreas Schiermeier <andreas@schiermeier.name>
Mon, 17 Feb 2014 22:52:12 +0000 (23:52 +0100)
include/directdebit.php

index e30816a..ac907fe 100644 (file)
@@ -231,8 +231,8 @@ function generate_directdebit() {/*{{{*/
            
            // datejs.com MAGIC
            var jetzt = new Date.today();
-           var collectiondate = new Date.parse('15'); //new Date(jetzt.getFullYear(), jetzt.getMonth(), <?=DIRECTDEBIT_DAY_OF_MONTH?>);
-           if (jetzt.getDate() < <?=DIRECTDEBIT_DAY_OF_MONTH?>) {
+           var collectiondate = new Date.parse('<?=DIRECTDEBIT_DAY_OF_MONTH?>');
+           if (jetzt.getDate() > <?=DIRECTDEBIT_DAY_OF_MONTH?>) {
              collectiondate = collectiondate.add(1).month();
            }