From cefdfd3afc310776aa85454eb9261b9253c565eb Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 29 Nov 2014 11:36:57 +1100 Subject: [PATCH] add payment complete flag to payment report --- booking.reports.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/booking.reports.inc b/booking.reports.inc index b7daff0..802da46 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -262,14 +262,16 @@ function booking_report_paypal_payments() { $total_fees = 0; $header = array('Node Id', 'Name', 'Email', 'Payment Date', 'Gross Payment', 'Currency', - 'Paypal Fee', 'Invoice', 'Payment Status', 'Payer ID', 'Item Name', 'IPN track ID'); + 'Paypal Fee', 'Invoice', 'Payment Status', 'Payer ID', 'Item Name', 'IPN track ID', 'Payment Complete'); $rows = array(); //fetch the payment table - $query = db_select('booking_payment', 'pa') - ->condition('pa.booking_eventid', $event->eid,'=') - ->fields('pa'); - $result = $query->execute(); + $query = db_select('booking_payment', 'pa'); + $query->join('booking_person', 'p', 'pa.booking_person_nid = p.nid'); + $query->fields('pa') + ->fields('p', array('booking_payment_complete')) + ->condition('pa.booking_eventid', $event->eid,'='); + $result = $query->execute(); //$result = db_query("SELECT * FROM {booking_person} p WHERE p.booking_event_id = :eid", // array(':eid' => $event->eid)); @@ -287,7 +289,8 @@ function booking_report_paypal_payments() { t($person->booking_payment_status), t($person->booking_payer_id), t($person->booking_item_name), - t($person->booking_ipn_track_id) + t($person->booking_ipn_track_id), + t($person->booking_payment_complete), ); $total_paid += $person->booking_mc_gross; $total_fees += $person->booking_mc_fee;