From 55190b7d08a09fce60e070b3ef2e1fb036cee984 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 20 Nov 2013 11:13:11 +0100 Subject: [PATCH] [FIX] Also exclude TXFee records for last ID --- public/include/classes/transaction.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/classes/transaction.class.php b/public/include/classes/transaction.class.php index d82f30ce..ecf93357 100644 --- a/public/include/classes/transaction.class.php +++ b/public/include/classes/transaction.class.php @@ -36,7 +36,7 @@ class Transaction extends Base { public function setArchived($account_id, $txid) { // Fetch last archived transaction for user, we must exclude our Debits though! There might be unarchived/archived // records before our last payout - $stmt = $this->mysqli->prepare("SELECT IFNULL(MAX(id), 0) AS id FROM $this->table WHERE archived = 1 AND account_id = ? AND type NOT IN ('Debit_MP','Debit_AP')"); + $stmt = $this->mysqli->prepare("SELECT IFNULL(MAX(id), 0) AS id FROM $this->table WHERE archived = 1 AND account_id = ? AND type NOT IN ('Debit_MP','Debit_AP','TXFee')"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result()) $last_id = $result->fetch_object()->id; $this->debug->append('Found last archived transaction: ' . $last_id);