<UserControl x:Class="BeWo.View.Detail.Report.SupportConceptAnalysisListViewItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:localCore="clr-namespace:BeWo.Core" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:bewo="clr-namespace:BeWo" mc:Ignorable="d">
	<UserControl.Resources>
		<DataTemplate x:Key="CostBearerAnalysisListItem">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				<Expander Margin="10 0 0 0" IsExpanded="False" Style="{StaticResource analysisExpander}" HorizontalAlignment="Stretch" Collapsed="Expander_Collapsed">
					<Expander.Header>
						<Grid HorizontalAlignment="Stretch">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
							<StackPanel Orientation="Horizontal">
								<Label Foreground="White" Content="{Binding CostBearer}" />
								<Label Foreground="White" Content="{Binding HeaderString}" />
							</StackPanel>
							<Button Grid.Column="1" Width="23" Height="23" Style="{DynamicResource TransparentButtonStyle}" ToolTip="In Zeiterfassung öffnen" Tag="{Binding}" Click="ButtonOpenServiceRecordView_Click" Margin="0,0,0,0">
								<Image Source="..\..\..\Ressources\Icons\HistoryDisabled.png" />
							</Button>
						</Grid>
					</Expander.Header>
					<Grid Grid.Row="1" Margin="20 0 0 0" HorizontalAlignment="Stretch">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<GroupBox>
							<GroupBox.Header>
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="*" />
									</Grid.ColumnDefinitions>
									<TextBlock Text="Dauer" VerticalAlignment="Center" />
									<localView:PercentageDisplay Height="16" Margin="3" Percentage="{Binding DurationPercentage}" Grid.Column="1" />
								</Grid>
							</GroupBox.Header>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<Label FontStyle="Italic" Grid.Row="0" Content="Start:" />
								<Label FontStyle="Italic" Grid.Row="1" Content="Ende:" />
								<Label FontStyle="Italic" Grid.Row="2" Content="Wochen gesamt:" />
								<Label FontStyle="Italic" Grid.Row="3" Content="Wochen verbleibend:" />
								<Label Grid.Row="0" Grid.Column="1" Content="{Binding ApprovedStartDate, Converter={StaticResource DateConverter}}" />
								<Label Grid.Row="1" Grid.Column="1" Content="{Binding ApprovedEndDate, Converter={StaticResource DateConverter}}" />
								<Label Grid.Row="2" Grid.Column="1" Content="{Binding WeeksTotal, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<Label Grid.Row="3" Grid.Column="1" Content="{Binding OpenWeeks, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
							</Grid>
						</GroupBox>
						<GroupBox Grid.Column="1">
							<GroupBox.Header>
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="*" />
									</Grid.ColumnDefinitions>
									<TextBlock Text="Leistungen" VerticalAlignment="Center" />
									<localView:PercentageDisplay Height="16" Margin="3" Percentage="{Binding BERecordedTillNowInPercent}" Grid.Column="1" />
								</Grid>
							</GroupBox.Header>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<TextBlock Margin="3" FontStyle="Italic" Text="{Binding Unit, StringFormat=Bewilligte {0}/Woche:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="1" Text="{Binding Unit, StringFormat=Bewilligte {0} gesamt:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="2" Text="{Binding Unit, StringFormat=Abrechenbare {0}:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="3" Text="{Binding Unit, StringFormat=Restliche {0}/Woche:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="4" Text="{Binding Unit, StringFormat=Restliche {0} Gesamt:}" />
								<TextBlock Margin="3" Grid.Row="0" Grid.Column="1" Text="{Binding BEApprovedPerWeek, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="1" Grid.Column="1" Text="{Binding BEApprovedSum, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="2" Grid.Column="1" Text="{Binding BERecordedAndBilled, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="3" Grid.Column="1" Text="{Binding BEOpenPerWeek, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="4" Grid.Column="1" Text="{Binding BEOpen, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
							</Grid>
						</GroupBox>
						<GroupBox Grid.Column="2">
							<GroupBox.Header>
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="*" />
									</Grid.ColumnDefinitions>
									<TextBlock Text="Soll/Ist" VerticalAlignment="Center" />
									<localView:PercentageDisplay Percentage="{Binding BEDifferenceApprovedRecordedTillNowInPercent}" Height="16" Margin="3" Grid.Column="1" />
								</Grid>
							</GroupBox.Header>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="0" Text="{Binding Unit, StringFormat=Bis Dato bewilligte {0}:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="1" Text="{Binding Unit, StringFormat=Bis Dato erbrachte {0}:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="2" Text="{Binding Unit, StringFormat=Über-/Untererbringung [{0}]:}" />
								<TextBlock Margin="3" FontStyle="Italic" Grid.Row="3" Text="Über-/Untererbringung [%]:" />
                                <TextBlock x:Name="PassageText" Margin="3" FontStyle="Italic" Grid.Row="4" Text="{Binding PassageStatus}" Foreground="{Binding PassageStatusColor}" Visibility="{Binding Converter={StaticResource ClientType2VisibilityConverter}, ConverterParameter=9}" />
								<TextBlock Margin="3" Grid.Row="0" Grid.Column="1" Text="{Binding BEApprovedTillNow, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="1" Grid.Column="1" Text="{Binding BERecordedTillNow, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="2" Grid.Column="1" Text="{Binding BEDifferenceApprovedRecordedTillNow, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
								<TextBlock Margin="3" Grid.Row="3" Grid.Column="1" Text="{Binding BEDifferenceApprovedRecordedTillNowInPercent, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.00}'}" />
							</Grid>
						</GroupBox>
					</Grid>
				</Expander>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>
	<Expander HorizontalAlignment="Stretch" IsExpanded="True" Style="{StaticResource analysisExpander}">
		<Expander.Header>
			<TextBlock Text="{Binding Key}" Foreground="White" FontFamily="Microsoft Sans Serif" FontWeight="Bold" FontSize="15" />
		</Expander.Header>
		<ListView Background="Transparent" SelectionChanged="listview_SelectionChanged" HorizontalContentAlignment="Stretch" ScrollViewer.CanContentScroll="False" HorizontalAlignment="Stretch" BorderThickness="0" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Disabled" Name="listview" ItemTemplate="{StaticResource CostBearerAnalysisListItem}" ItemsSource="{Binding Value}" />
	</Expander>
</UserControl>