Add amount owing gross/net to report
This commit is contained in:
@@ -90,6 +90,9 @@ function booking_paypal_ipn() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//TODO: Handle refund and payment dispute IPNs
|
||||||
|
|
||||||
if (empty($ipn['payment_status']) || ($ipn['payment_status'] != 'Completed' && variable_get('booking_paypal_sandbox', 0) == 0))
|
if (empty($ipn['payment_status']) || ($ipn['payment_status'] != 'Completed' && variable_get('booking_paypal_sandbox', 0) == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -684,8 +684,10 @@ function booking_csv_report() {
|
|||||||
if (strcmp($key,"booking_dob") == 0)
|
if (strcmp($key,"booking_dob") == 0)
|
||||||
$header_array[] = "booking_dob_processed";
|
$header_array[] = "booking_dob_processed";
|
||||||
//add in a calculated field for amount owing
|
//add in a calculated field for amount owing
|
||||||
if (strcmp($key, "nid") == 0)
|
if (strcmp($key, "nid") == 0) {
|
||||||
$header_array[] = "booking_amount_owing";
|
$header_array[] = "booking_amount_owing_gross";
|
||||||
|
$header_array[] = "booking_amount_owing_net";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$header = implode( $delimiter, $header_array );
|
$header = implode( $delimiter, $header_array );
|
||||||
@@ -772,9 +774,10 @@ function booking_csv_report() {
|
|||||||
if ($key == 'nid')
|
if ($key == 'nid')
|
||||||
{
|
{
|
||||||
$output[] = $value;
|
$output[] = $value;
|
||||||
//this is really hacky since it does another database query for each person
|
//add the amount owing firstly including paypal fees then excluding them
|
||||||
//$output[] = _booking_amount_owing($value, 0, FALSE);
|
//bit of a hack since this can never be excluded from the report
|
||||||
$output[] = _booking_amount_owing($record);
|
$output[] = _booking_amount_owing($record, 0, TRUE);
|
||||||
|
$output[] = _booking_amount_owing($record, 0, FALSE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user