﻿<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" DoublePass="true" StartReportEvent="_StartReport" ReportInfo.Created="09/27/2013 16:01:23" ReportInfo.Modified="08/03/2015 14:36:42" ReportInfo.CreatorVersion="1.6.57.0">
  <ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;

namespace FastReport
{
  public class ReportScript
  {

    int decimalValue = 0;
    bool showDiscount = false;
    int zeroRatedItemsFound = 0;
    bool isVatRegistered = false;
    
    private void _StartReport(object sender, EventArgs e)
    {
      //Style      
      string stylePath = Report.GetParameterValue(&quot;MainAppPath&quot;).ToString() + &quot;\\Resources\\DocStyles\\Styles\\&quot; +
        Report.GetColumnValue(&quot;companies.InvoiceStylePath&quot;).ToString();
      if (stylePath.Length &gt; 0)
      {
        picStyle.ImageLocation = stylePath; 
        
      }
             
      //Logo
      string logoPath = Report.GetColumnValue(&quot;companies.LogoPath&quot;).ToString();
      if (logoPath.Length &gt; 0)
      {         
        picLogo.ImageLocation = Report.GetParameterValue(&quot;MainAppPath&quot;).ToString() + &quot;\\Resources\\Logos\\&quot; + logoPath;
        picLogo.Printable = true; 
      }
      else
      {
        picLogo.Printable = false;
      }
              
      
      //Qty Column format      
      decimalValue = Convert.ToInt32(Report.GetColumnValue(&quot;programs_config.QtyDecimalValue&quot;));
      
      //Show Discount      
      if (Report.GetColumnValue(&quot;programs_config.ShowDiscountOnPurchaseDocument&quot;).ToString() == &quot;1&quot;)
        showDiscount = true;      
      HeaderDefault.Visible = !showDiscount;
      DataDefault.Visible = !showDiscount;
      HeaderDiscount.Visible = showDiscount;
      DataDiscount.Visible = showDiscount;
      txtTotLines.Visible = !showDiscount;
      txtTotLinesD.Visible = showDiscount;
      txtTotQty.Visible = !showDiscount;
      txtTotQtyD.Visible = showDiscount;   
      
      //Is VatRegistered
      if (Report.GetColumnValue(&quot;companies.VATno&quot;).ToString().Length &gt; 0)
        isVatRegistered = true;
      
    }
    
    
    private void PageHeader1_AfterData(object sender, EventArgs e)
    {
      //Print the Delivery Address
      if (Report.GetColumnValue(&quot;trans.DeliveryAddress&quot;).ToString().Length == 0)
      {
        shpDelAddress.Visible = false;
        txtDelAddress1.Visible = false;
        txtDelAddress2.Visible = false;  
      }
             
      //Print the User
      if (Report.GetColumnValue(&quot;trans.User&quot;).ToString().Length == 0)
      {
        lblUser.Visible = false;
        txtUser.Visible = false;  
      }
    }
    
    
    private void Child1_AfterData(object sender, EventArgs e)
    {
      if (txtCustomText1.Text.Length &gt; 0)
      {
        txtCustomText1.Visible = true;
        txtCustomLabel1.Visible = true;
      }      
      if (txtCustomText2.Text.Length &gt; 0)
      {
        txtCustomText2.Visible = true;
        txtCustomLabel2.Visible = true;
      }
      if (txtCustomText3.Text.Length &gt; 0)
      {
        txtCustomText3.Visible = true;
        txtCustomLabel3.Visible = true;
      }
      if (txtCustomText4.Text.Length &gt; 0)
      {
        txtCustomText4.Visible = true;
        txtCustomLabel4.Visible = true;
      }
      if (txtCustomText5.Text.Length &gt; 0)
      {
        txtCustomText5.Visible = true;
        txtCustomLabel5.Visible = true;
      }
      if (txtCustomText6.Text.Length &gt; 0)
      {
        txtCustomText6.Visible = true;
        txtCustomLabel6.Visible = true;
      }
      
    }

    
    

