<?xml version="1.0" encoding="ISO-8859-1"?>
<pmbquotas>
	<elements>	  
		<element name="READER_CATEG" id="2" comment="Borrower Categories">			
			<linkedto>READER</linkedto>			
			<tablelinked>empr</tablelinked>
			<linkedfield>empr_categ</linkedfield>
			<linkedid>id_empr</linkedid>
			<table>empr_categ</table>
			<field>id_categ_empr</field>
			<label>libelle</label>
		</element>
			<element name="DOCTYPE" id="1" comment="Material Types">
			<linkedto>EXPL</linkedto>
			<tablelinked>exemplaires</tablelinked>
			<linkedfield>expl_typdoc</linkedfield>
			<linkedid>expl_id</linkedid>
			<table>docs_type</table>
			<field>idtyp_doc</field>
			<label>tdoc_libelle</label>
		</element>
			<element name="NOTICETYPE" id="4" comment="Record Types">
			<linkedto>NOTI</linkedto>
			<tablelinked by="notices">exemplaires</tablelinked>
			<linkedfield>expl_typdoc</linkedfield>
			<linkedid by="expl_notice">expl_id</linkedid>
			<table>docs_type</table>
			<field>idtyp_doc</field>
			<label>tdoc_libelle</label>
		</element>
			<element name="BULLETINTYPE" id="8" comment="Issue Types">
			<linkedto>BULL</linkedto>
			<tablelinked by="bulletins">exemplaires</tablelinked>
			<linkedfield>expl_typdoc</linkedfield>
			<linkedid by="expl_bulletin">expl_id</linkedid>
			<table>docs_type</table>
			<field>idtyp_doc</field>
			<label>tdoc_libelle</label>
		</element>
			<element name="READER_ALONE" id="16" comment="Individual Borrowers">
			<linkedto>READER</linkedto>
			<tablelinked>empr</tablelinked>
			<linkedfield>id_empr</linkedfield>
			<linkedid>id_empr</linkedid>
			<table>empr</table>
			<field>id_empr</field>
			<label>concat(empr_prenom,' ',empr_nom)</label>
		</element>
	</elements>

		<types>

			<type name="LEND_NMBR_QUOTA" id="1" max="yes" min="no" forcelend="yes" commentForcelend="of the loan" comment="Number of loan quotas" short_comment="number of items">
			<entity name="READER_CATEG" maxquota="yes">
				<counttable>pret</counttable>
				<countfield>pret_idempr</countfield>
				<max_error_message>The total number of loans %s has been reached (%s)</max_error_message>
				<partial_error_message>The number of loans by %s has been reached (%s)</partial_error_message>
				<default_error_message>The default number of loans has been reached (%s)</default_error_message>
			</entity>
						<quotas>
				<on countfields="pret_idempr">READER_CATEG</on>
				<on countfields="pret_idexpl">DOCTYPE</on>
				<on countfields="pret_idempr,pret_idexpl">READER_CATEG,DOCTYPE</on>
				<on countfields="pret_idempr">READER_ALONE</on>
				<on countfields="pret_idempr,pret_idexpl">READER_ALONE,DOCTYPE</on>
			</quotas>
		</type>

			<type name="LEND_TIME_QUOTA" id="2" max="no" min="no" forcelend="no" comment="Loan period Quotas" short_comment="loan period">
			<quotas>
				<on>READER_CATEG</on>
				<on>DOCTYPE</on>
				<on>READER_CATEG,DOCTYPE</on>
				<on>READER_ALONE</on>
				<on>READER_ALONE,DOCTYPE</on>
			</quotas>
		</type>
			
		<type name="PROLONG_NMBR_QUOTA" id="64" max="no" min="no" forcelend="yes" commentForcelend="of extension" comment="Quota extension" short_comment="Quantity">
			<quotas>
				<on>READER_CATEG</on>
				<on>DOCTYPE</on>
				<on>READER_CATEG,DOCTYPE</on>
				<on>READER_ALONE</on>
				<on>READER_ALONE,DOCTYPE</on>
			</quotas>
		</type>
		<type name="PROLONG_TIME_QUOTA" id="128" max="no" min="no" forcelend="no" comment="Extension period" short_comment="Extension period">
			<quotas>
				<on>READER_CATEG</on>
				<on>DOCTYPE</on>
				<on>READER_CATEG,DOCTYPE</on>
				<on>READER_ALONE</on>
				<on>READER_ALONE,DOCTYPE</on>
			</quotas>
		</type>	
				<type name="BOOK_NMBR_QUOTA" id="4" max="yes" min="no" forcelend="yes" commentForcelend="of the hold" comment="Number of hold quotas" short_comment="number of holds">
			<entity name="READER_CATEG" maxquota="yes">
				<counttable>resa</counttable>
				<countfield>resa_idempr</countfield>
				<max_error_message>The total number of holds %s has been reached (%s)</max_error_message>
				<partial_error_message>The number of holds by %s has been reached (%s)</partial_error_message>
				<default_error_message>The default number of holds has been reached (%s)</default_error_message>
			</entity>
							<quotas>
				<on countfields="resa_idempr">READER_CATEG</on>
				<on countfields="resa_idnotice">NOTICETYPE</on>
				<on countfields="resa_idempr,resa_idnotice">READER_CATEG,NOTICETYPE</on>
				<on countfields="resa_idempr">READER_ALONE</on>
				<on countfields="resa_idempr,resa_idnotice">READER_ALONE,NOTICETYPE</on>
			</quotas>
		</type>
			<type name="BOOK_TIME_QUOTA" id="8" max="no" min="no" forcelend="no" comment="Hold duration quotas" short_comment="hold duration">
			<quotas>
				<on>READER_CATEG</on>								<on>NOTICETYPE</on>
				<on>READER_CATEG,NOTICETYPE</on>
				<on>READER_ALONE</on>
				<on>READER_ALONE,NOTICETYPE</on>
			</quotas>
		</type>

			<type name="BOOK_NMBR_SERIAL_QUOTA" id="16" max="yes" min="no" forcelend="yes" commentForcelend="of the hold" comment="Number of serial hold quotas" short_comment="number of serial holds">
			<entity name="READER_CATEG" maxquota="yes">
				<counttable>resa</counttable>
				<countfield>resa_idempr</countfield>
				<max_error_message>The total number of serial holds %s has been reached (%s)</max_error_message>
				<partial_error_message>The number of serial holds %s has been reached (%s)</partial_error_message>
				<default_error_message>The default number of serial holds has been reached (%s)</default_error_message>
			</entity>
				<quotas>					<on countfields="resa_idempr">READER_CATEG</on>
				<on countfields="resa_idbulletin">BULLETINTYPE</on>
				<on countfields="resa_idempr,resa_idbulletin">READER_CATEG,BULLETINTYPE</on>
				<on countfields="resa_idempr">READER_ALONE</on>
				<on countfields="resa_idempr,resa_idbulletin">READER_ALONE,BULLETINTYPE</on>							</quotas>
		</type>

			<type name="BOOK_TIME_SERIAL_QUOTA" id="32" max="no" min="no" forcelend="no" comment="Serial hold duration quotas" short_comment="Serial hold duration">
			<quotas>
				<on>READER_CATEG</on>
				<on>BULLETINTYPE</on>
				<on>READER_CATEG,BULLETINTYPE</on>
				<on>READER_ALONE</on>
				<on>READER_ALONE,BULLETINTYPE</on>
			</quotas>
		</type>
	</types>
</pmbquotas>