Fixed wrong condition to determine direct debit month.
[memberdb.git] / 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();
            }