Reserves without Homechecks
###
Auditing
###
Any rev03
###
All owners with active reservations on animals who have not been homechecked.
###
en
###
SELECT 
ad.ReservationDate,
o.OwnerName, o.ID AS OID, o.OwnerAddress, 
o.OwnerTown, o.OwnerCounty, 
o.OwnerPostcode, 
o.HomeTelephone, o.WorkTelephone, o.MobileTelephone, o.EmailAddress,
a.AnimalName, a.ID AS AID, a.ShelterCode
FROM adoption ad
INNER JOIN animal a ON ad.AnimalID = a.ID
INNER JOIN owner o ON ad.OwnerID = o.ID
WHERE ad.ReservationDate Is Not Null 
AND ad.ReservationCancelledDate Is Not Null
AND ad.MovementType = 0
AND o.IDCheck = 0
ORDER BY OwnerName
###
$$HEADER
<table border="1">
<thead>
<tr>
<th>Reserved On</th>
<th>Person</th>
<th>Animal</th>
</tr>
</thead>
<tbody>
HEADER$$

$$BODY
<tr>
<td>$RESERVATIONDATE</td>
<td><b><a target="_blank" href="person?id=$OID">$OWNERNAME</a></b><br />
$OWNERADDRESS<br />
$OWNERTOWN<br />
$OWNERCOUNTY<br />
$OWNERPOSTCODE<br />
$HOMETELEPHONE
$WORKTELEPHONE
$MOBILETELEPHONE<br />
$EMAILADDRESS</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a> - 
$SHELTERCODE</td>
</tr>
BODY$$

$$FOOTER
</tbody>
</table>
FOOTER$$