case 'createInvoices':
$view = 'invoicing';
+ $currentInvoiceDateTS = $BillingSupport->getCurrentInvoiceDate();
+ $currentInvoiceDate = date( 'Y-m-d', $currentInvoiceDateTS );
+ $nextInvoiceDateTS = $BillingSupport->getNextInvoiceDate();
+ $nextInvoiceDate = date( 'Y-m-d', $nextInvoiceDateTS );
+
+ $wParts[] = " T.id NOT IN (
+ SELECT account
+ FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoices
+ WHERE due_date BETWEEN '$currentInvoiceDate' AND '$nextInvoiceDate'
+ ) ";
+
if ( $option2 ) {
// $where used in all places.
$where = implode( ' AND ', $wParts );
// $where used in all places.
$where = implode( ' AND ', $wParts );
+ // echo '<pre>$where: ' . print_r( $where, true ) . '</pre>';
// Check if Counties is enabled and fetch counties
if ( isset( $this->config['settings']['enable_counties'] ) && $this->config['settings']['enable_counties'] ) {