Add amount owing gross/net to report

This commit is contained in:
2016-03-05 10:13:10 +11:00
parent 9250a1b73c
commit e212a1be95
2 changed files with 11 additions and 5 deletions

View File

@@ -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;
}