<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"
              xmlns:xrbc="clr-namespace:CodeReason.Reports.Document.Barcode;assembly=CodeReason.Reports"
             PageHeight="21cm" PageWidth="14.9cm" ColumnWidth="21cm">
    <xrd:ReportProperties>
    </xrd:ReportProperties>
    <xrd:SectionReportHeader PageHeaderHeight="23" Padding="20,40,0,0" FontSize="12">
    <Table Name="BillPageNumber" CellSpacing="0" Margin="0">
          <Table.Columns>
              <TableColumn Width="550" />
          </Table.Columns> 
             <TableRowGroup>
              <!--<TableRow>
                  <TableCell Padding="0,0,0,0">
                      <Paragraph TextAlignment="Left" FontSize="11" FontFamily="Roman PS">PAGE
                          <xrd:InlineContextValue PropertyName="PageNumber" /> OF
                          <xrd:InlineContextValue PropertyName="PageCount" />
                      </Paragraph>
                  </TableCell>
                  <TableCell Padding="0,0,0,0">
                      <Paragraph TextAlignment="Right" FontSize="11" FontFamily="Roman PS">
                          <xrd:InlineContextValue PropertyName="Reporttitle" />
                      </Paragraph>
                  </TableCell>
              </TableRow>-->
              </TableRowGroup>
        </Table>
    <Table Name="BillHeader"  CellSpacing="0" Margin="0">
          <Table.Columns>
              <TableColumn Width="*" />
              <TableColumn Width="*" />
          </Table.Columns>
          <TableRowGroup>
              
              <TableRow>
                  <TableCell>
                      <Paragraph TextAlignment="Center" FontSize="14" FontWeight="Bold" FontFamily="Draft 10cpi"> 
                       <xrd:InlineDocumentValue PropertyName="FirmName" />
                      </Paragraph>
                  </TableCell>
              </TableRow>
              <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Center" FontSize="14" FontFamily="Times New Roman">
                            <xrd:InlineDocumentValue PropertyName="DoorNo" />,
                            <xrd:InlineDocumentValue PropertyName="Street" />,
                            <xrd:InlineDocumentValue PropertyName="City" />,
                            
                        </Paragraph>
                    </TableCell>                   
                </TableRow>
                  <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Center" FontSize="14" FontFamily="Times New Roman">
                           
                            <xrd:InlineDocumentValue PropertyName="District" />,
                            <xrd:InlineDocumentValue PropertyName="State" />,Pin:
                            <xrd:InlineDocumentValue PropertyName="PinCode" /> 
                        </Paragraph>
                    </TableCell>                   
                </TableRow>
                <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Center" FontSize="14" FontFamily="Times New Roman">GSTIN :
                           
                           <xrd:InlineDocumentValue PropertyName="GSTIN" />
                        </Paragraph>
                    </TableCell>                   
                </TableRow>
                   <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Center" FontSize="12" FontFamily="Times New Roman"> GOODS AND SERVICES TAX INVOICE RULES - FORM GST INV-1
                        </Paragraph>
                    </TableCell>
                </TableRow>
          </TableRowGroup>
       </Table>
    <Table Name="BillCustomerDet" Margin="0" CellSpacing="0" BorderBrush="Black" BorderThickness="0,1,0,0">
          <Table.Columns>
              <TableColumn Width="350" />
              <TableColumn Width="150" />  
          </Table.Columns>
          <TableRowGroup>
              <TableRow>
               <TableCell>
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi"> 
                      <TextBlock TextTrimming="CharacterEllipsis">CUSTOMER :
                            <xrd:InlineDocumentValue PropertyName="MCustname" />
                          </TextBlock>
                      </Paragraph>
                  </TableCell>
                   
                   <TableCell BorderThickness="0,0,0,1">
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi" Padding="0,0,0,0"> INV NO.:
                          <xrd:InlineDocumentValue PropertyName="MSeries" /> 
                          <xrd:InlineDocumentValue PropertyName="MVno" />
                      </Paragraph>
                  </TableCell>
               
                   </TableRow>
                    <TableRow>
                  <TableCell>
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi"> Address :
                      <TextBlock TextTrimming="CharacterEllipsis">
                        <xrd:InlineDocumentValue PropertyName="MAdd1" />,
                          <xrd:InlineDocumentValue PropertyName="MAdd2" />,
                          <xrd:InlineDocumentValue PropertyName="MAdd3" />  
                          </TextBlock>
                      </Paragraph>
                  </TableCell>
                   <TableCell>
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">INV DATE :
                          <xrd:InlineDocumentValue PropertyName="MBillDate" />
                      </Paragraph>
                  </TableCell>
                  </TableRow>
                   <TableRow>
                  <TableCell>
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi"> Mob :
                         <xrd:InlineDocumentValue PropertyName="MMobile" />  
                       </Paragraph>
                  </TableCell>
                   <TableCell>
                      <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">GSTIN :
                           <xrd:InlineDocumentValue PropertyName="MGSTIN" />  
                      </Paragraph>
                  </TableCell>
                  </TableRow>
          </TableRowGroup>
      </Table>
         <Table Name="ItemHeaders" CellSpacing="0" BorderBrush="Black" BorderThickness="1,1,1,1">
            <Table.Resources>
                <!-- Style for header/footer rows. 
                <Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontWeight" Value="DemiBold"/>
                    <Setter Property="FontSize" Value="13"/>
                    <Setter Property="FontFamily" Value="Times New Roman"/>
                    
                    <Setter Property="Background" Value="LightGray" FontFamily="Arial"/>
                </Style>

                Style for data rows. -->
                <Style x:Key="dataRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontFamily" Value="Times New Roman"/>
                    <Setter Property="FontSize" Value="13"/>
                    
                </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.00cm"/>
                   
                 </Style>-->
            </Table.Resources>
         <Table.Columns>
               <TableColumn Width="25.0" />
                <TableColumn Width="160.0"/>             
                <TableColumn Width="55.0" />
                <TableColumn Width="75.0" />
                <TableColumn Width="75.0" />
                <TableColumn Width="40.0" />
                <TableColumn Width="65.0" />
            
           </Table.Columns>
           <TableRowGroup Style="{StaticResource dataRowStyle}">
                <TableRow>
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Center">SN
                        </Paragraph>
                    </TableCell>
                                  
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">                    
                        <Paragraph TextAlignment="Center">ITEM NAME
                        </Paragraph>                        
                    </TableCell>
                 
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Center">QTY
                        </Paragraph>
                   </TableCell>
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Center">RATE
                        </Paragraph>
                    </TableCell>
                    
                      <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                      <Paragraph TextAlignment="Center">TAXABLE
                      </Paragraph>
                  </TableCell>
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Center">GST%
                        </Paragraph>
                    </TableCell>
                     <TableCell BorderBrush="Black" BorderThickness="0,0,0,0">
                      <Paragraph TextAlignment="Center">TOTAL
                      </Paragraph>
                  </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
    </xrd:SectionReportHeader>    
   <xrd:DocumentFooter DocumentFooterHeight="20" Padding="20,0,0,20" FontSize="12" FontFamily="Draft 10cpi">
               <Table Name="ItemTotals" Margin="0,0,20,0" CellSpacing="0" BorderBrush="Black" BorderThickness="0,1,0,0">
            <Table.Columns>
                        
                <TableColumn Width="240.0" />
                <TableColumn Width="150.0" />
               <TableColumn Width="105.0" />
            </Table.Columns>
            <TableRowGroup>
                <TableRow>
                 
                    <TableCell>
                            <Paragraph TextAlignment="Right" FontSize="13" FontFamily="Draft 10cpi">
                                <xrd:InlineAggregateValue AggregateGroup="Qty" AggregateValueType="Sum" EmptyValue="0"  />
                            </Paragraph>
                    </TableCell>
                   
                    <TableCell>
                            <Paragraph TextAlignment="Right" FontSize="13" FontFamily="Draft 10cpi">
                            <xrd:InlineDocumentValue PropertyName="MTaxableAmt"/>
                            </Paragraph>
                    </TableCell>
                   
		                <TableCell>
                        <Paragraph TextAlignment="Right" FontSize="13" FontFamily="Draft 10cpi"> 
                           <xrd:InlineAggregateValue AggregateGroup="LineTotal" AggregateValueType="Sum" EmptyValue="0"  />

                        </Paragraph>
                    </TableCell>
                    
		                
                </TableRow>
            </TableRowGroup>
        </Table>
         <Table Name="CGSTsplitup"  Margin="0,0,0,0" Padding="0,0,0,0" CellSpacing="0" BorderBrush="Black" BorderThickness="0,1,0,0">
            <Table.Columns>
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
            </Table.Columns>
            <TableRowGroup>
                
               <TableRow>
                    <TableCell FontWeight="bold">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">CGST 2.5% :     
                        <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST5" />
                        </Paragraph>
                    </TableCell >
                    <TableCell FontWeight="BOLD" Padding="2,0,0,0">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">CGST 6%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST12" />                   
                        </Paragraph>
                     </TableCell>
                     <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">CGST 9%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST18" />                   
                        </Paragraph>
                     </TableCell>
                    <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Right" FontSize="12" FontFamily="Draft 10cpi">CGST 14%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST28" /> 
                        </Paragraph>
                    </TableCell>
                    <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Right" FontSize="12" FontFamily="Draft 10cpi">GST 0%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST0" /> 
                        </Paragraph>
                    </TableCell>
                  
               </TableRow>
                </TableRowGroup>
                </Table>
                <Table Name="SGSTsplitup"  Margin="0,0,0,0" Padding="0,0,0,0" CellSpacing="0" BorderBrush="Black" BorderThickness="0,0,0,0">
            <Table.Columns>
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                <TableColumn Width="99" />
                
            </Table.Columns>
            <TableRowGroup>
                
               <TableRow>
                   <TableCell FontWeight="bold">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">SGST 2.5% :     
                        <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST5" />
                        </Paragraph>
                    </TableCell>
                    <TableCell FontWeight="BOLD" Padding="2,0,0,0">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">SGST 6%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST12" />                   
                        </Paragraph>
                     </TableCell>
                     <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">SGST 9%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST18" />                   
                        </Paragraph>
                     </TableCell>
                    <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Right" FontSize="12" FontFamily="Draft 10cpi">SGST 14%:
                            <xrd:InlineDocumentValue PropertyName="OUTPUTCGSTONSALESGST28" /> 
                        </Paragraph>
                    </TableCell>
                    <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Right" FontSize="12" FontFamily="Draft 10cpi">Cess 1%:
                        <xrd:InlineDocumentValue PropertyName="OUTPUTCESSONSALESCESS1" />
                        </Paragraph>
                    </TableCell>
               </TableRow>
                </TableRowGroup>
                </Table>
        <Table Name="LedgerTotals"  Margin="0,0,0,0" Padding="0,0,0,0" CellSpacing="0" BorderBrush="Black" BorderThickness="0,1,0,1">
         <Table.Columns>
                 <TableColumn Width="250" />
              <TableColumn Width="250" />
            </Table.Columns>
            <TableRowGroup>
               <TableRow>                            
                <TableCell FontWeight="BOLD">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">TOTAL:
                            <xrd:InlineDocumentValue PropertyName="AmountInWords" />
                        </Paragraph>
                    </TableCell>  
                  <TableCell>
                        <Paragraph TextAlignment="Right" FontSize="15" FontFamily="Draft 10cpi" FontWeight="Bold"> GRAND TOTAL :
                            <xrd:InlineDocumentValue PropertyName="MGrandTotal" />
                        </Paragraph>
                    </TableCell> 
               </TableRow>
            </TableRowGroup>  
        </Table>
       <Table Name="BillDeclaration" Margin="0" Padding="0,0,0,0" CellSpacing="0">
            <Table.Columns>
                <TableColumn Width="495" />
                <TableColumn Width="*" />
            </Table.Columns>
            <TableRowGroup>
                <!--<TableRow>
                    <TableCell BorderThickness="0,1,0,0">
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi"><Bold>WARRANTY:</Bold>On the strength of the warranty issued to us by our suppliers we hereby certify that the food/foods mentioned in this invoice
is/are warranted to be of the nature and quality which it/these purport/purports to be
 
                        </Paragraph>
                    </TableCell>
                </TableRow>-->
                <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi"><Bold>Declaration:</Bold> Certified that all particulars shown in the above tax invoice are true and correct.
                        </Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
        <Table Name="BillSignatory" Margin="0" Padding="0,0,0,0" CellSpacing="0">
            <Table.Columns>
                <TableColumn Width="160" />
                <TableColumn Width="150" />
                <TableColumn Width="175" />
            </Table.Columns>
            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Left" FontSize="12" FontFamily="Draft 10cpi">
                        </Paragraph>
                    </TableCell>
                </TableRow>                
                <TableRow>
                    <TableCell>
                        <Paragraph TextAlignment="Left" FontSize="14" FontFamily="Draft 10cpi">Received in good condition
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Left" FontSize="14" FontFamily="Draft 10cpi">Party Signature
                        </Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextAlignment="Left" FontSize="14" FontFamily="Draft 10cpi">For :
                            <xrd:InlineDocumentValue PropertyName="FirmName" />
                        </Paragraph>
                    </TableCell>                    
                </TableRow>
            </TableRowGroup>
        </Table>
       
   </xrd:DocumentFooter>
     <Section Padding="2,10,0,0" FontSize="14" BreakPageBefore="True">
       <Table CellSpacing="0" Margin="0" BorderBrush="Black" Padding="0,0,0,0" BorderThickness="1,1,1,1">
            <Table.Resources>
                <!-- Style for header/footer rows. -->
                <Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontWeight" Value="DemiBold"/>
                    <Setter Property="FontSize" Value="13"/>
                    <Setter Property="FontFamily" Value="Times New Roman"/>
                    
                    <!--<Setter Property="Background" Value="LightGray" FontFamily="Arial"/>-->
                </Style>

                <!-- Style for data rows. -->
                <Style x:Key="dataRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontFamily" Value="Times New Roman"/>
                    <Setter Property="FontSize" Value="13"/>
                    
                </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.00cm"/>
                   
                 </Style>
            </Table.Resources>
           <Table.Columns>
               <TableColumn Width="25.0" />
                <TableColumn Width="160.0"/>             
                <TableColumn Width="55.0" />
                <TableColumn Width="75.0" />
                <TableColumn Width="75.0" />
                <TableColumn Width="40.0" />
                <TableColumn Width="65.0" />
                 
             
            </Table.Columns>           
            <TableRowGroup Style="{StaticResource dataRowStyle}"> 
                <xrd:TableRowForDataTable TableName="BillItemDet">
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Right">
                            <xrd:InlineTableCellValue PropertyName="Slno" />
                        </Paragraph>
                    </TableCell>
                  
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                    <Paragraph >
                        <TextBlock TextTrimming="CharacterEllipsis"
                        TextAlignment="Left" >
                            <xrd:InlineTableCellValue PropertyName="ItemName" />                       
                        </TextBlock>
                   </Paragraph>
                    </TableCell>
                 
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Right" >
                            <xrd:InlineTableCellValue PropertyName="Qty" AggregateGroup="Qty"/>
                        </Paragraph>
                    </TableCell>
                  
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Right">
                            <xrd:InlineTableCellValue PropertyName="InputRate" />
                        </Paragraph>
                    </TableCell>
                      <TableCell  BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Right">
                            <xrd:InlineTableCellValue PropertyName="Taxable" />
                        </Paragraph>
                    </TableCell>
                    <TableCell BorderBrush="Black" BorderThickness="0,0,1,0">
                        <Paragraph TextAlignment="Right">
                            <xrd:InlineTableCellValue PropertyName="Taxper" />
                        </Paragraph>
                    </TableCell>
                   <TableCell>
                        <Paragraph TextAlignment="Right">
                         <xrd:InlineTableCellValue PropertyName="LineTotal" AggregateGroup="LineTotal"/>
                            
                        </Paragraph>
                    </TableCell>
                 
                </xrd:TableRowForDataTable>
            </TableRowGroup>
        </Table>
    </Section>
</FlowDocument>

