Skip to content

Commit

Permalink
hotfix: customer does not receive recurring reminders, when invoice i…
Browse files Browse the repository at this point in the history
…s exported
  • Loading branch information
ole committed Nov 23, 2017
1 parent 7c45192 commit 171d077
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/invoice-task.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function payment_recur_reminder() {
$messageBody = WCInvoicePdf::$OPTIONS['wc_recur_reminder_message'];

// fetch all invoices which have status = Sent (ignore all invoice which are already marked as paid)
$sql = "SELECT * FROM {$wpdb->prefix}".Invoice::TABLE." WHERE `status` = 1 AND DATE_ADD(NOW(), INTERVAL -{$age} DAY) > due_date AND reminder_sent < $max";
$sql = "SELECT * FROM {$wpdb->prefix}".Invoice::TABLE." WHERE deleted = 0 AND NOT (`status` & ".Invoice::PAID.") AND `status` < ".Invoice::CANCELED." AND DATE_ADD(NOW(), INTERVAL -{$age} DAY) > due_date AND reminder_sent < $max";

$res = $wpdb->get_results($sql, OBJECT);

Expand Down

0 comments on commit 171d077

Please sign in to comment.