Adding commitee flag

This commit is contained in:
2014-05-14 17:44:45 +10:00
parent bbcb28cfc7
commit 71772edbd5
6 changed files with 143 additions and 50 deletions

View File

@@ -18,6 +18,7 @@ function booking_report_summary() {
$baptised_count = 0;
$married_count = 0;
$total_paid = 0;
$total_refunds = 0;
$dob_total = 0;
$male_dob_total = 0;
$female_dob_total = 0;
@@ -25,6 +26,7 @@ function booking_report_summary() {
$welfare_count = 0;
$fullypaid_count = 0;
$travelform_count = 0;
$committee_count = 0;
$stats_attributes = array('style' => 'max-width:30%');
@@ -35,12 +37,16 @@ function booking_report_summary() {
$header = array(
array('data' => t('Id'), 'field' => 'nid', 'sort' => 'asc'),
array('data' => t('Name'), 'field' => 'booking_lastname'),
array('data' => t('Booking Status'), 'field' => 'booking_status'),
array('data' => t('Edit Studygroups')),
array('data' => t('Email'), 'field' => 'booking_email'),
array('data' => t('Payment To Date'), 'field' => 'booking_amount_paid'),
array('data' => t('Total Payment Required')),
array('data' => t('Fully paid?')),
array('data' => t('Refund Processed?'), 'field' => 'booking_refund_processed'),
array('data' => t('Refund Due'), 'field' => 'booking_refund_due'),
array('data' => t('Welfare Required?'), 'field' => 'booking_welfare_required'),
array('data' => t('Committee?'), 'field' => 'booking_committee_member'),
);
$rows = array();
@@ -105,16 +111,27 @@ function booking_report_summary() {
l(t('!first !last', array('!first' => ucwords($person->booking_firstname), '!last' => ucwords($person->booking_lastname))),
t('node/!id/edit', array('!id' => $person->nid))
),
l(t('Edit'), t('admin/booking/!id/edit-studygroup', array('!id' => $person->nid))),
_booking_status_generate($person->booking_status),
l(t('Edit Groups'), t('admin/booking/!id/edit-studygroup', array('!id' => $person->nid))),
t('!email', array('!email' => $person->booking_email)),
t('!payment', array('!payment' => $person->booking_amount_paid)),
t('!payment', array('!payment' => $amount_owing == 0 ? $person->booking_total_pay_reqd : _booking_total_due($person))),
t('!fullypaid', array('!fullypaid' => $amount_owing == 0 ? 'Yes' : 'No')),
t($person->booking_welfare_required == 'Y' ? 'Yes' : 'No'),
t('!reqd', array('!reqd' => $person->booking_refund_processed == 'Y' ? 'Yes' : 'No')),
t('!payment', array('!payment' => $person->booking_refund_due)),
t($person->booking_welfare_required == 'Y' ? 'Yes' : 'No'),
t($person->booking_committee_member == 'Y' ? 'Yes' : 'No'),
);
//add up the total paid
$total_paid += $person->booking_amount_paid;
//subtract any refund
if ($person->booking_refund_processed == 'Y' && $person->booking_refund_due > 0)
{
$total_refunds += $person->booking_refund_due;
}
//travel form completed?
if (! empty($person->tid))
$travelform_count++;
@@ -132,6 +149,10 @@ function booking_report_summary() {
//welfare
if ($person->booking_welfare_required == 'Y')
$welfare_count++;
//committee?
if ($person->booking_committee_member == 'Y')
$committee_count++;
//fully paid?
if ($amount_owing == 0)
@@ -168,13 +189,15 @@ function booking_report_summary() {
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),
'!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.</p>",
$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.</p>",
array('!bookedin' => $bookedin_counter, '!waiting' => $waiting_counter, '!notpaid' => $notpaid_counter, '!total' => $person_count,
'!notcoming' => $notcoming_counter));
$output .= t("<p>There are !welfare people with special financial consideration approved. !fullypaid people have completed their payments and !travel people have filled in their travel form.<br />",
array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!travel' => $travelform_count,
$output .= t("<p>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.<br />",
array('!welfare' => $welfare_count, '!fullypaid' => $fullypaid_count, '!travel' => $travelform_count, '!committee' => $committee_count,
));
$output .= t("Total amount paid: $!paid</p>", array('!paid' => $total_paid));
$output .= t("Total amount paid: $!paid, minus $!refunds in refunds.</p>", array('!paid' => $total_paid, '!refunds' => $total_refunds));
$output .= t("<h3>Bookings by state</h3>");
$output .= theme('table', array('header' => $state_header, 'rows' => $state_rows, 'attributes' => $stats_attributes));
$output .= t("<h3>Bookings by ecclesia</h3>");