<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="04/26/2014 16:41:05" ReportInfo.Modified="08/09/2019 15:38:55" ReportInfo.CreatorVersion="2014.3.1.0" PrintSettings.Printer="迅捷PDF虚拟打印机" PrintSettings.SavePrinterWithReport="true" PrintSettings.Copies="2">
  <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
  {     
    public int AmtLength = 2;
    public int PriceLength = 2;
    public int QtyLength = 2;
    public string ToUpper(decimal m)
    {       
      string cm;
      if(m==0)
      {
        cm=&quot;0&quot;;
      }
      else
      {
        cm=m.ToString();
      }
      string functionReturnValue = null;
      bool IsNegative = false; // 是否是负数
      if (cm.Trim().Substring(0, 1) == &quot;-&quot;)
      {
        // 是负数则先转为正数
        cm = cm.Trim().Remove(0, 1);
        IsNegative = true;
      }
      string strLower = null;
      string strUpart = null;
      string strUpper = null;
      int iTemp = 0;
      // 保留两位小数 123.489→123.49　　123.4→123.4
      cm = Math.Round(double.Parse(cm), 2).ToString();
      if (cm.IndexOf(&quot;.&quot;) &gt; 0)
      {
        if (cm.IndexOf(&quot;.&quot;) == cm.Length - 2)
        {
          cm = cm + &quot;0&quot;;
        }
      }
      else
      {
        cm = cm + &quot;.00&quot;;
      }
      strLower = cm;
      iTemp = 1;
      strUpper = &quot;&quot;;
      while (iTemp &lt;= strLower.Length)
      {
        switch (strLower.Substring(strLower.Length - iTemp, 1))
        {
          case &quot;.&quot;:
            strUpart = &quot;圆&quot;;
            break;
          case &quot;0&quot;:
            strUpart = &quot;零&quot;;
            break;
          case &quot;1&quot;:
            strUpart = &quot;壹&quot;;
            break;
          case &quot;2&quot;:
            strUpart = &quot;贰&quot;;
            break;
          case &quot;3&quot;:
            strUpart = &quot;叁&quot;;
            break;
          case &quot;4&quot;:
            strUpart = &quot;肆&quot;;
            break;
          case &quot;5&quot;:
            strUpart = &quot;伍&quot;;
            break;
          case &quot;6&quot;:
            strUpart = &quot;陆&quot;;
            break;
          case &quot;7&quot;:
            strUpart = &quot;柒&quot;;
            break;
          case &quot;8&quot;:
            strUpart = &quot;捌&quot;;
            break;
          case &quot;9&quot;:
            strUpart = &quot;玖&quot;;
            break;
        }

        switch (iTemp)
        {
          case 1:
            strUpart = strUpart + &quot;分&quot;;
            break;
          case 2:
            strUpart = strUpart + &quot;角&quot;;
            break;
          case 3:
            strUpart = strUpart + &quot;&quot;;
            break;
          case 4:
            strUpart = strUpart + &quot;&quot;;
            break;
          case 5:
            strUpart = strUpart + &quot;拾&quot;;
            break;
          case 6:
            strUpart = strUpart + &quot;佰&quot;;
            break;
          case 7:
            strUpart = strUpart + &quot;仟&quot;;
            break;
          case 8:
            strUpart = strUpart + &quot;万&quot;;
            break;
          case 9:
            strUpart = strUpart + &quot;拾&quot;;
            break;
          case 10:
            strUpart = strUpart + &quot;佰&quot;;
            break;
          case 11:
            strUpart = strUpart + &quot;仟&quot;;
            break;
          case 12:
            strUpart = strUpart + &quot;亿&quot;;
            break;
          case 13:
            strUpart = strUpart + &quot;拾&quot;;
            break;
          case 14:
            strUpart = strUpart + &quot;佰&quot;;
            break;
          case 15:
            strUpart = strUpart + &quot;仟&quot;;
            break;
          case 16:
            strUpart = strUpart + &quot;万&quot;;
            break;
          default:
            strUpart = strUpart + &quot;&quot;;
            break;
        }

        strUpper = strUpart + strUpper;
        iTemp = iTemp + 1;
      }

      strUpper = strUpper.Replace(&quot;零拾&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零佰&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零仟&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零零零&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零零&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零角零分&quot;, &quot;整&quot;);
      strUpper = strUpper.Replace(&quot;零分&quot;, &quot;整&quot;);
      strUpper = strUpper.Replace(&quot;零角&quot;, &quot;零&quot;);
      strUpper = strUpper.Replace(&quot;零亿零万零圆&quot;, &quot;亿圆&quot;);
      strUpper = strUpper.Replace(&quot;亿零万零圆&quot;, &quot;亿圆&quot;);
      strUpper = strUpper.Replace(&quot;零亿零万&quot;, &quot;亿&quot;);
      strUpper = strUpper.Replace(&quot;零万零圆&quot;, &quot;万圆&quot;);
      strUpper = strUpper.Replace(&quot;零亿&quot;, &quot;亿&quot;);
      strUpper = strUpper.Replace(&quot;零万&quot;, &quot;万&quot;);
      strUpper = strUpper.Replace(&quot;零圆&quot;, &quot;圆&quot;);
      strUpper = strUpper.Replace(&quot;零零&quot;, &quot;零&quot;);

      // 对壹圆以下的金额的处理
      if (strUpper.Substring(0, 1) == &quot;圆&quot;)
      {
        strUpper = strUpper.Substring(1, strUpper.Length - 1);
      }
      if (strUpper.Substring(0, 1) == &quot;零&quot;)
      {
        strUpper = strUpper.Substring(1, strUpper.Length - 1);
      }
      if (strUpper.Substring(0, 1) == &quot;角&quot;)
      {
        strUpper = strUpper.Substring(1, strUpper.Length - 1);
      }
      if (strUpper.Substring(0, 1) == &quot;分&quot;)
      {
        strUpper = strUpper.Substring(1, strUpper.Length - 1);
      }
      if (strUpper.Substring(0, 1) == &quot;整&quot;)
      {
        strUpper = &quot;零圆整&quot;;
      }
      functionReturnValue = strUpper;

      if (IsNegative == true)
      {
        return &quot;负&quot; + functionReturnValue;
      }
      else
      {
        return functionReturnValue;
      }
    }
    public double FormatToDouble(object vText)
    {
      if (vText == null || vText.ToString() == &quot;&quot; || vText.ToString() == &quot;-&quot; || vText.ToString() == &quot;.&quot;)
        return 0;
      else
      {
        try
        {
          return double.Parse(vText.ToString());
        }
        catch
        {
          return 0;
        }
      }
    }

    
    private float reportHeight;
    private void Data1_BeforePrint(object sender, EventArgs e)
    {
      reportHeight += (sender as BandBase).Height; 
    }
    private void Page1_StartPage(object sender, EventArgs e)
    {   
      if(Engine.FinalPass)
      {
        if(Engine.FinalPass)
        {
          Page1.PaperHeight = (reportHeight+ReportTitle1.Height+ReportSummary1.Height)/Units.Millimeters + Page1.TopMargin +Page1.BottomMargin;
        }
      }
    }
  }
}
</ScriptText>
  <Dictionary>
    <TableDataSource Name="main" ReferenceName="Data.main" DataType="System.Int32" Enabled="true">
      <Column Name="流水号" DataType="System.String"/>
      <Column Name="时间" DataType="System.String"/>
      <Column Name="会员" DataType="System.String"/>
      <Column Name="会员卡号" DataType="System.String"/>
      <Column Name="会员积分" DataType="System.String"/>
      <Column Name="原金额" DataType="System.String"/>
      <Column Name="优惠金额" DataType="System.String"/>
      <Column Name="应收金额" DataType="System.String"/>
      <Column Name="现金付款" DataType="System.String"/>
      <Column Name="储值卡付款" DataType="System.String"/>
      <Column Name="银行卡付款" DataType="System.String"/>
      <Column Name="代金券付款" DataType="System.String"/>
      <Column Name="支付宝付款" DataType="System.String"/>
      <Column Name="微信付款" DataType="System.String"/>
      <Column Name="实收" DataType="System.String"/>
      <Column Name="找零" DataType="System.String"/>
      <Column Name="操作人" DataType="System.String"/>
    </TableDataSource>
    <TableDataSource Name="item" ReferenceName="Data.item" DataType="System.Int32" Enabled="true">
      <Column Name="折扣" DataType="System.String"/>
      <Column Name="颜色" DataType="System.String"/>
      <Column Name="商品名称" DataType="System.String"/>
      <Column Name="尺码" DataType="System.String"/>
      <Column Name="小计" DataType="System.Decimal"/>
      <Column Name="商品编号" DataType="System.String"/>
      <Column Name="款号" DataType="System.String"/>
      <Column Name="商品数量" DataType="System.String"/>
      <Column Name="吊牌价" DataType="System.String"/>
      <Column Name="折后售价" DataType="System.String"/>
    </TableDataSource>
    <TableDataSource Name="comp" ReferenceName="Data.comp" DataType="System.Int32" Enabled="true">
      <Column Name="店名" DataType="System.String"/>
      <Column Name="脚注1" DataType="System.String"/>
      <Column Name="脚注2" DataType="System.String"/>
    </TableDataSource>
  </Dictionary>
  <ReportPage Name="Page1" PaperWidth="70" PaperHeight="70" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0" StartPageEvent="Page1_StartPage" FinishPageEvent="Page1_FinishPage">
    <ReportTitleBand Name="ReportTitle1" Width="264.6" Height="132.85">
      <TextObject Name="Text20" Left="67.15" Top="10.45" Width="160.65" Height="22.68" Text="[comp.店名]" HorzAlign="Center" VertAlign="Center" Font="宋体, 10pt, style=Bold"/>
      <TextObject Name="Text5" Left="93.85" Top="47.7" Width="151.2" Height="18.9" Text="[main.流水号]" Font="宋体, 9pt"/>
      <TextObject Name="Text42" Left="46.8" Top="47.7" Width="75.6" Height="18.9" Text="流水号：" Font="宋体, 9pt"/>
      <TextObject Name="Text2" Left="59.7" Top="85.5" Width="56.7" Height="18.9" Text="会员：" Font="宋体, 9pt"/>
      <TextObject Name="Text64" Left="93.5" Top="85.05" Width="151.2" Height="18.9" Text="[main.会员]" Font="宋体, 9pt"/>
      <TextObject Name="Text65" Left="58.7" Top="67.6" Width="56.7" Height="18.9" Text="时间：" Font="宋体, 9pt"/>
      <TextObject Name="Text66" Left="92.5" Top="67.15" Width="151.2" Height="18.9" Text="[main.时间]" Font="宋体, 9pt"/>
      <TextObject Name="Text1" Left="51.25" Top="109.5" Width="189" Height="3.78" Border.Lines="Top" Border.Style="Dot" Font="宋体, 9pt"/>
      <TextObject Name="Text7" Left="44.25" Top="113.4" Width="94.5" Height="18.9" Text="品名" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
      <TextObject Name="Text9" Left="138.55" Top="113.4" Width="37.8" Height="18.9" Text="数量" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
      <TextObject Name="Text67" Left="176.45" Top="113.4" Width="37.8" Height="18.9" Text="单价" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
      <TextObject Name="Text68" Left="213.9" Top="113.4" Width="37.8" Height="18.9" Text="小计" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
      <TextObject Name="Text85" Left="51.25" Top="127.4" Width="189" Height="3.78" Border.Lines="Bottom" Border.Style="Dot" Font="宋体, 9pt"/>
    </ReportTitleBand>
    <DataBand Name="Data1" Top="136.85" Width="264.6" Height="37.8" CanGrow="true" CanShrink="true" BeforePrintEvent="Data1_BeforePrint" AfterPrintEvent="Data1_AfterPrint" AfterLayoutEvent="Data1_AfterLayout" DataSource="item">
      <TextObject Name="Text6" Left="44.8" Width="170.1" Height="18.9" Text="[item.商品名称]" AutoShrink="FontWidth" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
      <TextObject Name="Text8" Left="129.85" Top="18.9" Width="37.8" Height="18.9" Text="[item.商品数量]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text69" Left="167.65" Top="18.9" Width="47.25" Height="18.9" Text="[item.折后售价]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text70" Left="214.8" Top="18.9" Width="47.25" Height="18.9" Text="[item.小计]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" Top="178.65" Width="264.6" Height="132.3">
      <TextObject Name="Text62" Left="49.25" Top="8.15" Width="66.15" Height="18.9" Text="金额：" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text63" Left="85.05" Top="7.35" Width="75.6" Height="18.9" Text="[main.原金额]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text71" Left="152.2" Top="5.7" Width="66.15" Height="18.9" Text="优惠：" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text72" Left="190" Top="5.35" Width="75.6" Height="18.9" Text="[main.优惠金额]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="0" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text73" Left="49.25" Top="24.5" Width="66.15" Height="18.9" Text="应收：" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text74" Left="86.05" Top="24.7" Width="75.6" Height="18.9" Text="[main.应收金额]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text75" Left="52.25" Top="2" Width="189" Height="9.45" Border.Lines="Top" Border.Style="Dot" Font="宋体, 9pt"/>
      <TextObject Name="Text76" Left="53.25" Top="79.6" Width="189" Height="9.45" Border.Lines="Top" Border.Style="Dot" Font="宋体, 9pt"/>
      <TextObject Name="Text77" Left="49.05" Top="85.05" Width="207.9" Height="18.9" Text="[comp.脚注1]" Font="宋体, 9pt"/>
      <TextObject Name="Text79" Left="49.05" Top="103.95" Width="198.45" Height="18.9" Text="[comp.脚注2]" Font="宋体, 9pt"/>
      <TextObject Name="Text81" Left="152.2" Top="27.35" Width="66.15" Height="18.9" Text="实收：" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text82" Left="189" Top="27" Width="75.6" Height="18.9" Text="[main.实收]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text83" Left="49.25" Top="47.25" Width="66.15" Height="18.9" Text="找零：" VertAlign="Center" Font="宋体, 10pt"/>
      <TextObject Name="Text84" Left="86.05" Top="45.9" Width="75.6" Height="18.9" Text="[main.找零]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator="," Format.NegativePattern="1" VertAlign="Center" Font="宋体, 10pt"/>
    </ReportSummaryBand>
  </ReportPage>
</Report>