    private void Data1_AfterData(object sender, EventArgs e)
    {
       
      //Zero Rated marker      
      if (Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalVAT&quot;)) == 0 
        &amp; Report.GetColumnValue(&quot;trans_items.ProductCode&quot;).ToString().Length &gt; 0
        &amp; isVatRegistered)
      {
        txtZeroRated.Text = &quot;*&quot;;
        txtZeroRatedD.Text = &quot;*&quot;;
        zeroRatedItemsFound++;
      }
      else
      {
        txtZeroRated.Text = string.Empty;
        txtZeroRatedD.Text = string.Empty;
      }
      
      
      if (!showDiscount) //Only do this when showing the default header and data
      {
        //Include when items were sold with a zero qty
        decimal qty = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.Qty&quot;));
        decimal unitPrice = 0;
        decimal total = 0;
        if (qty != 0)
        {
          //Total          
          if (String.Compare(Report.GetColumnValue(&quot;suppliers.TaxOnInvoice&quot;).ToString(), &quot;inclusive&quot;, true) == 0)
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalIncl&quot;)); 
          else
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalExcl&quot;));          
          
          //Unit Price
          unitPrice = (total / qty); 
        }
        //exclude notes
        if (Report.GetColumnValue(&quot;trans_items.ProductCode&quot;).ToString().Length &gt; 0)
        {
          txtQty.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qty);
          txtItemPrice.Text = unitPrice.ToString(&quot;# ### ###.00&quot;);
          txtItemTotal.Text = total.ToString(&quot;# ### ###.00&quot;);
        }
      } 
      
    }

    
    private void DataDiscount_AfterData(object sender, EventArgs e)
    {
      
      //Zero Rated marker      
      if (Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalVAT&quot;)) == 0 
        &amp; Report.GetColumnValue(&quot;trans_items.ProductCode&quot;).ToString().Length &gt; 0
        &amp; isVatRegistered)
      {
        txtZeroRated.Text = &quot;*&quot;;
        txtZeroRatedD.Text = &quot;*&quot;;
        zeroRatedItemsFound++;
      }
      else
      {
        txtZeroRated.Text = string.Empty;
        txtZeroRatedD.Text = string.Empty;
      }
      
      
      if (showDiscount) //Only do this when configured to show the discount
      {
        //Include when items were sold with a zero qty
        decimal qty = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.Qty&quot;));
        decimal unitPrice = 0;
        decimal total = 0;
        decimal discount = 0;
        decimal priceBeforeDiscount = 0;
        
        if (qty != 0)
        {
          //Total
          if (String.Compare(Report.GetColumnValue(&quot;suppliers.TaxOnInvoice&quot;).ToString(), &quot;inclusive&quot;, true) == 0)
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalIncl&quot;)); 
          else
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalExcl&quot;));           
          
          //Unit Price
          unitPrice = (total / qty);           
          
          //Discount
          discount = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.Discount&quot;)); 
          
          //Price before discount
          if (discount == 0 | discount == 100)
            priceBeforeDiscount = unitPrice;
          else
            priceBeforeDiscount = unitPrice / (1 - (discount / 100));
        }
        
        //exclude notes
        if (Report.GetColumnValue(&quot;trans_items.ProductCode&quot;).ToString().Length &gt; 0)
        {
          txtQtyD.Text = String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qty);
          txtItemPriceD.Text = priceBeforeDiscount.ToString(&quot;# ### ###.00&quot;);
          txtItemTotalD.Text = total.ToString(&quot;# ### ###.00&quot;);
          txtDiscountD.Text = discount.ToString(&quot;0.##&quot;) + &quot;%&quot;;
        }  
      }
    }
    

    private void PageFooter1_AfterData(object sender, EventArgs e)
    {
      //Total Qty field - format
      decimal qtyVal = 0; 
      if (Decimal.TryParse(txtTotQty.Text, out qtyVal))
      {
        txtTotQty.Text = &quot;Total Qty: &quot; + String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);
      }
      if (Decimal.TryParse(txtTotQtyD.Text, out qtyVal))
      {
        txtTotQtyD.Text = &quot;Total Qty: &quot; + String.Format(&quot;{0:F&quot; + decimalValue + &quot;}&quot;, qtyVal);
      }
      if (zeroRatedItemsFound &gt; 0)
        lblZeroRated.Visible = true;
      
    }

    

    

    
  }
}
</ScriptText>
  <Dictionary>
    <MySqlDataConnection Name="Connection" ConnectionString="rijcmlqAxB5REKUT+dukMQH3sU+xfro0FofBDRUyaCSfcX7GxNGUjye309ffYebJwk+OhpeS4a7rwkxMHL/wX5pA4bBxw==">
      <TableDataSource Name="suppliers" DataType="System.Int32" PropName="clients" Enabled="true" TableName="suppliers" SelectCommand="SELECT * FROM suppliers WHERE ID = 1">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="Name" DataType="System.String"/>
        <Column Name="Email" DataType="System.String"/>
        <Column Name="BillingAddress" DataType="System.String"/>
        <Column Name="ContactNo" DataType="System.String"/>
        <Column Name="SupplierID" DataType="System.UInt32"/>
        <Column Name="BankingDetails" DataType="System.String"/>
        <Column Name="TaxOnInvoice" DataType="System.String"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="LastCashPurchaseDate" DataType="System.DateTime"/>
        <Column Name="LastCashPurchaseReturnDate" DataType="System.DateTime"/>
        <Column Name="LastAccountPurchaseDate" DataType="System.DateTime"/>
        <Column Name="LastDebitNoteDate" DataType="System.DateTime"/>
        <Column Name="LastPaymentDate" DataType="System.DateTime"/>
        <Column Name="LastJournalDate" DataType="System.DateTime"/>
        <Column Name="TotalDue" DataType="System.Decimal"/>
      </TableDataSource>
      <TableDataSource Name="companies" DataType="System.Int32" Enabled="true" TableName="companies" SelectCommand="select * from companies where ID = 4">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="Name" DataType="System.String"/>
        <Column Name="Email" DataType="System.String"/>
        <Column Name="Address" DataType="System.String"/>
        <Column Name="RegNo" DataType="System.String"/>
        <Column Name="VATno" DataType="System.String"/>
        <Column Name="ContactNo" DataType="System.String"/>
        <Column Name="AltNo" DataType="System.String"/>
        <Column Name="FaxNo" DataType="System.String"/>
        <Column Name="CellNo" DataType="System.String"/>
        <Column Name="LogoPath" DataType="System.String"/>
        <Column Name="InvoiceSize" DataType="System.String"/>
        <Column Name="InvoiceStylePath" DataType="System.String"/>
        <Column Name="VATrate" DataType="System.String"/>
        <Column Name="BankingDetails" DataType="System.String"/>
      </TableDataSource>
      <TableDataSource Name="programs_config" DataType="System.Int32" Enabled="true" TableName="programs_config" SelectCommand="SELECT QtyDecimalValue,&#13;&#10;PurchaseCustomLabel1, PurchaseCustomLabel2, PurchaseCustomLabel3,&#13;&#10;PurchaseCustomLabel4, PurchaseCustomLabel5, PurchaseCustomLabel6,&#13;&#10;ShowDiscountOnPurchaseDocument &#13;&#10;FROM programs_config &#13;&#10;WHERE CompanyID = @CompanyID">
        <Column Name="PurchaseCustomLabel1" DataType="System.String"/>
        <Column Name="PurchaseCustomLabel2" DataType="System.String"/>
        <Column Name="PurchaseCustomLabel3" DataType="System.String"/>
        <Column Name="PurchaseCustomLabel4" DataType="System.String"/>
        <Column Name="PurchaseCustomLabel5" DataType="System.String"/>
        <Column Name="PurchaseCustomLabel6" DataType="System.String"/>
        <Column Name="QtyDecimalValue" DataType="System.UInt32"/>
        <Column Name="ShowDiscountOnPurchaseDocument" DataType="System.Byte"/>
        <CommandParameter Name="CompanyID" DataType="254" Expression="[CompanyID]"/>
      </TableDataSource>
      <TableDataSource Name="trans" DataType="System.Int32" PropName="cash_sales" Enabled="true" TableName="trans" SelectCommand="select * from purchase_orders where transID = 1 and companyID = 1">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="Date" DataType="System.DateTime"/>
        <Column Name="ComputerName" DataType="System.String"/>
        <Column Name="SlipNote" DataType="System.String"/>
        <Column Name="Custom1" DataType="System.String"/>
        <Column Name="Custom2" DataType="System.String"/>
        <Column Name="Custom3" DataType="System.String"/>
        <Column Name="Custom4" DataType="System.String"/>
        <Column Name="Custom5" DataType="System.String"/>
        <Column Name="Custom6" DataType="System.String"/>
        <Column Name="TotalExcl" DataType="System.Decimal"/>
        <Column Name="TotalVAT" DataType="System.Decimal"/>
        <Column Name="TotalIncl" DataType="System.Decimal"/>
        <Column Name="TransID" DataType="System.UInt32"/>
        <Column Name="DeliveryAddress" DataType="System.String"/>
        <Column Name="User" DataType="System.String"/>
        <Column Name="SupplierID" DataType="System.UInt32"/>
        <Column Name="SupplierName" DataType="System.String"/>
        <Column Name="RefNo" DataType="System.String"/>
      </TableDataSource>
      <TableDataSource Name="trans_items" DataType="System.Int32" PropName="cash_sales_items" Enabled="true" TableName="trans_items" SelectCommand="select * from purchase_orders_items where relatedID = 1 and companyid = 1">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="ProductID" DataType="System.UInt32"/>
        <Column Name="Date" DataType="System.DateTime"/>
        <Column Name="IsProduct" DataType="System.Byte"/>
        <Column Name="ProductCode" DataType="System.String"/>
        <Column Name="Description" DataType="System.String"/>
        <Column Name="Qty" DataType="System.Decimal"/>
        <Column Name="TotalVAT" DataType="System.Decimal"/>
        <Column Name="RelatedID" DataType="System.UInt32"/>
        <Column Name="SupplierID" DataType="System.UInt32"/>
        <Column Name="TotalExcl" DataType="System.Decimal"/>
        <Column Name="TotalIncl" DataType="System.Decimal"/>
        <Column Name="User" DataType="System.String"/>
        <Column Name="QtyAvailable" DataType="System.Decimal"/>
        <Column Name="OrigUnitPrice" DataType="System.Decimal"/>
        <Column Name="Discount" DataType="System.Decimal"/>
      </TableDataSource>
    </MySqlDataConnection>
    <Relation Name="sales_sales_items" ParentDataSource="null" ChildDataSource="null" ParentColumns="ID" ChildColumns="SalesID" Enabled="true"/>
    <Relation Name="sales_companies" ParentDataSource="null" ChildDataSource="null" ParentColumns="CompanyID" ChildColumns="ID" Enabled="true"/>
    <Parameter Name="MainAppPath" DataType="System.String"/>
    <Parameter Name="CompanyID" DataType="System.Int32"/>
    <Total Name="Total_Qty" Expression="[trans_items.Qty]" Evaluator="DataDefault" PrintOn="PageFooter1" ResetAfterPrint="false"/>
    <Total Name="Total_Lines" TotalType="Count" Evaluator="DataDefault" PrintOn="PageFooter1" ResetAfterPrint="false" EvaluateCondition="[trans_items.Qty] != 0"/>
    <Total Name="Total_QtyD" Expression="[trans_items.Qty]" Evaluator="DataDiscount" PrintOn="PageFooter1" ResetAfterPrint="false"/>
    <Total Name="Total_LinesD" TotalType="Count" Evaluator="DataDiscount" PrintOn="PageFooter1" ResetAfterPrint="false" EvaluateCondition="[trans_items.Qty] != 0"/>
  </Dictionary>
  <ReportPage Name="Page1" RawPaperSize="9">
    <PageHeaderBand Name="PageHeader1" Width="718.2" Height="367.5" AfterDataEvent="PageHeader1_AfterData">
      <PictureObject Name="picStyle" Left="9.45" Width="690.5" Height="112.35" SizeMode="StretchImage"/>
      <ShapeObject Name="Shape2" Left="9.45" Top="245.7" Width="415.8" Height="113.4" Border.Color="LightGray" Border.Width="2" Shape="RoundRectangle"/>
      <TextObject Name="Text3" Left="113.4" Top="255.15" Width="302.4" Height="28.35" Text="[trans.SupplierName]"/>
      <TextObject Name="Text2" Left="557.55" Top="151.2" Width="132.3" Height="18.9" Text="[trans.Date]" Format="Custom" Format.Format="yyyy-MM-dd HH:mm"/>
      <TextObject Name="Text17" Left="463.05" Top="151.2" Width="85.05" Height="18.9" Text="Date:" HorzAlign="Right" TextFill.Color="DimGray"/>
      <TextObject Name="Text9" Left="113.4" Top="283.5" Width="226.8" Height="66.15" Text="[suppliers.BillingAddress]" TextFill.Color="DimGray"/>
      <TextObject Name="Text14" Left="9.45" Top="113.4" Width="680.4" Height="37.8" Text="[companies.Name]" WordWrap="false" Font="Segoe UI Light, 16pt, style=Bold" TextFill.Color="DimGray" Clip="false"/>
      <TextObject Name="Text18" Left="18.9" Top="151.2" Width="170.1" Height="66.15" Text="[companies.Address]" TextFill.Color="DimGray"/>
      <TextObject Name="txtTrans" Left="406.35" Top="37.8" Width="255.15" Height="47.25" Border.Shadow="true" Border.ShadowColor="Transparent" Text="Purchase Order" HorzAlign="Center" Font="Segoe UI Light, 20pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="Text20" Left="21.9" Top="255.15" Width="75.6" Height="47.25" Text="Order From:" Font="Segoe UI Light, 11pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="txtUser" Left="557.55" Top="170.1" Width="132.3" Height="18.9" Text="[trans.User]"/>
      <TextObject Name="lblUser" Left="463.05" Top="170.1" Width="85.05" Height="18.9" Text="User:" HorzAlign="Right" TextFill.Color="DimGray"/>
      <TextObject Name="Text51" Left="18.9" Top="222.35" Width="47.25" Height="18.9" Text="Email:" HorzAlign="Right" Font="Arial, 8pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text52" Left="75.6" Top="222.35" Width="292.95" Height="18.9" Text="[companies.Email]" Font="Arial, 8pt"/>
      <PictureObject Name="picLogo" Left="28.35" Width="283.5" Height="75.6" Printable="false"/>
      <TextObject Name="txtTransNumber" Left="406.35" Top="75.6" Width="255.15" Height="18.9" Text="# [trans.TransID]" HorzAlign="Center" Font="Arial, 12pt"/>
      <TextObject Name="Text44" Left="292.95" Top="151.2" Width="160.65" Height="18.9" Text="[companies.RegNo]" Font="Arial, 9pt"/>
      <TextObject Name="Text45" Left="292.95" Top="170.1" Width="160.65" Height="18.9" Text="[companies.VATno]" Font="Arial, 9pt"/>
      <TextObject Name="Text46" Left="292.95" Top="207.9" Width="160.65" Height="18.9" Text="[companies.AltNo]" Font="Arial, 9pt"/>
      <TextObject Name="Text48" Left="198.45" Top="151.2" Width="85.05" Height="18.9" Text="Reg. No:" HorzAlign="Right" Font="Arial, 9pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text49" Left="198.45" Top="170.1" Width="85.05" Height="18.9" Text="VAT No:" HorzAlign="Right" Font="Arial, 9pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text50" Left="198.45" Top="207.9" Width="85.05" Height="18.9" Text="Alt. / Fax. No:" HorzAlign="Right" Font="Arial, 9pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text55" Left="292.95" Top="189" Width="160.65" Height="18.9" Text="[companies.ContactNo]" Font="Arial, 9pt"/>
      <TextObject Name="Text56" Left="198.45" Top="189" Width="85.05" Height="18.9" Text="Tel. No:" HorzAlign="Right" Font="Arial, 9pt" TextFill.Color="DimGray"/>
      <ShapeObject Name="shpDelAddress" Left="434.7" Top="245.7" Width="264.6" Height="113.4" Visible="false" Border.Color="LightGray" Border.Width="2" Shape="RoundRectangle"/>
      <TextObject Name="txtDelAddress1" Left="444.15" Top="255.15" Width="75.6" Height="47.25" Visible="false" Text="Deliver To:" Font="Segoe UI Light, 11pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="txtDelAddress2" Left="529.2" Top="255.15" Width="160.65" Height="94.5" Text="[trans.DeliveryAddress]"/>
      <TextObject Name="Text57" Left="557.55" Top="189" Width="132.3" Height="18.9" Text="[trans.RefNo]"/>
      <TextObject Name="Text58" Left="463.05" Top="189" Width="85.05" Height="18.9" Text="Ref/Order #:" HorzAlign="Right" TextFill.Color="DimGray"/>
      <ChildBand Name="Child1" Top="371.5" Width="718.2" Height="75.6" CanGrow="true" CanShrink="true" AfterDataEvent="Child1_AfterData">
        <TextObject Name="txtCustomLabel1" Left="18.9" Top="9.45" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel1]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomLabel2" Left="18.9" Top="28.35" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel2]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomLabel3" Left="18.9" Top="47.25" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel3]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomLabel4" Left="359.1" Top="9.45" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel4]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomLabel5" Left="359.1" Top="28.35" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel5]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomLabel6" Left="359.1" Top="47.25" Width="132.3" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.PurchaseCustomLabel6]" TextFill.Color="DimGray"/>
        <TextObject Name="txtCustomText1" Left="160.65" Top="9.45" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom1]"/>
        <TextObject Name="txtCustomText2" Left="160.65" Top="28.35" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom2]"/>
        <TextObject Name="txtCustomText3" Left="160.65" Top="47.25" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom3]"/>
        <TextObject Name="txtCustomText4" Left="500.85" Top="9.45" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom4]"/>
        <TextObject Name="txtCustomText5" Left="500.85" Top="28.35" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom5]"/>
        <TextObject Name="txtCustomText6" Left="500.85" Top="47.25" Width="189" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom6]"/>
      </ChildBand>
    </PageHeaderBand>
    <DataBand Name="DataDefault" Top="511.8" Width="718.2" Height="18.9" CanGrow="true" CanShrink="true" AfterDataEvent="Data1_AfterData" DataSource="trans_items" KeepTogether="true" KeepDetail="true">
      <TextObject Name="Text8" Left="18.9" Width="141.75" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.ProductCode]"/>
      <TextObject Name="Text12" Left="170.1" Width="245.7" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.Description]"/>
      <TextObject Name="txtQty" Left="425.25" Width="56.7" Height="18.9" HideZeros="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtItemTotal" Left="595.35" Width="94.5" Height="18.9" Format="Currency" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtItemPrice" Left="491.4" Width="94.5" Height="18.9" Format="Currency" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtZeroRated" Left="689.85" Width="18.9" Height="18.9" Text="*" HideZeros="true" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" VertAlign="Center" WordWrap="false" Font="Courier New, 8pt"/>
      <DataHeaderBand Name="HeaderDefault" Top="451.1" Width="718.2" Height="56.7" RepeatOnEveryPage="true">
        <ShapeObject Name="Shape1" Left="9.45" Top="9.45" Width="689.85" Height="37.8" Border.Color="Transparent" Fill.Color="Gainsboro" Shape="RoundRectangle"/>
        <TextObject Name="Text11" Left="18.9" Top="18.9" Width="94.5" Height="18.9" Text="Code" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text10" Left="170.1" Top="18.9" Width="94.5" Height="18.9" Text="Description" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text13" Left="425.25" Top="18.9" Width="56.7" Height="18.9" Text="Qty" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text15" Left="595.35" Top="18.9" Width="94.5" Height="18.9" Text="Total" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text54" Left="491.4" Top="18.9" Width="94.5" Height="18.9" Text="Price" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
      </DataHeaderBand>
    </DataBand>
    <DataBand Name="DataDiscount" Top="585.95" Width="718.2" Height="18.9" CanGrow="true" CanShrink="true" AfterDataEvent="DataDiscount_AfterData" DataSource="trans_items">
      <TextObject Name="txtItemCodeD" Left="18.9" Width="113.4" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.ProductCode]"/>
      <TextObject Name="txtDescriptionD" Left="141.75" Width="226.8" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.Description]"/>
      <TextObject Name="txtItemTotalD" Left="595.35" Width="94.5" Height="18.9" Format="Currency" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtItemPriceD" Left="434.7" Width="94.5" Height="18.9" Format="Currency" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtQtyD" Left="378" Width="47.25" Height="18.9" Format="Currency" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtDiscountD" Left="538.65" Width="47.25" Height="18.9" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtZeroRatedD" Left="689.85" Width="18.9" Height="18.9" Text="*" HideZeros="true" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" VertAlign="Center" WordWrap="false" Font="Courier New, 8pt"/>
      <DataHeaderBand Name="HeaderDiscount" Top="534.7" Width="718.2" Height="47.25" RepeatOnEveryPage="true">
        <ShapeObject Name="Shape4" Left="9.45" Width="689.85" Height="37.8" Border.Color="Transparent" Fill.Color="Gainsboro" Shape="RoundRectangle"/>
        <TextObject Name="Text66" Left="18.9" Top="9.45" Width="94.5" Height="18.9" Text="Code" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text67" Left="141.75" Top="9.45" Width="94.5" Height="18.9" Text="Description" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text68" Left="595.35" Top="9.45" Width="94.5" Height="18.9" Text="Total" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text69" Left="434.7" Top="9.45" Width="94.5" Height="18.9" Text="Price" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text70" Left="378" Top="9.45" Width="47.25" Height="18.9" Text="Qty" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
        <TextObject Name="Text77" Left="538.65" Top="9.45" Width="47.25" Height="18.9" Text="Disc" HorzAlign="Right" Font="Segoe UI Light, 11pt"/>
      </DataHeaderBand>
    </DataBand>
    <PageFooterBand Name="PageFooter1" Top="608.85" Width="718.2" Height="122.85" AfterDataEvent="PageFooter1_AfterData">
      <TextObject Name="Text5" Left="595.35" Top="56.7" Width="94.5" Height="18.9" Text="[trans.TotalExcl]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text6" Left="595.35" Top="75.6" Width="94.5" Height="18.9" Text="[trans.TotalVAT]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" WordWrap="false" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text7" Left="595.35" Top="94.5" Width="94.5" Height="18.9" Text="[trans.TotalIncl]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" WordWrap="false" Font="Arial, 10pt, style=Bold" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text27" Left="481.95" Top="56.7" Width="94.5" Height="18.9" Text="Sub Total:" Font="Segoe UI, 10pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text28" Left="481.95" Top="75.6" Width="94.5" Height="18.9" Text="VAT @ [companies.VATrate]%:" Font="Segoe UI, 10pt" TextFill.Color="DimGray"/>
      <TextObject Name="Text29" Left="481.95" Top="94.5" Width="94.5" Height="18.9" Text="Total:" Font="Segoe UI Light, 10pt, style=Bold" TextFill.Color="DimGray"/>
      <LineObject Name="Line1" Left="9.45" Top="9.45" Width="689.85" Border.Color="DimGray" Border.Style="Dash" Border.Width="0.25"/>
      <TextObject Name="Text22" Left="18.9" Top="94.5" Width="94.5" Height="18.9" Text="[PageNofM]" Font="Segoe UI, 9pt" TextFill.Color="DimGray"/>
      <TextObject Name="txtTotQty" Left="132.3" Top="94.5" Width="160.65" Height="18.9" Text="[Total_Qty]" TextFill.Color="DimGray"/>
      <TextObject Name="txtTotLines" Left="302.4" Top="94.5" Width="151.2" Height="18.9" Text="Total Lines: [Total_Lines]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" TextFill.Color="DimGray"/>
      <TextObject Name="lblZeroRated" Left="524.2" Top="18.9" Width="179.55" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="Zero-Rated Items * " HorzAlign="Right" VertAlign="Center" TextFill.Color="DimGray"/>
      <TextObject Name="txtTotQtyD" Left="132.3" Top="94.5" Width="160.65" Height="18.9" Text="[Total_QtyD]" TextFill.Color="DimGray"/>
      <TextObject Name="txtTotLinesD" Left="302.4" Top="94.5" Width="151.2" Height="18.9" Text="Total Lines: [Total_LinesD]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" TextFill.Color="DimGray"/>
    </PageFooterBand>
  </ReportPage>
</Report>
