Working on getting accounts for a notificition based on renewal date
before.
return $this->wpdb->get_results(
"SELECT *
FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
- WHERE renewal_date + INTERVAL 1 YEAR " . ($before ? '-' : '+' ) . " $days DAY <= '$curDate'"
+ WHERE renewal_date + INTERVAL 1 YEAR " . ($before ? '-' : '+' ) . " $days DAY = '$curDate'
+ AND archived <> true"
);
}
foreach ( $notifications as $notice ) {
echo '<pre>$notice: ' . print_r( $notice, true ) . '</pre>';
+ switch( $notice['send_date_period'] ) {
+ case $this->config['send_date_when_numb']['After']:
+ $before = false;
+ break;
+ case $this->config['send_date_when_numb']['Before']:
+ $before = true;
+ break;
+ }
+ $accounts = $billingSupport->getAccountsRenewing( $notice['send_date_number'], $before );
+ echo '<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';
}
// Loop through the invoices and for each one see if any notices are to be sent out.