From 6e2354efe6bf666b4a8d6e9b4a3937d831645def Mon Sep 17 00:00:00 2001
From: Nathan Coad
Date: Wed, 14 May 2014 18:19:17 +1000
Subject: [PATCH] Reformatted booking summary report
---
booking.reports.inc | 57 +++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 25 deletions(-)
diff --git a/booking.reports.inc b/booking.reports.inc
index c25e40b..01ee1f1 100644
--- a/booking.reports.inc
+++ b/booking.reports.inc
@@ -159,44 +159,51 @@ function booking_report_summary() {
if ($amount_owing == 0)
$fullypaid_count++;
- //general stats
- $dob_total += $person->booking_dob;
$person_count++;
- if ($person->booking_gender == 'M')
- {
- $male_count++;
- $male_dob_total += $person->booking_dob;
- }
- else
- {
- $female_count++;
- $female_dob_total += $person->booking_dob;
- }
+ //general stats for booked in people
+ if ($person->booking_status == 1)
+ {
+ $dob_total += $person->booking_dob;
+
+ if ($person->booking_gender == 'M')
+ {
+ $male_count++;
+ $male_dob_total += $person->booking_dob;
+ }
+ else
+ {
+ $female_count++;
+ $female_dob_total += $person->booking_dob;
+ }
- if ($person->booking_baptised == 'Y')
- $baptised_count++;
+ if ($person->booking_baptised == 'Y')
+ $baptised_count++;
- if ($person->booking_married == 'Y')
- $married_count++;
+ if ($person->booking_married == 'Y')
+ $married_count++;
+ }
}
//output everything
- $output .= t("General Statistics
");
- $output .= t("There are !boys males and !girls females registered. Of these, !baptised are baptised and !married are married.
",
+ $output .= t("
General Statistics
");
+ $output .= t("Attendees booked in
");
+ $output .= t("There are !boys males and !girls females currently booked in. Of these, !baptised are baptised and !married are married.
",
array('!boys' => $male_count, '!girls' => $female_count, '!baptised' => $baptised_count, '!married' => $married_count
));
- $output .= t("The overall average age at the start of the week will be !average. The male average age will be !maleaverage. The female average age will be !femaleaverage.
",
- array('!average' => _booking_avg_age($dob_total, $person_count, $event->booking_event_start), '!maleaverage' => _booking_avg_age($male_dob_total, $male_count, $event->booking_event_start),
+ $output .= t("The combined average age at the start of the week will be !average.
The male average age will be !maleaverage.
The female average age will be !femaleaverage.
",
+ array('!average' => _booking_avg_age($dob_total, $male_count + $female_count, $event->booking_event_start), '!maleaverage' => _booking_avg_age($male_dob_total, $male_count, $event->booking_event_start),
'!femaleaverage' => _booking_avg_age($female_dob_total, $female_count, $event->booking_event_start)
));
- $output .= t("There are !bookedin registrations currently booked in, !waiting on waiting list, !notpaid haven't paid, " .
- "and !notcoming are no longer coming, which comes to a total of !total people who have filled in the registration form.
",
- array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter, '!total' => $person_count,
+ $output .= t("Overall
");
+ $output .= t("There are !bookedin registrations currently booked in, !waiting on waiting list, !notpaid haven't paid, " .
+ "and !notcoming are no longer coming, which comes to a total of !total people who have filled in the registration form. !travel people have filled in their travel form.
",
+ array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter, '!total' => $person_count, '!travel' => $travelform_count,
'!notcoming' => $notcoming_counter));
+ $output .= t("Finances
");
$output .= t("There are !welfare people with special financial consideration approved, and !committee people on the committee. " .
- "!fullypaid people have completed their payments and !travel people have filled in their travel form.
",
- array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!travel' => $travelform_count, '!committee' => $committee_count,
+ "!fullypaid people have completed their payments.
",
+ array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!committee' => $committee_count,
));
$output .= t("Total amount paid: $!paid, minus $!refunds in refunds.", array('!paid' => $total_paid, '!refunds' => $total_refunds));
$output .= t("Bookings by state
");