Vaccination Diary (On Shelter by Species)
###
Diary
###
33012/Any rev03
###
Vaccinations required to date for shelter animals, broken down by species.
###
en
###
SELECT
a.ID AS AID, a.ShelterCode, a.AnimalName, t.AnimalType, 
v.VaccinationType, av.DateRequired, av.Comments, sp.SpeciesName
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
INNER JOIN animalvaccination av ON a.ID = av.AnimalID
INNER JOIN vaccinationtype v ON av.VaccinationID = v.ID
INNER JOIN species sp ON sp.ID = a.SpeciesID
WHERE av.DateOfVaccination Is Null
AND av.DateRequired <= '$CURRENT_DATE$'
AND a.Archived = 0
ORDER BY sp.SpeciesName, av.DateRequired
###
$$HEADER
HEADER$$

$$GROUP_SpeciesName
$$HEAD
<h2>$SpeciesName</h2>
<table border=1>
<thead>
<tr>
<th><b>Code</b></th>
<th><b>Name</b></th>
<th><b>Type</b></th>
<th><b>Vaccination Type</b></th>
<th><b>Required</b></th>
<th><b>Comments</b></th>
</tr>
</thead>
<tbody>
$$FOOT
</tbody>
</table>
GROUP$$

$$BODY<tr>
<td>$SHELTERCODE</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$ANIMALTYPE</td>
<td>$VACCINATIONTYPE</td>
<td>$DATEREQUIRED</td>
<td>$COMMENTS</td>
</tr>
BODY$$

$$FOOTER
FOOTER$$
&&&
Vaccination Diary (On Shelter by Species, Date Range)
###
Diary
###
33012/Any rev03
###
Vaccinations required between two dates for shelter animals, broken down by species.
###
en
###
SELECT
a.ID AS AID, a.ShelterCode, a.AnimalName, t.AnimalType, 
v.VaccinationType, av.DateRequired, av.Comments, sp.SpeciesName
FROM animal a
INNER JOIN animaltype t ON t.ID = a.AnimalTypeID
INNER JOIN animalvaccination av ON a.ID = av.AnimalID
INNER JOIN vaccinationtype v ON av.VaccinationID = v.ID
INNER JOIN species sp ON sp.ID = a.SpeciesID
WHERE av.DateOfVaccination Is Null
AND av.DateRequired >= '$ASK DATE Enter the from date$'
AND av.DateRequired <= '$ASK DATE Enter the to date$'
AND (a.Archived = 0 OR a.ActiveMovementType = 2)
ORDER BY sp.SpeciesName, av.DateRequired
###
$$HEADER
HEADER$$

$$GROUP_SpeciesName
$$HEAD
<h2>$SPECIESNAME</h2>
<table border=1>
<thead>
<tr>
<th><b>Code</b></th>
<th><b>Name</b></th>
<th><b>Type</b></th>
<th><b>Vaccination Type</b></th>
<th><b>Required</b></th>
<th><b>Comments</b></th>
</tr>
</thead>
<tbody>
$$FOOT
</tbody>
</table>
GROUP$$

$$BODY<tr>
<td>$SHELTERCODE</td>
<td><a target="_blank" href="animal?id=$AID">$ANIMALNAME</a></td>
<td>$ANIMALTYPE</td>
<td>$VACCINATIONTYPE</td>
<td>$DATEREQUIRED</td>
<td>$COMMENTS</td>
</tr>
BODY$$

$$FOOTER
FOOTER$$

