From 3424387cde6c635ff16c3b5459c4caa88bb76e2e Mon Sep 17 00:00:00 2001 From: Anne Limoges Date: Mon, 5 May 2014 10:38:05 +0200 Subject: [PATCH] Handles canceled payment transactions. --- modules/payment.php | 2 +- modules/xnetevents.php | 2 +- modules/xnetevents/xnetevents.inc.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/payment.php b/modules/payment.php index 1776cc4..4fa0641 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -934,7 +934,7 @@ class PaymentModule extends PLModule FROM payment_transactions AS t LEFT JOIN payments AS p ON (t.ref = p.id) LEFT JOIN groups AS g ON (p.asso_id = g.id) - WHERE t.recon_id IN {?} + WHERE t.recon_id IN {?} AND t.status = "confirmed" GROUP BY t.ref', $recongp_id, $recon_ids); diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 5428ab0..76abf6c 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -711,7 +711,7 @@ class XnetEventsModule extends PLModule XDB::fetchAllAssoc('SELECT t.uid, t.amount FROM payment_transactions AS t LEFT JOIN group_event_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?}) - WHERE t.ref = {?} AND ep.uid IS NULL', + WHERE t.status = "confirmed" AND t.ref = {?} AND ep.uid IS NULL', $evt['eid'], $evt['paiement_id']), 'uid', 'user'); $page->assign('oublis', count($infos)); diff --git a/modules/xnetevents/xnetevents.inc.php b/modules/xnetevents/xnetevents.inc.php index ace99d9..dc31a1b 100644 --- a/modules/xnetevents/xnetevents.inc.php +++ b/modules/xnetevents/xnetevents.inc.php @@ -128,7 +128,7 @@ function get_event_telepaid($eid, $uid) $telepaid = XDB::fetchOneCell('SELECT SUM(pt.amount) FROM payment_transactions AS pt LEFT JOIN group_events as ge ON (ge.paiement_id = pt.ref) - WHERE ge.eid = {?} AND pt.uid = {?}', + WHERE pt.status = "confirmed" AND ge.eid = {?} AND pt.uid = {?}', $eid, $uid); return $telepaid; } @@ -205,7 +205,7 @@ function get_event_detail($eid, $item_id = false, $asso_id = null) $montant = XDB::fetchOneCell('SELECT SUM(amount) AS sum_amount FROM payment_transactions AS t - WHERE ref = {?} AND uid = {?}', + WHERE status = "confirmed" AND ref = {?} AND uid = {?}', $evt['paiement_id'], S::v('uid')); $evt['telepaid'] = $montant; $evt['paid'] += $montant; @@ -258,7 +258,7 @@ function get_event_participants(&$evt, $item_id, array $tri = array(), $limit = if ($money && $pay_id) { $montant = XDB::fetchOneCell('SELECT SUM(amount) FROM payment_transactions AS t - WHERE ref = {?} AND uid = {?}', + WHERE status = "confirmed" AND ref = {?} AND uid = {?}', $pay_id, $uid); $u['paid'] += $montant; } -- 2.1.4