diff --git a/booking.paypal.inc b/booking.paypal.inc index 6a570f6..d38c39b 100644 --- a/booking.paypal.inc +++ b/booking.paypal.inc @@ -90,6 +90,9 @@ function booking_paypal_ipn() { return; } */ + + //TODO: Handle refund and payment dispute IPNs + if (empty($ipn['payment_status']) || ($ipn['payment_status'] != 'Completed' && variable_get('booking_paypal_sandbox', 0) == 0)) return; diff --git a/booking.reports.inc b/booking.reports.inc index 7b73529..76230da 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -684,8 +684,10 @@ function booking_csv_report() { if (strcmp($key,"booking_dob") == 0) $header_array[] = "booking_dob_processed"; //add in a calculated field for amount owing - if (strcmp($key, "nid") == 0) - $header_array[] = "booking_amount_owing"; + if (strcmp($key, "nid") == 0) { + $header_array[] = "booking_amount_owing_gross"; + $header_array[] = "booking_amount_owing_net"; + } } $header = implode( $delimiter, $header_array ); @@ -772,9 +774,10 @@ function booking_csv_report() { if ($key == 'nid') { $output[] = $value; - //this is really hacky since it does another database query for each person - //$output[] = _booking_amount_owing($value, 0, FALSE); - $output[] = _booking_amount_owing($record); + //add the amount owing firstly including paypal fees then excluding them + //bit of a hack since this can never be excluded from the report + $output[] = _booking_amount_owing($record, 0, TRUE); + $output[] = _booking_amount_owing($record, 0, FALSE); continue; }