<?xml version="1.0"?>

<report name="cash-report" pdf-renderer="Kundendaten.xsl">
	<title>Kundendaten</title>

<report-parameter name="TENANT" type="integer" hidden="true">
		<preset>@TENANT_NO</preset>
	</report-parameter>
	<report-parameter name="COMPANY" type="integer" hidden="true">
		<preset>@COMPANY_NO</preset>
	</report-parameter>
	<report-parameter name="DATE" type="date" label="Von Datum:">
		<preset>@TODAY</preset>
		<input type="datepicker" />
	</report-parameter>
	<report-parameter name="BUSINESSUNIT" type="integer">
		<label>Filiale:</label>
		<input type="selectlist">
			<source type="dataset" name="businessunits">
			</source>
		</input>
	</report-parameter>

	<report-transaction report-nm="contactDataReport" report-transaction="de.timeglobe.pos.reporting.ContactData"/>
	<report-result report-dataset="businessunits">
	</report-result>
		<report-result report-dataset="contact">
	</report-result>
	<report-dataset name="contact">
		<sql>
			select c.contact_no,
			c.first_nm,
			c.contact_nm,
			c.street,
			c.postal_cd,
			c.city,
			c.country_cd,
			c.phone,
			c.mobile,
			c.email,
			cr.comment,
			cr.birthday,
			cg.customer_group_nm
			from contacts c inner join customer_roles cr on c.tenant_no = cr.tenant_no and c.contact_no = cr.contact_no 
			inner join customer_groups cg on cr.tenant_no = cg.tenant_no and cr.customer_group_no = cg.customer_group_no 
			where c.tenant_no=@TENANT_NO and c.contact_no=@CONTACT_NO
		</sql>
	</report-dataset>

<report-result report-dataset="departmentCurrency">
	</report-result>

    <report-dataset name="departmentCurrency">
		<sql>
			select * from currencies c join departments d on c.tenant_no = d.tenant_no AND c.currency_cd = d.currency_cd  where d.tenant_no=@TENANT_NO and d.company_no=@COMPANY_NO and d.department_no =@DEPARTMENT_NO 
		</sql>
	</report-dataset>
	<report-dataset name="businessunits">
		<sql>
			select * from businessunits where tenant_no=@TENANT_NO and company_no=@COMPANY_NO and department_no=@DEPARTMENT_NO and businessunit_no=@BUSINESSUNIT_NO
		</sql>
	</report-dataset>

	
	
	
	



</report>

