Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P10262
T243356 Generate CSV for batch refund script
Active
Public
Actions
Authored by
•
AndyRussG
on Jan 24 2020, 5:23 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F31532454: raw.txt
Jan 24 2020, 5:23 PM
2020-01-24 17:23:50 (UTC+0)
Subscribers
None
SELECT
grp
.
*
,
SUBSTRING_INDEX
(
c
.
invoice_id
,
'|'
,
1
)
AS
order_id
,
e
.
gateway_txn_id
AS
payment_id
,
e
.
original_currency
AS
currency
,
e
.
original_amount
AS
amount
,
c
.
receive_date
AS
date
FROM
(
SELECT
c
.
contribution_recur_id
AS
recur_id
,
e
.
gateway
AS
gateway
,
contact
.
first_name
AS
first_name
,
contact
.
last_name
AS
last_name
,
email
.
email
AS
email_addr
,
country_t
.
iso_code
AS
country
,
MIN
(
c
.
id
)
as
min_c_id
,
count
(
*
)
AS
ccount
FROM
civicrm_contribution
AS
c
LEFT
JOIN
(
wmf_contribution_extra
AS
e
,
civicrm_address
AS
addr
,
civicrm_email
AS
email
,
civicrm_contact
AS
contact
)
ON
c
.
id
=
e
.
entity_id
AND
c
.
contact_id
=
addr
.
contact_id
AND
c
.
contact_id
=
contact
.
id
AND
c
.
contact_id
=
email
.
contact_id
LEFT
JOIN
civicrm_country
AS
country_t
ON
addr
.
country_id
=
country_t
.
id
WHERE
c
.
contribution_recur_id
>
0
AND
c
.
receive_date
>
'2020-01-01'
AND
c
.
contribution_status_id
=
1
AND
e
.
gateway
=
'ingenico'
AND
addr
.
is_primary
=
1
AND
email
.
is_primary
=
1
GROUP
BY
c
.
contribution_recur_id
,
c
.
contact_id
,
e
.
gateway
,
contact
.
first_name
,
contact
.
last_name
,
email
.
email
,
country_t
.
iso_code
HAVING
ccount
>
1
)
AS
grp
LEFT
JOIN
(
civicrm_contribution
AS
c
,
wmf_contribution_extra
AS
e
)
ON
(
grp
.
min_c_id
=
c
.
id
AND
grp
.
min_c_id
=
e
.
entity_id
);
Event Timeline
•
AndyRussG
created this paste.
Jan 24 2020, 5:23 PM
2020-01-24 17:23:50 (UTC+0)
•
AndyRussG
mentioned this in
T243356: Civi: January 2020 Ingenico recurrings processing in duplicate?
.
Jan 29 2020, 10:18 PM
2020-01-29 22:18:31 (UTC+0)
Log In to Comment