<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:xrd="clr-namespace:CodeReason.Reports.Document;assembly=CodeReason.Reports"
              PageHeight="29.7cm" PageWidth="10cm" ColumnWidth="10cm">
    <xrd:ReportProperties FontSize="14" FontStyle="Italic" FontWeight="Bold">
        <xrd:ReportProperties.ReportName>Factura</xrd:ReportProperties.ReportName>
        <xrd:ReportProperties.ReportTitle>Factura - </xrd:ReportProperties.ReportTitle>
    </xrd:ReportProperties>
    <xrd:SectionReportHeader PageHeaderHeight="9" Padding="5,5,5,0" FontSize="10">
        <Table CellSpacing="0">
            <Table.Columns>
                <TableColumn Width="*" />
                <TableColumn Width="*" />
            </Table.Columns>
            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph>
                            <xrd:InlineContextValue PropertyName="ReportTitle" />
                            <xrd:InlineDocumentValue PropertyName="ReportNumber" />
                            <xrd:InlineDocumentValue PropertyName="DataFactura" Format="dd.MM.yyyy" />
                        </Paragraph>
                    </TableCell>
                </TableRow>
                <TableRow>
                    <TableCell>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph>
                            <xrd:InlineDocumentValue PropertyName="DenumireEmitator" />
                            <xrd:InlineDocumentValue PropertyName="JEmitator" />
                            <xrd:InlineDocumentValue PropertyName="CIFEmitator" />
                            <xrd:InlineDocumentValue PropertyName="AdresaEmitator" />
                            <xrd:InlineDocumentValue PropertyName="TelefonEmitator" />
                        </Paragraph>
                    </TableCell>
                </TableRow>
                <TableRow>
                    <TableCell>
                        <Paragraph FontSize="10" FontWeight="SemiBold" TextAlignment="Right" Margin="5">
                            Date client:
                            <xrd:InlineDocumentValue PropertyName="DenumireClient" />
                            <xrd:InlineDocumentValue PropertyName="CUIClient" />
                            <xrd:InlineDocumentValue PropertyName="JClient" />
                            <!--<xrd:InlineDocumentValue PropertyName="ComentariiClient" />-->
                        </Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
    </xrd:SectionReportHeader>
    <xrd:SectionReportFooter PageFooterHeight="2" Padding="5,5,5,0" FontSize="10">
        <Table CellSpacing="0">
            <Table.Columns>
                <TableColumn Width="*" />
                <TableColumn Width="*" />
            </Table.Columns>
            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph>
                            <Image Tag="ARISTARCHsoftwareLOGO-300x111.jpg" Height="0.5cm" />
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <!--<Paragraph TextAlignment="Right">
                            Page
                            <xrd:InlineContextValue PropertyName="PageNumber" FontWeight="Bold" /> of
                            <xrd:InlineContextValue PropertyName="PageCount" FontWeight="Bold" />
                        </Paragraph>-->
                    </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
    </xrd:SectionReportFooter>
    <Section Padding="14" FontSize="10" BreakPageBefore="True">
        <Paragraph FontSize="16" FontWeight="Bold" TextAlignment="Center">
            <xrd:InlineDocumentValue PropertyName="DenumireEmitator" />
        </Paragraph>
        <Table CellSpacing="0" BorderBrush="Black" BorderThickness="0.02cm">
            <Table.Resources>
                <!-- Style for header/footer rows. -->
                <Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontWeight" Value="DemiBold"/>
                    <Setter Property="FontSize" Value="10"/>
                    <Setter Property="Background" Value="LightGray"/>
                </Style>

                <!-- Style for data rows. -->
                <Style x:Key="dataRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontSize" Value="10"/>
                </Style>

                <!-- Style for data cells. -->
                <Style TargetType="{x:Type TableCell}">
                    <Setter Property="Padding" Value="0.1cm"/>
                    <Setter Property="BorderBrush" Value="Black"/>
                    <Setter Property="BorderThickness" Value="0.01cm"/>
                </Style>
            </Table.Resources>

            <Table.Columns>
                <TableColumn Width="1.5*" />
                <TableColumn Width="0.5*" />
                <TableColumn Width="0.5*" />
                <TableColumn Width="0.6*" />
            </Table.Columns>
            <TableRowGroup Style="{StaticResource headerFooterRowStyle}">
                <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Center">
                            <Bold>Denumire produs</Bold>
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Center">
                            <Bold>Pret</Bold>
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Center">
                            <Bold>Cantitate</Bold>
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Center">
                            <Bold>Total produs</Bold>
                        </Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
            <TableRowGroup Style="{StaticResource dataRowStyle}">
                <xrd:TableRowForDataTable TableName="DetaliiProduse">
                    <TableCell>
                        <Paragraph>
                            <xrd:InlineTableCellValue PropertyName="DenumireProdus" />
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>
                            <xrd:InlineTableCellValue PropertyName="Pret" />
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>
                            <xrd:InlineTableCellValue PropertyName="Cantitate" />
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Center">
                            <xrd:InlineTableCellValue PropertyName="TotalProdus" AggregateGroup="ItemCount"/>
                        </Paragraph>
                    </TableCell>
                </xrd:TableRowForDataTable>
            </TableRowGroup>
        </Table>
        <Paragraph TextAlignment="Right">
            Total fara TVA:
            <xrd:InlineDocumentValue PropertyName="TotalFaraTVA" FontSize="12" FontWeight="SemiBold" />
            TVA:
            <xrd:InlineDocumentValue PropertyName="TVA" FontSize="12" FontWeight="SemiBold" />
            Total de plata:
            <xrd:InlineDocumentValue PropertyName="TotalDePlata" FontSize="12" FontWeight="SemiBold" />
        </Paragraph>
        <Paragraph Margin="0,15,0,0" FontSize="12">
            Intocmit de:
        </Paragraph>
        <Paragraph Margin="0,5,0,0" FontSize="12">
            CNP:
        </Paragraph>
        <Paragraph Margin="0,5,0,0" FontSize="12">
            Numele delegatului:
        </Paragraph>
        <Paragraph Margin="0,5,0,0" FontSize="12">
            BI/CI:
        </Paragraph>
        <Paragraph Margin="0,5,0,0" FontSize="12">
            Expedierea s-a efectuat in prezenta noastra la data de:.................
        </Paragraph>
        <Paragraph Margin="0,3,0,0" FontSize="12">
            ora:.................
        </Paragraph>
        <Paragraph Margin="0,10,0,0" FontSize="12">
            Semnaturile:
        </Paragraph>
        <Paragraph Margin="0,18,0,0" FontSize="12">
            Semnatura si stampila furnizor:
        </Paragraph>
    </Section>
</FlowDocument>

