﻿<?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/19/2015 08:56: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)
    {
      //Qty Column format      
      decimalValue = Convert.ToInt32(Report.GetColumnValue(&quot;programs_config.QtyDecimalValue&quot;));  
      
      //Show Discount      
      if (Report.GetColumnValue(&quot;programs_config.ShowDiscountOnSalesDocument&quot;).ToString() == &quot;1&quot;)
        showDiscount = true;      
      HeaderDefault.Visible = !showDiscount;
      DataDefault.Visible = !showDiscount;
      HeaderDiscount.Visible = showDiscount;
      DataDiscount.Visible = showDiscount; 
      
      //Is VatRegistered
      if (Report.GetColumnValue(&quot;companies.VATno&quot;).ToString().Length &gt; 0)
        isVatRegistered = true;
      
      //Show Amount Due on Sales docs
      if (Report.GetColumnValue(&quot;programs_config.ShowAmountDueOnSalesDocs&quot;).ToString() == &quot;1&quot;)
      {
        lblAmountDue.Visible = true;
        txtAmountDue.Visible = true;
      }
      else
      {
        lblAmountDue.Visible = false;
        txtAmountDue.Visible = false;
      }
      
    }
    
    private void PageHeader1_AfterData(object sender, EventArgs e)
    {
      //Invoice OR Tax Invoice
      if (Report.GetColumnValue(&quot;companies.VATno&quot;).ToString().Length &gt; 0)
      {        
        txtInvoice.Text = &quot;Tax Invoice&quot;;
      }
      else
      {
        txtVatNo.Text = String.Empty;
        txtInvoice.Text = &quot;Invoice&quot;;
      }
      //Reg No
      if (Report.GetColumnValue(&quot;companies.RegNo&quot;).ToString().Length == 0)
        txtRegNo.Text = String.Empty;
      //Tel No
      if (Report.GetColumnValue(&quot;companies.ContactNo&quot;).ToString().Length == 0)
        txtTelNo.Text = String.Empty; 
      //Alt Tel No
      if (Report.GetColumnValue(&quot;companies.AltNo&quot;).ToString().Length == 0)
        txtAltNo.Text = String.Empty; 
      //Email
      if (Report.GetColumnValue(&quot;companies.Email&quot;).ToString().Length == 0)
        txtEmail.Text = String.Empty;
      
      //Print the SalesRep
      if (Report.GetColumnValue(&quot;trans.SalesRep&quot;).ToString().Length == 0)
        txtSalesRep2.Text = String.Empty;
      
      //Invoice To
      if (Report.GetColumnValue(&quot;trans.ClientName&quot;).ToString().Length == 0)
        txtInvoiceTo.Text = String.Empty;
    }
    
    
    private void Child1_AfterData(object sender, EventArgs e)
    {
      //Print the Delivery Address
      if (Report.GetColumnValue(&quot;trans.DeliveryAddress&quot;).ToString().Length == 0)
      {
        txtDelAddress1.Text = String.Empty;
        txtDelAddress2.Text = String.Empty;        
      }           
    }

    
    private void Child2_AfterData(object sender, EventArgs e)
    {
      bool dataToPrint = false;
      if (txtCustomText1.Text.Length &gt; 0)
      {
        txtCustomText1.Visible = true;
        txtCustomLabel1.Visible = true;
        dataToPrint = true;
      }      
      if (txtCustomText2.Text.Length &gt; 0)
      {
        txtCustomText2.Visible = true;
        txtCustomLabel2.Visible = true;
        dataToPrint = true;
      }
      if (txtCustomText3.Text.Length &gt; 0)
      {
        txtCustomText3.Visible = true;
        txtCustomLabel3.Visible = true;
        dataToPrint = true;
      }
      if (txtCustomText4.Text.Length &gt; 0)
      {
        txtCustomText4.Visible = true;
        txtCustomLabel4.Visible = true;
        dataToPrint = true;
      }
      if (txtCustomText5.Text.Length &gt; 0)
      {
        txtCustomText5.Visible = true;
        txtCustomLabel5.Visible = true;
        dataToPrint = true;
      }
      if (txtCustomText6.Text.Length &gt; 0)
      {
        txtCustomText6.Visible = true;
        txtCustomLabel6.Visible = true;
        dataToPrint = true;
      }
      
      if (dataToPrint)
      {
        txtCustomHeader.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 total = 0;
        if (qty != 0)
        {
          //Total          
          if (Report.GetColumnValue(&quot;programs_config.InvShowRetailPriceExcl&quot;).ToString() == &quot;1&quot;)
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalSellingExcl&quot;)); 
          else
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalSellingIncl&quot;));   
        }
        //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);
          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 (Report.GetColumnValue(&quot;programs_config.InvShowRetailPriceExcl&quot;).ToString() == &quot;1&quot;)
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalSellingExcl&quot;)); 
          else
            total = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.TotalSellingIncl&quot;));           
          
          //Unit Price
          unitPrice = (total / qty);           
          
          //Discount
          discount = Convert.ToDecimal(Report.GetColumnValue(&quot;trans_items.Discount&quot;));
          
          //Price before discount
          if (discount == 0)
            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) + &quot; @ &quot; + priceBeforeDiscount.ToString(&quot;# ### ###.00&quot;);
          txtItemTotalD.Text = total.ToString(&quot;# ### ###.00&quot;);
          txtDiscountD.Text = discount.ToString(&quot;0.##&quot;) + &quot;%&quot;;
        }
      }
    }
    
    
    private void Data2_AfterData(object sender, EventArgs e)
    {
      if (zeroRatedItemsFound &gt; 0)
        lblZeroRated.Visible = true;
    }

    

    private void Child3_AfterData(object sender, EventArgs e)
    {
      //Banking Details                     
      if (Report.GetColumnValue(&quot;companies.BankingDetails&quot;).ToString().Length == 0)
        txtBankingDetails.Text = String.Empty;
    }
  }
}
</ScriptText>
  <Dictionary>
    <MySqlDataConnection Name="Connection" ConnectionString="rijcmlqmUGi0DHzhik04BO5+uxHPNJg6XdWlo9sfl3oNLbLcC5ELgVy3yM4U7/vviW/yU/VlCYnkUjA+BNt9VEI/Ru/VscbuwRNZItjcEWbFtfZENw=">
      <TableDataSource Name="clients" DataType="System.Int32" Enabled="true" TableName="clients" SelectCommand="SELECT * FROM clients 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="ClientID" DataType="System.UInt32"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="LastCashTransDate" DataType="System.DateTime"/>
        <Column Name="LastCashInvoiceDate" DataType="System.DateTime"/>
        <Column Name="LastCashRefundDate" DataType="System.DateTime"/>
        <Column Name="LastAccountTransDate" DataType="System.DateTime"/>
        <Column Name="LastAccountInvoiceDate" DataType="System.DateTime"/>
        <Column Name="LastCreditNoteDate" DataType="System.DateTime"/>
        <Column Name="LastReceiptDate" DataType="System.DateTime"/>
        <Column Name="LastJournalDate" DataType="System.DateTime"/>
        <Column Name="TotalDue" DataType="System.Decimal"/>
        <Column Name="PriceOverrideRule" DataType="System.String"/>
        <Column Name="PriceOverrideValue" DataType="System.Decimal"/>
        <Column Name="Note" DataType="System.String"/>
        <Column Name="InterestOver" DataType="System.String"/>
        <Column Name="InterestValue" DataType="System.Decimal"/>
        <Column Name="Area" DataType="System.String"/>
        <Column Name="City" DataType="System.String"/>
        <Column Name="CreditLimit" DataType="System.Decimal"/>
        <Column Name="Status" DataType="System.String"/>
      </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 InvShowRetailPriceExcl, QtyDecimalValue,&#13;&#10;InvCustomLabel1, InvCustomLabel2, InvCustomLabel3,&#13;&#10;InvCustomLabel4, InvCustomLabel5, InvCustomLabel6,&#13;&#10;ShowDiscountOnSalesDocument, ShowAmountDueOnSalesDocs &#13;&#10;FROM programs_config &#13;&#10;WHERE CompanyID = @CompanyID">
        <Column Name="InvCustomLabel1" DataType="System.String"/>
        <Column Name="InvCustomLabel2" DataType="System.String"/>
        <Column Name="InvCustomLabel3" DataType="System.String"/>
        <Column Name="InvCustomLabel4" DataType="System.String"/>
        <Column Name="InvCustomLabel5" DataType="System.String"/>
        <Column Name="InvCustomLabel6" DataType="System.String"/>
        <Column Name="InvShowRetailPriceExcl" DataType="System.Byte"/>
        <Column Name="QtyDecimalValue" DataType="System.UInt32"/>
        <Column Name="ShowDiscountOnSalesDocument" DataType="System.Byte"/>
        <Column Name="ShowAmountDueOnSalesDocs" 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 credit_sales where transID = 3792 and companyID = 4">
        <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="SalesRep" DataType="System.String"/>
        <Column Name="ClientID" DataType="System.UInt32"/>
        <Column Name="ClientName" 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="TotalPaid" DataType="System.Decimal"/>
        <Column Name="TransID" DataType="System.UInt32"/>
        <Column Name="DeliveryAddress" DataType="System.String"/>
      </TableDataSource>
      <TableDataSource Name="trans_items" DataType="System.Int32" PropName="cash_sales_items" Enabled="true" TableName="trans_items" SelectCommand="select * from credit_sales_items where relatedID = 379032 and companyid = 4">
        <Column Name="ID" DataType="System.UInt32"/>
        <Column Name="CompanyID" DataType="System.UInt32"/>
        <Column Name="ClientID" 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="TotalCost" DataType="System.Decimal"/>
        <Column Name="TotalSellingExcl" DataType="System.Decimal"/>
        <Column Name="TotalVAT" DataType="System.Decimal"/>
        <Column Name="TotalSellingIncl" DataType="System.Decimal"/>
        <Column Name="RelatedID" DataType="System.UInt32"/>
        <Column Name="SalesRep" DataType="System.String"/>
        <Column Name="QtyAvailable" DataType="System.Decimal"/>
        <Column Name="RelCreditNoteIDs" DataType="System.String"/>
        <Column Name="RelCreditNoteQtys" 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="CompanyID" DataType="System.Int32"/>
  </Dictionary>
  <ReportPage Name="Page1" PaperWidth="110" PaperHeight="1000" LeftMargin="3" RightMargin="3" FirstPageSource="15" OtherPagesSource="15">
    <PageHeaderBand Name="PageHeader1" Width="393.12" Height="406.35" CanGrow="true" CanShrink="true" AfterDataEvent="PageHeader1_AfterData">
      <TextObject Name="Text3" Left="18.9" Top="311.85" Width="302.4" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans.ClientName]" Font="Courier New, 8pt"/>
      <TextObject Name="Text2" Top="47.25" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Date: [trans.Date]" Format="Custom" Format.Format="yyyy-MM-dd HH:mm" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text14" Top="103.95" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="[companies.Name]" HorzAlign="Center" WordWrap="false" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray" Clip="false"/>
      <TextObject Name="txtInvoice" Top="9.45" Width="321.3" Height="18.9" Border.Shadow="true" Border.ShadowColor="Transparent" CanGrow="true" CanShrink="true" Text="Invoice" HorzAlign="Center" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="txtInvoiceTo" Top="292.95" Width="151.2" Height="18.9" CanGrow="true" CanShrink="true" Text="Invoice To:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="txtSalesRep2" Top="66.15" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Sales Rep: [trans.SalesRep]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="txtInvoiceNumber" Top="28.35" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="# [trans.TransID]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text4" Left="18.9" Top="330.75" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text90" Text="[clients.BillingAddress]" Font="Courier New, 8pt"/>
      <TextObject Name="txtRegNo" Top="198.45" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Reg. No: [companies.RegNo]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="txtVatNo" Top="236.25" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Vat No: [companies.VATno]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="txtAltNo" Top="255.15" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Alt. No: [companies.AltNo]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="txtEmail" Top="274.05" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Email: [companies.Email]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="txtTelNo" Top="217.35" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text="Tel. No: [companies.ContactNo]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text1" Top="122.85" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text107" Text="[companies.Address]" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text90" Left="18.9" Top="349.65" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text91" Font="Courier New, 8pt"/>
      <TextObject Name="Text91" Left="18.9" Top="368.55" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text92" Font="Courier New, 8pt"/>
      <TextObject Name="Text92" Left="18.9" Top="387.45" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
      <TextObject Name="Text107" Top="141.75" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text108" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text108" Top="160.65" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text109" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text109" Top="179.55" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" HorzAlign="Center" Font="Courier New, 8pt"/>
      <TextObject Name="Text110" Top="85.05" Width="321.3" Height="18.9" CanGrow="true" CanShrink="true" Text=" " Font="Courier New, 8pt"/>
      <ChildBand Name="Child1" Top="410.35" Width="393.12" Height="94.5" CanGrow="true" CanShrink="true" AfterDataEvent="Child1_AfterData">
        <TextObject Name="txtDelAddress2" Left="18.9" Top="18.9" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text93" Text="[trans.DeliveryAddress]" Font="Courier New, 8pt"/>
        <TextObject Name="txtDelAddress1" Width="122.85" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="Deliver To:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
        <TextObject Name="Text93" Left="18.9" Top="37.8" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text94" Font="Courier New, 8pt"/>
        <TextObject Name="Text94" Left="18.9" Top="56.7" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text95" Font="Courier New, 8pt"/>
        <TextObject Name="Text95" Left="18.9" Top="75.6" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
        <ChildBand Name="Child2" Top="508.85" Width="393.12" Height="132.3" CanGrow="true" CanShrink="true" AfterDataEvent="Child2_AfterData">
          <TextObject Name="txtCustomLabel6" Left="18.9" Top="113.4" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel6]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText6" Left="170.1" Top="113.4" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom6]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomLabel5" Left="18.9" Top="94.5" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel5]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText5" Left="170.1" Top="94.5" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom5]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomLabel4" Left="18.9" Top="75.6" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel4]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText4" Left="170.1" Top="75.6" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom4]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomLabel3" Left="18.9" Top="56.7" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel3]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText3" Left="170.1" Top="56.7" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom3]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomLabel2" Left="18.9" Top="37.8" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel2]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText2" Left="170.1" Top="37.8" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom2]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomLabel1" Left="18.9" Top="18.9" Width="141.75" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[programs_config.InvCustomLabel1]" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
          <TextObject Name="txtCustomText1" Left="170.1" Top="18.9" Width="151.2" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="[trans.Custom1]" Font="Courier New, 8pt"/>
          <TextObject Name="txtCustomHeader" Width="75.6" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="Other:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
        </ChildBand>
      </ChildBand>
    </PageHeaderBand>
    <DataBand Name="DataDefault" Top="724.75" Width="393.12" Height="75.6" CanGrow="true" CanShrink="true" AfterDataEvent="Data1_AfterData" DataSource="trans_items" KeepTogether="true" KeepDetail="true">
      <TextObject Name="Text8" Left="75.6" Top="56.7" Width="122.85" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.ProductCode]" Font="Courier New, 8pt"/>
      <TextObject Name="Text12" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text105" Text="[trans_items.Description]" Font="Courier New, 8pt"/>
      <TextObject Name="txtZeroRated" Left="349.65" Top="56.7" Width="18.9" Height="18.9" CanGrow="true" CanShrink="true" 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"/>
      <TextObject Name="txtQty" Left="9.45" Top="56.7" Width="56.7" Height="18.9" CanGrow="true" CanShrink="true" Format="Number" Format.UseLocale="true" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtItemTotal" Left="207.9" Top="56.7" Width="113.4" Height="18.9" CanGrow="true" CanShrink="true" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text105" Top="18.9" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text106" Font="Courier New, 8pt"/>
      <TextObject Name="Text106" Top="37.8" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
      <DataHeaderBand Name="HeaderDefault" Top="645.15" Width="393.12" Height="75.6">
        <TextObject Name="Text63" Top="56.7" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="txtItemTotallbl" Left="207.9" Top="37.8" Width="113.4" Height="18.9" Text="Total" HorzAlign="Right" Font="Courier New, 8pt"/>
        <TextObject Name="Text10" Top="18.9" Width="274.05" Height="18.9" Text="Description" Font="Courier New, 8pt"/>
        <TextObject Name="Text65" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="Text11" Left="75.6" Top="37.8" Width="122.85" Height="18.9" Text="Code" Font="Courier New, 8pt"/>
        <TextObject Name="Text87" Left="9.45" Top="37.8" Width="56.7" Height="18.9" Text="Qty" Font="Courier New, 8pt"/>
      </DataHeaderBand>
    </DataBand>
    <DataBand Name="DataDiscount" Top="902.85" Width="393.12" Height="94.5" CanGrow="true" CanShrink="true" AfterDataEvent="DataDiscount_AfterData" DataSource="trans_items">
      <TextObject Name="txtDescriptionD" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text96" Text="[trans_items.Description]" Font="Courier New, 8pt"/>
      <TextObject Name="txtQtyD" Left="9.45" Top="56.7" Width="198.45" Height="18.9" CanGrow="true" CanShrink="true" Format="Number" Format.UseLocale="true" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtZeroRatedD" Left="349.65" Top="75.6" Width="18.9" Height="18.9" CanGrow="true" CanShrink="true" 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"/>
      <TextObject Name="txtDiscountD" Left="217.35" Top="56.7" Width="103.95" Height="18.9" CanGrow="true" CanShrink="true" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
      <TextObject Name="txtItemCodeD" Left="9.45" Top="75.6" Width="160.65" Height="18.9" CanGrow="true" CanShrink="true" Text="[trans_items.ProductCode]" Font="Courier New, 8pt"/>
      <TextObject Name="txtItemTotalD" Left="179.55" Top="75.6" Width="141.75" Height="18.9" CanGrow="true" CanShrink="true" Format="Number" Format.UseLocale="true" HorzAlign="Right" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
      <TextObject Name="Text96" Top="18.9" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text97" Font="Courier New, 8pt"/>
      <TextObject Name="Text97" Top="37.8" Width="274.05" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
      <DataHeaderBand Name="HeaderDiscount" Top="804.35" Width="393.12" Height="94.5">
        <TextObject Name="Text79" Top="75.6" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="Text80" Left="9.45" Top="56.7" Width="160.65" Height="18.9" Text="Code" Font="Courier New, 8pt"/>
        <TextObject Name="Text81" Top="18.9" Width="274.05" Height="18.9" Text="Description" WordWrap="false" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text82" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="Text83" Left="179.55" Top="56.7" Width="141.75" Height="18.9" Text="Total" HorzAlign="Right" Font="Courier New, 8pt"/>
        <TextObject Name="Text86" Left="217.35" Top="37.8" Width="103.95" Height="18.9" Text="Discount" HorzAlign="Right" Font="Courier New, 8pt"/>
        <TextObject Name="Text88" Left="9.45" Top="37.8" Width="198.45" Height="18.9" Text="Qty @ Price" Font="Courier New, 8pt"/>
      </DataHeaderBand>
    </DataBand>
    <DataBand Name="Data2" Top="1001.35" Width="393.12" Height="132.3" CanGrow="true" CanShrink="true" AfterDataEvent="Data2_AfterData">
      <TextObject Name="Text61" Top="18.9" Width="75.6" Height="18.9" CanGrow="true" CanShrink="true" Text="Note:" VertAlign="Center" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="Text62" Left="18.9" Top="37.8" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text98" Text="[trans.SlipNote]" Font="Courier New, 8pt"/>
      <TextObject Name="lblZeroRated" Left="155.65" Top="18.9" Width="179.55" Height="18.9" Visible="false" CanGrow="true" CanShrink="true" Text="Zero-Rated Items *" HorzAlign="Right" VertAlign="Center" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
      <TextObject Name="Text89" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
      <TextObject Name="Text98" Left="18.9" Top="56.7" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text99" Font="Courier New, 8pt"/>
      <TextObject Name="Text99" Left="18.9" Top="75.6" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text100" Font="Courier New, 8pt"/>
      <TextObject Name="Text100" Left="18.9" Top="94.5" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text101" Font="Courier New, 8pt"/>
      <TextObject Name="Text101" Left="18.9" Top="113.4" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
      <ChildBand Name="Child3" Top="1137.65" Width="393.12" Height="340.2" CanShrink="true" AfterDataEvent="Child3_AfterData">
        <TextObject Name="Text27" Left="56.7" Top="18.9" Width="94.5" Height="18.9" Text="Sub Total:" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
        <TextObject Name="Text5" Left="198.45" Top="18.9" Width="141.75" 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" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text6" Left="198.45" Top="37.8" Width="141.75" 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" Font="Courier New, 8pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text28" Left="56.7" Top="37.8" Width="94.5" Height="18.9" Text="VAT @ [companies.VATrate]%:" Font="Courier New, 8pt" TextFill.Color="DimGray"/>
        <TextObject Name="Text7" Left="198.45" Top="56.7" Width="141.75" 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="Courier New, 8pt, style=Bold" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text29" Left="56.7" Top="56.7" Width="94.5" Height="18.9" Text="Total:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
        <TextObject Name="txtBankingDetails" Top="113.4" Width="151.2" Height="18.9" CanGrow="true" CanShrink="true" Text="Banking Details:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
        <TextObject Name="Text19" Left="18.9" Top="132.3" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text102" Text="[companies.BankingDetails]" Font="Courier New, 8pt"/>
        <TextObject Name="Text64" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="Text102" Left="18.9" Top="151.2" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text103" Font="Courier New, 8pt"/>
        <TextObject Name="Text103" Left="18.9" Top="170.1" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" BreakTo="Text104" Font="Courier New, 8pt"/>
        <TextObject Name="Text104" Left="18.9" Top="189" Width="255.15" Height="18.9" CanGrow="true" CanShrink="true" Font="Courier New, 8pt"/>
        <TextObject Name="Text67" Top="321.3" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="Text68" Top="207.9" Width="274.05" Height="18.9" Text="--------------------------------------" Font="Courier New, 8pt"/>
        <TextObject Name="txtAmountDue" Left="198.45" Top="94.5" Width="141.75" Height="18.9" Text="[clients.TotalDue]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" WordWrap="false" Font="Courier New, 8pt, style=Bold" Trimming="EllipsisCharacter"/>
        <TextObject Name="lblAmountDue" Left="56.7" Top="94.5" Width="94.5" Height="18.9" Text="Balance Due:" Font="Courier New, 8pt, style=Bold" TextFill.Color="DimGray"/>
      </ChildBand>
    </DataBand>
  </ReportPage>
</Report>
