<UserControl x:Class="BeWo.View.Report.Finance.OutstandingReceivablesListViewItem" 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" mc:Ignorable="d">
	<UserControl.Resources>
		<DataTemplate x:Key="AccountingTransactionItem">
			<Grid Margin="0,1">
				<Border x:Name="ItemBorder" CornerRadius="2" MinHeight="24" Background="#FFFFFFFF">
					<Border.OpacityMask>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#A0000000" Offset="0" />
							<GradientStop Color="#B0000000" Offset="1" />
						</LinearGradientBrush>
					</Border.OpacityMask>

				</Border>
				<Border x:Name="ItemContent" CornerRadius="2" MinHeight="24">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="70" />
							<ColumnDefinition Width="70" />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>
						<Label Grid.Column="0" Content="{Binding BookingDate, Converter={StaticResource DateConverter}}" />
						<Label Grid.Column="1" Content="{Binding Amount, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:n}'}" HorizontalAlignment="Right" Margin="3,0,0,0" />
						<Label Grid.Column="2" Content="{Binding Category}" Margin="3,0,0,0" />
						<Label Grid.Column="3" Content="{Binding Notice}" Margin="3,0,0,0" />
					</Grid>

				</Border>
			</Grid>

		</DataTemplate>

	</UserControl.Resources>
	<Expander HorizontalAlignment="Stretch" IsExpanded="False" Style="{StaticResource analysisExpander}">
		<Expander.Header>
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="150" />
					<ColumnDefinition Width="150" />
					<ColumnDefinition Width="85" />
					<ColumnDefinition Width="85" />
					<ColumnDefinition Width="85" />
					<ColumnDefinition Width="*" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<TextBlock TextTrimming="CharacterEllipsis" Text="{Binding CustomerName}" Foreground="White" FontFamily="Microsoft Sans Serif" FontWeight="Bold" FontSize="14" Margin="0,0,0,0" ToolTip="{Binding CustomerName}" />
				<TextBlock Grid.Row="1" Text="{Binding SupportConceptTimeSpanString}" Foreground="#FFD2D2D2" FontFamily="Microsoft Sans Serif" FontSize="12" Margin="0,0,0,1" ToolTip="Hilfeplan Start- und Endzeit" />
				<TextBlock Grid.Column="1" Text="{Binding CostBearerName}" Foreground="White" FontFamily="Microsoft Sans Serif" FontSize="14" Margin="5,0,0,0" ToolTip="{Binding CostBearerName, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}Kostenträger {0}'}" />
				<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding DaysOverrun}" Foreground="White" FontFamily="Microsoft Sans Serif" FontSize="12" Margin="5,0,0,0" ToolTip="anz Tage seit Ablauf des Hilfeplans" />
				<!--<TextBlock Grid.Column="1" Text="{Binding ReferenceNumber}" Foreground="White" FontFamily="Microsoft Sans Serif"  FontSize="14" Margin="5,3,0,0" ToolTip="Aktenzeichen"/>-->
                
				<!--<TextBlock Grid.RowSpan="2" Grid.Column="2" Text="{Binding SupportConceptTimeSpanString}" Foreground="White" FontFamily="Microsoft Sans Serif"  FontSize="14" Margin="5,3,0,0" ToolTip="Hilfeplan Start- und Endzeit"/>-->
                
				<TextBlock Grid.RowSpan="2" Grid.Column="2" Text="{Binding TotalAmountString}" Foreground="White" FontWeight="Bold" FontFamily="Microsoft Sans Serif" FontSize="14" Margin="5,0,0,0" ToolTip="Gesamtforderungen" HorizontalAlignment="Right" VerticalAlignment="Center" />
				<TextBlock Grid.RowSpan="2" Grid.Column="3" Text="{Binding PaidAmountString}" Foreground="#FF3CC83C" FontWeight="Bold" FontFamily="Microsoft Sans Serif" FontSize="14" Margin="5,0,0,0" ToolTip="Bereits gezahlt" HorizontalAlignment="Right" VerticalAlignment="Center" />
				<TextBlock Grid.RowSpan="2" Grid.Column="4" Text="{Binding OpenAmountString}" Foreground="{Binding OpenAmountForegroundBrush}" FontWeight="Bold" FontFamily="Microsoft Sans Serif" FontSize="14" Margin="5,0,0,0" ToolTip="Offene Forderungen" HorizontalAlignment="Right" VerticalAlignment="Center" />
				<localView:PercentageDisplay Grid.RowSpan="2" Grid.Column="5" Height="20" Percentage="{Binding PaidAmountPercentage}" Margin="5,0,0,0" />
				<Button Grid.Column="6" Grid.RowSpan="2" Width="23" Height="23" Style="{DynamicResource TransparentButtonStyle}" ToolTip="Neue Buchung erstellen" Tag="{Binding}" Click="ButtonOpenBookingView_Click" Margin="5,0,-5,0">
					<Image Source="..\..\..\Ressources\Icons\CoinsDisabled.png" />
				</Button>
			</Grid>

		</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 AccountingTransactionItem}" ItemsSource="{Binding AccountingTransactions}" />
	</Expander>

</UserControl>