<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="04/26/2014 16:41:05" ReportInfo.Modified="05/26/2018 13:54:29" ReportInfo.CreatorVersion="2014.3.1.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
  {     
    public int AmtLength = 2;
    public int PriceLength = 2;
    public int QtyLength = 2;
    public string ToUpper(string m)
    {       
      string cm;
      if(m==&quot;&quot;)
      {
        cm=&quot;0&quot;;
      }
      else
      {
        cm=m;
      }
      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;
        }
      }
    }
  }
}
</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.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"/>
      <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="自定义1" DataType="System.String"/>
      <Column Name="自定义2" DataType="System.String"/>
      <Column Name="自定义3" DataType="System.String"/>
      <Column Name="截止日期" DataType="System.String"/>
      <Column Name="数量" DataType="System.Decimal"/>
      <Column Name="单位" DataType="System.String"/>
      <Column Name="成本价" DataType="System.Decimal"/>
      <Column Name="原价" DataType="System.Decimal"/>
      <Column Name="折扣" DataType="System.Decimal"/>
      <Column Name="单价" DataType="System.Decimal"/>
      <Column Name="金额" DataType="System.Decimal"/>
      <Column Name="备注" DataType="System.String"/>
    </TableDataSource>
    <TableDataSource Name="comp" ReferenceName="Data.comp" 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"/>
    </TableDataSource>
    <TableDataSource Name="corp" ReferenceName="Data.corp" 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="自定义1" DataType="System.String"/>
      <Column Name="自定义2" DataType="System.String"/>
      <Column Name="自定义3" 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="QQ/MSN" 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.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>
  </Dictionary>
  <ReportPage Name="Page1">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="113.4">
      <TextObject Name="Text20" Left="11.9" Top="9.45" Width="642.6" Height="22.68" Text="[comp.公司名称]" HorzAlign="Center" VertAlign="Center" Font="宋体, 12pt, style=Bold"/>
      <TextObject Name="Text1" Left="11.9" Top="28.35" Width="642.6" Height="28.35" Text="销售开单" HorzAlign="Center" VertAlign="Center" Font="宋体, 12pt, style=Bold"/>
      <TextObject Name="Text5" Left="78.05" Top="56.7" Width="141.75" Height="18.9" Text="[main.单号]" Font="宋体, 9pt"/>
      <TextObject Name="Text42" Left="12.9" Top="56.7" Width="75.6" Height="18.9" Text="开单单号：" Font="宋体, 9pt"/>
      <TextObject Name="Text43" Left="625.15" Top="56.7" Width="75.6" Height="18.9" Text="[main.时间]" Font="宋体, 9pt"/>
      <TextObject Name="Text44" Left="588.35" Top="56.7" Width="75.6" Height="18.9" Text="日期：" Font="宋体, 9pt"/>
      <TextObject Name="Text2" Left="11.9" Top="75.6" Width="94.5" Height="18.9" Text="客户名称：" Font="宋体, 9pt"/>
      <TextObject Name="Text3" Left="78.05" Top="75.6" Width="217.35" Height="18.9" Text="[main.客户名称]" Font="宋体, 9pt"/>
      <TextObject Name="Text54" Left="78.05" Top="94.5" Width="349.65" Height="18.9" Text="[main.备注]" Font="宋体, 9pt"/>
      <TextObject Name="Text55" Left="37.25" Top="94.5" Width="94.5" Height="18.9" Text="备注：" Font="宋体, 9pt"/>
      <TextObject Name="Text70" Left="348.65" Top="56.7" Width="141.75" Height="18.9" Text="[main.单据类型]" Font="宋体, 9pt"/>
      <TextObject Name="Text71" Left="283.5" Top="56.7" Width="75.6" Height="18.9" Text="开单类型：" Font="宋体, 9pt"/>
    </ReportTitleBand>
    <PageHeaderBand Name="PageHeader1" Top="117.4" Width="718.2" Height="20.9">
      <TextObject Name="Text7" Left="39.8" Top="2" Width="103.95" Height="18.9" Border.Lines="All" Text="商品编号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text9" Left="143.75" Top="2" Width="103.95" Height="18.9" Border.Lines="All" Text="商品名称" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text11" Left="247.7" Top="2" Width="75.6" Height="18.9" Border.Lines="All" Text="规格型号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text13" Left="323.3" Top="2" Width="56.7" Height="18.9" Border.Lines="All" Text="单位" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text16" Left="436.7" Top="2" Width="75.6" Height="18.9" Border.Lines="All" Text="原价" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text19" Left="380" Top="2" Width="56.7" Height="18.9" Border.Lines="All" Text="数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text49" Left="569" Top="2" Width="66.15" Height="18.9" Border.Lines="All" Text="单价" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" LineHeight="11.34"/>
      <TextObject Name="Text51" Left="512.3" Top="2" Width="56.7" Height="18.9" Border.Lines="All" Text="折扣" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text53" Left="635.15" Top="2" Width="75.6" Height="18.9" Border.Lines="All" Text="金额" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" LineHeight="11.34"/>
      <TextObject Name="Text59" Left="2" Top="2" Width="37.8" Height="18.9" Border.Lines="All" Text="序号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
    </PageHeaderBand>
    <DataBand Name="Data1" Top="142.3" Width="718.2" Height="18.9" DataSource="item">
      <TextObject Name="Text6" Left="39.8" Top="-0.45" Width="103.95" Height="18.9" Border.Lines="All" Text="[item.商品编号]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text8" Left="143.75" Top="-0.45" Width="103.95" Height="18.9" Border.Lines="All" Text="[item.商品名称]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text10" Left="247.7" Top="-0.45" Width="75.6" Height="18.9" Border.Lines="All" Text="[item.规格型号]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text12" Left="323.3" Top="-0.45" Width="56.7" Height="18.9" Border.Lines="All" Text="[item.单位]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text14" Left="380" Top="-0.45" Width="56.7" Height="18.9" Border.Lines="All" Text="[item.数量]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text15" Left="436.7" Top="-0.45" Width="75.6" Height="18.9" Border.Lines="All" Text="[item.原价]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text17" Left="569" Top="-0.45" Width="66.15" Height="18.9" Border.Lines="All" Text="[item.单价]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text50" Left="512.3" Top="-0.45" Width="56.7" Height="18.9" Border.Lines="All" Text="[item.折扣]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text52" Left="635.15" Top="-0.45" Width="75.6" Height="18.9" Border.Lines="All" Text="[item.金额]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text58" Left="2" Width="37.8" Height="18.9" Border.Lines="All" Text="[Row#]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" Top="165.2" Width="718.2" Height="75.6">
      <TextObject Name="Text35" Left="2" Top="-0.45" Width="567" Height="18.9" Border.Lines="All" Text="合计：（人民币大写）[ToUpper([main.金额])]" VertAlign="Center" Font="宋体, 9pt" LineHeight="11.34"/>
      <TextObject Name="Text41" Left="569" Top="-0.45" Width="141.75" Height="18.9" Border.Lines="All" Text="￥[main.金额]" Format="Number" Format.UseLocale="true" VertAlign="Center" Font="宋体, 9pt" LineHeight="11.34"/>
      <TextObject Name="Text62" Left="7.45" Top="25.35" Width="85.05" Height="18.9" Text="销售员：" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text63" Left="54.7" Top="25.35" Width="113.4" Height="18.9" Text="[main.业务员]" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text64" Left="177.55" Top="25.35" Width="85.05" Height="18.9" Text="录单人：" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text65" Left="234.25" Top="25.35" Width="103.95" Height="18.9" Text="[main.录单员]" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text66" Left="372" Top="25.35" Width="85.05" Height="18.9" Text="审核人：" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text67" Left="427.7" Top="25.35" Width="94.5" Height="18.9" Text="[main.审核人]" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text68" Left="555.55" Top="25.35" Width="85.05" Height="18.9" Text="审核时间：" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text69" Left="616.25" Top="25.35" Width="94.5" Height="18.9" Text="[main.审核时间]" VertAlign="Center" Font="宋体, 9pt"/>
    </ReportSummaryBand>
    <PageFooterBand Name="PageFooter1" Top="244.8" Width="718.2" Height="18.9"/>
  </ReportPage>
</Report>
