⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit6.pas

📁 发票套打功能
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{查找转让无形资产发票}
procedure TForm6.ZrwxzcFP();
Var
  {定义一个查询的条件Where}
  Tj, Tj1 : String ;
begin
try
   with CustomerData do
   begin
     //客户编码
     if CheckBox1.Checked then
     begin
        ADOQuery1.Close ;
        Tj := 'Where 客户名称 like '+''''+'%'+edit3.Text+'%'+'''' ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查v询的表名}
        ADOQuery1.SQL.Add('Select * From ZrwxzcFP ') ;
        ADOQuery1.SQL.Add(Tj) ;
        {开始查询}
        ADOQuery1.Open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录,如果要统计请单击上面 开始统计 按钮 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end
     else
     begin
        Tj := 'Where 日期 >= '+''''+edit1.Text+''''+' and 日期 <= '+''''+edit2.Text+'''';
        ADOQuery1.Close ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查询的表名}
        ADOQuery1.SQL.Add('Select * From ZrwxzcFP') ;
        //FPTJ.SQL.Add('Select * From '+Fppy) ;
        ADOQuery1.SQL.Add(Tj) ;
        {开始查询}
        ADOQuery1.open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end;
   end;
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
     exit ;
except
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
end;
end;
{查找其它服务业发票}
procedure TForm6.QtfwyFP() ;
Var
  {定义一个查询的条件Where}
  Tj, Tj1 : String ;
begin
try
   with CustomerData do
   begin
     //客户编码
     if CheckBox1.Checked then
     begin
        ADOQuery1.Close ;
        Tj := 'Where 客户名称 like '+''''+'%'+edit3.Text+'%'+'''' ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查v询的表名}
        ADOQuery1.SQL.Add('Select * From QtfwyFP ') ;
        ADOQuery1.SQL.Add(Tj) ;
        {开始查询}
        ADOQuery1.Open ;
        DBGridEh1.Columns.Items[0].Field.Visible := false ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录,如果要统计请单击上面 开始统计 按钮 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end
     else
     begin
        Tj := 'Where 日期 >= '+''''+edit1.Text+''''+' and 日期 <= '+''''+edit2.Text+'''';
        ADOQuery1.Close ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查询的表名}
        ADOQuery1.SQL.Add('Select * From QtfwyFP') ;
        //FPTJ.SQL.Add('Select * From '+Fppy) ;
        ADOQuery1.SQL.Add(Tj) ;
        ADOQuery1.SQL.Add(Tj1) ;
        {开始查询}
        ADOQuery1.open ;
        {如果没有记录则让查找为可用,统计为不可用}
        DBGridEh1.Columns.Items[0].Field.Visible := false ;
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end;
   end;
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
     exit ;
except
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
end;
end;
{查找转让不动产发票}
procedure TForm6.ZrbdcFP() ;
Var
  {定义一个查询的条件Where}
  Tj, Tj1 : String ;
begin
try
   with CustomerData do
   begin
     //客户编码
     if CheckBox1.Checked then
     begin
        ADOQuery1.Close ;
        Tj := 'Where 客户名称 like '+''''+'%'+edit3.Text+'%'+'''' ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查v询的表名}
        ADOQuery1.SQL.Add('Select * From ZrbdcFP ') ;
        ADOQuery1.SQL.Add(Tj) ;
        {开始查询}
        ADOQuery1.Open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录,如果要统计请单击上面 开始统计 按钮 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end
     else
     begin
        Tj := 'Where 日期 >= '+''''+edit1.Text+''''+' and 日期 <= '+''''+edit2.Text+'''';
        ADOQuery1.Close ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查询的表名}
        ADOQuery1.SQL.Add('Select * From ZrbdcFP') ;
        //FPTJ.SQL.Add('Select * From '+Fppy) ;
        ADOQuery1.SQL.Add(Tj) ;
        ADOQuery1.SQL.Add(Tj1) ;
        {开始查询}
        ADOQuery1.open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end;
   end;
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
     exit ;
except
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
end;
end;
{查找建筑业发票}
procedure TForm6.JzyFP() ;
Var
  {定义一个查询的条件Where}
  Tj, Tj1 : String ;
begin
try
   with CustomerData do
   begin
     //客户编码
     if CheckBox1.Checked then
     begin
        ADOQuery1.Close ;
        Tj := 'Where 客户名称 like '+''''+'%'+edit3.Text+'%'+'''' ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查v询的表名}
        ADOQuery1.SQL.Add('Select * From JzyFP ') ;
        ADOQuery1.SQL.Add(Tj) ;
        {开始查询}
        ADOQuery1.Prepared ;
        ADOQuery1.Open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额1') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录,如果要统计请单击上面 开始统计 按钮 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end
     else
     begin
        Tj := 'Where 日期 >= '+''''+edit1.Text+''''+' and 日期 <= '+''''+edit2.Text+'''';
        ADOQuery1.Close ;
        ADOQuery1.SQL.Clear ;
        {Fppy为要查询的表名}
        ADOQuery1.SQL.Add('Select * From JzyFP') ;
        //FPTJ.SQL.Add('Select * From '+Fppy) ;
        ADOQuery1.SQL.Add(Tj) ;
        ADOQuery1.SQL.Add(Tj1) ;
        {开始查询}
        ADOQuery1.Prepared ;
        ADOQuery1.open ;
        {如果没有记录则让查找为可用,统计为不可用}
        if ADOQuery1.RecordCount =0 then
        begin
            Application.MessageBox(PChar('对不起没有符合条件的记录 !'), PChar('提示'),MB_ICONINFORMATION);
            exit ;
        end;
        {显示共查找到多少条记录}
        StatusBar1.Panels[1].Text := inttostr(ADOQuery1.RecordCount);
        //统计金额
        TJJE('金额1') ;
        Application.MessageBox(PChar('一共找到 '+inttostr(ADOQuery1.RecordCount)+'  条记录 !'), PChar('提示'),MB_ICONINFORMATION);
        exit ;
     end;
   end;
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
     exit ;
except
     Application.MessageBox(PChar('对不起,没有此发票  !'), PChar('提示'),MB_ICONINFORMATION);
end;
end;
procedure TForm6.Button3Click(Sender: TObject);
begin
 PrintDBGridEh1.Preview ;
end;
procedure TForm6.N2Click(Sender: TObject);
begin
  Button3Click(Sender ) ;
end;

procedure TForm6.N1Click(Sender: TObject);
begin
try
  DBGridEh1.SelectedField.Visible := False  ;
except
  Application.MessageBox(PChar('当前没有数据  !'),PChar('提示'),MB_ICONERROR ) ;
end;
end;

procedure TForm6.imgCloseButtonClick(Sender: TObject);
begin
  close ;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -