Add amount owing gross/net to report
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user