<?xml version="1.0"?>

<report name="cash-report" pdf-renderer="BVEntwicklung_LMAAMA.xsl">
	<title>Betriebsvergleich</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-result report-dataset="businessunits">
	</report-result>


	<report-result report-dataset="categorylist">
	</report-result>
	<report-result report-dataset="employeeNm">
	</report-result>
	
	

	
<report-transaction report-nm="bv" report-transaction="de.timeglobe.pos.reporting.bv.Betriebsvergleich">
	</report-transaction>

	<report-result report-dataset="itemCategoryReportGrouplist">
	</report-result>
	
	<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-dataset name="employeeNm">
		<sql>
			select employee_nm employee_nm from employees where tenant_no=@TENANT_NO and company_no=@COMPANY_NO  and employee_no=@EMPLOYEE_NO
		</sql>
	</report-dataset>

	<report-dataset name="itemCategoryReportGrouplist">
		<sql>
			SELECT 
						item_report_category_cd 
						,item_report_group_cd
						,item_report_group_nm
			FROM 		item_report_groups
			where 		tenant_no=@TENANT_NO 
				and 	company_no =@COMPANY_NO  
				and 	department_no =@DEPARTMENT_NO  
			
			
		</sql>
	</report-dataset>




	<report-dataset name="categorylist">
		<sql>
			SELECT 
						item_report_category_cd 
						,item_report_category_nm	
						,coalesce(use_customer_group,0) use_customer_group
			FROM 		item_report_categories
			where 		tenant_no=@TENANT_NO 
				and 	company_no =@COMPANY_NO  
				and 	department_no =@DEPARTMENT_NO  
			
			
		</sql>
	</report-dataset>




</report>
