Various tweaks and fixes
This commit is contained in:
@@ -107,6 +107,7 @@ function booking_report_summary() {
|
||||
t('!fullypaid', array('!fullypaid' => $amount_owing == 0 ? 'Yes' : 'No')),
|
||||
t($person->booking_welfare_required == 'Y' ? 'Yes' : 'No'),
|
||||
);
|
||||
//add up the total paid
|
||||
$total_paid += $person->booking_amount_paid;
|
||||
|
||||
//booking status
|
||||
@@ -509,8 +510,7 @@ function booking_csv_report() {
|
||||
if ($key == 'nid')
|
||||
{
|
||||
$output[] = $value;
|
||||
//this is really hacky since it does another massive database query for each person
|
||||
//$person = node_load($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($value);
|
||||
continue;
|
||||
@@ -523,53 +523,10 @@ function booking_csv_report() {
|
||||
else {
|
||||
$output[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$row = implode($delimiter, $output) . "\n";
|
||||
|
||||
|
||||
//watchdog('booking', "Report filename: " . $filename . ".");
|
||||
/*
|
||||
|
||||
//$header = "Barcode,Timestamp,First Name,Last Name,Gender,Date of Birth,Street,Suburb,Postcode,State,Country,Home Phone Number,Mobile Phone Number,Email,Second Email,Ecclesia,Baptised,Married,Partner Name,Room Mate 1,Room Mate 2,Help Areas,Attending Post Conference,Payment Method,Deposit Payment Deadline,Amount Paid,Discount,Status,T-shirt size";
|
||||
$header = "First Name,Last Name,Gender,Date of Birth,Married,Partner Name,Email Address,Mobile Phone,Home Phone,Baptised,";
|
||||
|
||||
if (variable_get('booking_enable_passport', 1) == 1)
|
||||
$header .= "Passport Number,Passport Expiry,Passport Issue Name,Passport Issue Location,";
|
||||
|
||||
if (variable_get('booking_enable_tshirts', 0) == 1)
|
||||
$header .= "T-Shirt size,";
|
||||
|
||||
$header .= "Ecclesia,Street,Suburb,Post Code,State,Country,Emergency Contact Name,Emergency Contact Type,Emergency Contact Phone," .
|
||||
"Emergency Contact Phone Alt,Medicare Number,Help Reading,Help Chairing,Help Music,Dietary Requirements,First Aid,Nurse," .
|
||||
"Booking Status,Date Paid,Amount Due,Amount Paid";
|
||||
|
||||
if (variable_get('booking_enable_skills', 1) == 1)
|
||||
$header .= ",Building Skills,Cooking Skills,Child Minding Skills,Other Languages,Mission Experience";
|
||||
|
||||
$query = db_query("SELECT * FROM {booking_person} p WHERE p.booking_event_id = :eid",
|
||||
array(':eid' => $event->eid));
|
||||
$result = $query->fetchAll();
|
||||
|
||||
$music_help = empty($r->booking_help_music) ? '' : $r->booking_help_music;
|
||||
$row = ucwords($r->booking_firstname) . ',' . ucwords($r->booking_lastname) . ',' . $r->booking_gender . ',' . format_date($r->booking_dob, 'custom', 'd/m/Y') . ',' .
|
||||
$r->booking_married . ',' . $r->booking_partner_name . ',' . $r->booking_email . ',"' . $r->booking_mobile . '","' . $r->booking_phone . '",' .
|
||||
$r->booking_baptised . ',';
|
||||
|
||||
if (variable_get('booking_enable_passport', 1) == 1)
|
||||
$row .= $r->booking_passport_num . ',' .
|
||||
|
||||
$row .= '"' . $r->booking_ecclesia . '","' . $r->booking_street . '","' . $r->booking_suburb . '",' . $r->booking_postcode . ',' .
|
||||
$r->booking_state . ',' . $r->booking_country . ',"' .
|
||||
$r->booking_guardian_name . '",' . $r->booking_guardian_type . ',"' . $r->booking_guardian_phone . '","' . $r->booking_guardian_phone_alt . '",' .
|
||||
$r->booking_medicare . ',' .
|
||||
$r->booking_help_reading . ',' . $r->booking_help_chairing . ',"' . $music_help . '","' .
|
||||
$r->booking_dietary . '",' . $r->booking_firstaid . ',' . $r->booking_nurse . ',' .
|
||||
_booking_status_generate($r->booking_status) . ',' . format_date(_booking_datepaid_ts($r->nid), 'custom', 'd/m/Y H:i') . ',' .
|
||||
$r->booking_total_pay_reqd . ',' . $r->booking_amount_paid . "\n";
|
||||
*/
|
||||
|
||||
@fwrite($handle, $row);
|
||||
//$index++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user