You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

996 lines
34 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_rp_no_seae_accept;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL,
dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, bsSkinCtrls, ADODB, DB,
StdCtrls, XPMenu, Menus;
type
Tfrm_rp_no_seae = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
dxDBGrid1: TdxDBGrid;
p_accept_bill: TADOStoredProc;
p_accept_fee: TADOStoredProc;
p_accept_fee1: TDataSource;
p_accept_bill1: TDataSource;
bsSkinTabSheet3: TbsSkinTabSheet;
bsSkinTabSheet4: TbsSkinTabSheet;
p_pay_fee1: TDataSource;
p_pay_fee: TADOStoredProc;
p_pay_bill: TADOStoredProc;
p_pay_bill1: TDataSource;
p_total1: TDataSource;
p_total: TADOStoredProc;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridDateColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column22: TdxDBGridDateColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridMaskColumn;
dxDBGrid11: TdxDBGridMaskColumn;
dxDBGrid12: TdxDBGridMaskColumn;
dxDBGrid13: TdxDBGridMaskColumn;
dxDBGrid14: TdxDBGridMaskColumn;
dxDBGrid15: TdxDBGridMaskColumn;
dxDBGrid16: TdxDBGridMaskColumn;
dxDBGrid17: TdxDBGridMaskColumn;
dxDBGrid18: TdxDBGridMaskColumn;
dxDBGrid19: TdxDBGridMaskColumn;
dxDBGrid110: TdxDBGridMaskColumn;
dxDBGrid1Column50: TdxDBGridMaskColumn;
dxDBGrid1TEU: TdxDBGridMaskColumn;
dxDBGrid1Column52: TdxDBGridMaskColumn;
dxDBGrid1Column53: TdxDBGridMaskColumn;
dxDBGrid1Column54: TdxDBGridMaskColumn;
dxDBGrid1Column55: TdxDBGridMaskColumn;
dxDBGrid1Column56: TdxDBGridMaskColumn;
dxDBGrid1Column57: TdxDBGridMaskColumn;
dxDBGrid1Column58: TdxDBGridMaskColumn;
dxDBGrid1Column59: TdxDBGridMaskColumn;
dxDBGrid1Column60: TdxDBGridMaskColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column29: TdxDBGridColumn;
dxDBGrid3: TdxDBGrid;
dxDBGrid3Column1: TdxDBGridMaskColumn;
dxDBGrid3Column2: TdxDBGridMaskColumn;
dxDBGrid3Column3: TdxDBGridMaskColumn;
dxDBGrid3Column4: TdxDBGridMaskColumn;
dxDBGrid3Column5: TdxDBGridMaskColumn;
dxDBGrid3Column6: TdxDBGridMaskColumn;
dxDBGrid3Column7: TdxDBGridMaskColumn;
dxDBGrid3Column11: TdxDBGridDateColumn;
dxDBGrid3Column12: TdxDBGridMaskColumn;
dxDBGrid3Column13: TdxDBGridMaskColumn;
dxDBGrid3Column15: TdxDBGridMaskColumn;
dxDBGrid3Column16: TdxDBGridMaskColumn;
dxDBGrid3Column17: TdxDBGridMaskColumn;
dxDBGrid3Column18: TdxDBGridMaskColumn;
dxDBGrid3Column19: TdxDBGridDateColumn;
dxDBGrid3Column20: TdxDBGridMaskColumn;
dxDBGrid3Column21: TdxDBGridMaskColumn;
dxDBGrid3Column22: TdxDBGridMaskColumn;
dxDBGrid3Column23: TdxDBGridMaskColumn;
dxDBGrid3Column24: TdxDBGridMaskColumn;
dxDBGrid31: TdxDBGridMaskColumn;
dxDBGrid32: TdxDBGridMaskColumn;
dxDBGrid33: TdxDBGridMaskColumn;
dxDBGrid34: TdxDBGridMaskColumn;
dxDBGrid35: TdxDBGridMaskColumn;
dxDBGrid36: TdxDBGridMaskColumn;
dxDBGrid37: TdxDBGridMaskColumn;
dxDBGrid38: TdxDBGridMaskColumn;
dxDBGrid39: TdxDBGridMaskColumn;
dxDBGrid310: TdxDBGridMaskColumn;
dxDBGrid3Column47: TdxDBGridMaskColumn;
dxDBGrid3TEU: TdxDBGridMaskColumn;
dxDBGrid3Column49: TdxDBGridMaskColumn;
dxDBGrid3Column50: TdxDBGridMaskColumn;
dxDBGrid3Column51: TdxDBGridMaskColumn;
dxDBGrid3Column52: TdxDBGridMaskColumn;
dxDBGrid3Column53: TdxDBGridMaskColumn;
dxDBGrid3Column54: TdxDBGridMaskColumn;
dxDBGrid3Column55: TdxDBGridMaskColumn;
dxDBGrid3Column56: TdxDBGridMaskColumn;
dxDBGrid3Column8: TdxDBGridColumn;
dxDBGrid3Column9: TdxDBGridColumn;
dxDBGrid3Column10: TdxDBGridColumn;
dxDBGrid3Column25: TdxDBGridColumn;
dxDBGrid3Column26: TdxDBGridColumn;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn47: TdxDBGridMaskColumn;
dxDBGridMaskColumn48: TdxDBGridMaskColumn;
dxDBGridMaskColumn49: TdxDBGridMaskColumn;
dxDBGridMaskColumn50: TdxDBGridMaskColumn;
dxDBGridMaskColumn51: TdxDBGridMaskColumn;
dxDBGridMaskColumn52: TdxDBGridMaskColumn;
dxDBGridMaskColumn53: TdxDBGridMaskColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
dxDBGridDateColumn3: TdxDBGridDateColumn;
dxDBGridMaskColumn54: TdxDBGridMaskColumn;
dxDBGridMaskColumn55: TdxDBGridMaskColumn;
dxDBGridMaskColumn56: TdxDBGridMaskColumn;
dxDBGridMaskColumn57: TdxDBGridMaskColumn;
dxDBGridMaskColumn58: TdxDBGridMaskColumn;
dxDBGridMaskColumn59: TdxDBGridMaskColumn;
dxDBGridDateColumn4: TdxDBGridDateColumn;
dxDBGridMaskColumn60: TdxDBGridMaskColumn;
dxDBGridMaskColumn61: TdxDBGridMaskColumn;
dxDBGridMaskColumn62: TdxDBGridMaskColumn;
dxDBGridMaskColumn63: TdxDBGridMaskColumn;
dxDBGridMaskColumn64: TdxDBGridMaskColumn;
dxDBGridColumn15: TdxDBGridColumn;
dxDBGridColumn16: TdxDBGridColumn;
dxDBGridMaskColumn65: TdxDBGridMaskColumn;
dxDBGridMaskColumn66: TdxDBGridMaskColumn;
dxDBGridMaskColumn67: TdxDBGridMaskColumn;
dxDBGridMaskColumn68: TdxDBGridMaskColumn;
dxDBGridMaskColumn69: TdxDBGridMaskColumn;
dxDBGridMaskColumn70: TdxDBGridMaskColumn;
dxDBGridMaskColumn71: TdxDBGridMaskColumn;
dxDBGridMaskColumn72: TdxDBGridMaskColumn;
dxDBGridMaskColumn73: TdxDBGridMaskColumn;
dxDBGridMaskColumn74: TdxDBGridMaskColumn;
dxDBGridMaskColumn85: TdxDBGridMaskColumn;
dxDBGridMaskColumn86: TdxDBGridMaskColumn;
dxDBGridMaskColumn87: TdxDBGridMaskColumn;
dxDBGridMaskColumn88: TdxDBGridMaskColumn;
dxDBGridMaskColumn89: TdxDBGridMaskColumn;
dxDBGridMaskColumn90: TdxDBGridMaskColumn;
dxDBGridMaskColumn91: TdxDBGridMaskColumn;
dxDBGridMaskColumn92: TdxDBGridMaskColumn;
dxDBGridMaskColumn93: TdxDBGridMaskColumn;
dxDBGridMaskColumn94: TdxDBGridMaskColumn;
bsSkinTabSheet5: TbsSkinTabSheet;
bsSkinTabSheet6: TbsSkinTabSheet;
p_total_client: TADOStoredProc;
p_total_client1: TDataSource;
p_total_sales: TADOStoredProc;
p_total_sales1: TDataSource;
dxDBGrid6: TdxDBGrid;
dxDBGridMaskColumn95: TdxDBGridMaskColumn;
dxDBGridColumn17: TdxDBGridColumn;
dxDBGridColumn18: TdxDBGridColumn;
dxDBGridColumn19: TdxDBGridColumn;
dxDBGridColumn20: TdxDBGridColumn;
dxDBGridColumn21: TdxDBGridColumn;
dxDBGridColumn22: TdxDBGridColumn;
dxDBGridColumn23: TdxDBGridColumn;
dxDBGridColumn24: TdxDBGridColumn;
dxDBGridColumn25: TdxDBGridColumn;
dxDBGridColumn26: TdxDBGridColumn;
dxDBGridColumn27: TdxDBGridColumn;
dxDBGridColumn28: TdxDBGridColumn;
dxDBGridColumn29: TdxDBGridColumn;
dxDBGridColumn30: TdxDBGridColumn;
dxDBGridColumn31: TdxDBGridColumn;
dxDBGridColumn32: TdxDBGridColumn;
dxDBGridColumn33: TdxDBGridColumn;
dxDBGridColumn34: TdxDBGridColumn;
dxDBGridColumn35: TdxDBGridColumn;
dxDBGridColumn36: TdxDBGridColumn;
dxDBGridColumn37: TdxDBGridColumn;
dxDBGrid2: TdxDBGrid;
dxDBGridColumn59: TdxDBGridColumn;
dxDBGridColumn60: TdxDBGridColumn;
dxDBGridColumn61: TdxDBGridColumn;
dxDBGridColumn62: TdxDBGridColumn;
dxDBGridColumn63: TdxDBGridColumn;
dxDBGridColumn64: TdxDBGridColumn;
dxDBGridColumn65: TdxDBGridColumn;
dxDBGridColumn66: TdxDBGridColumn;
dxDBGridColumn67: TdxDBGridColumn;
dxDBGridColumn68: TdxDBGridColumn;
dxDBGridColumn69: TdxDBGridColumn;
dxDBGridColumn70: TdxDBGridColumn;
dxDBGridColumn71: TdxDBGridColumn;
dxDBGridColumn72: TdxDBGridColumn;
dxDBGridColumn73: TdxDBGridColumn;
dxDBGridColumn74: TdxDBGridColumn;
dxDBGridColumn75: TdxDBGridColumn;
dxDBGridColumn76: TdxDBGridColumn;
dxDBGridColumn77: TdxDBGridColumn;
dxDBGridColumn78: TdxDBGridColumn;
dxDBGridColumn79: TdxDBGridColumn;
dxDBGrid7: TdxDBGrid;
dxDBGridMaskColumn96: TdxDBGridMaskColumn;
dxDBGridColumn38: TdxDBGridColumn;
dxDBGridColumn39: TdxDBGridColumn;
dxDBGridColumn40: TdxDBGridColumn;
dxDBGridColumn41: TdxDBGridColumn;
dxDBGridColumn42: TdxDBGridColumn;
dxDBGridColumn43: TdxDBGridColumn;
dxDBGridColumn44: TdxDBGridColumn;
dxDBGridColumn45: TdxDBGridColumn;
dxDBGridColumn46: TdxDBGridColumn;
dxDBGridColumn47: TdxDBGridColumn;
dxDBGridColumn48: TdxDBGridColumn;
dxDBGridColumn49: TdxDBGridColumn;
dxDBGridColumn50: TdxDBGridColumn;
dxDBGridColumn51: TdxDBGridColumn;
dxDBGridColumn52: TdxDBGridColumn;
dxDBGridColumn53: TdxDBGridColumn;
dxDBGridColumn54: TdxDBGridColumn;
dxDBGridColumn55: TdxDBGridColumn;
dxDBGridColumn56: TdxDBGridColumn;
dxDBGridColumn57: TdxDBGridColumn;
dxDBGridColumn58: TdxDBGridColumn;
SaveDialog: TSaveDialog;
dxDBGrid1Column61: TdxDBGridColumn;
dxDBGrid1Column62: TdxDBGridColumn;
dxDBGrid3Column57: TdxDBGridColumn;
dxDBGrid3Column58: TdxDBGridColumn;
dxDBGrid5Column56: TdxDBGridColumn;
dxDBGrid5Column57: TdxDBGridColumn;
dxDBGrid1Column63: TdxDBGridColumn;
dxDBGrid3Column59: TdxDBGridColumn;
dxDBGrid5Column58: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
XPMenu1: TXPMenu;
dxDBGrid3Column60: TdxDBGridColumn;
dxDBGrid3Column61: TdxDBGridColumn;
dxDBGrid3Column62: TdxDBGridColumn;
dxDBGrid3Column63: TdxDBGridColumn;
dxDBGrid5Column49: TdxDBGridColumn;
dxDBGrid5Column50: TdxDBGridColumn;
dxDBGrid5Column51: TdxDBGridColumn;
dxDBGrid5Column52: TdxDBGridColumn;
dxDBGrid1Column68: TdxDBGridColumn;
dxDBGrid1Column69: TdxDBGridColumn;
dxDBGrid3Column64: TdxDBGridColumn;
dxDBGrid3Column65: TdxDBGridColumn;
dxDBGrid5Column53: TdxDBGridColumn;
dxDBGrid5Column54: TdxDBGridColumn;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn8: TdxDBGridColumn;
dxDBGridColumn9: TdxDBGridColumn;
dxDBGridColumn10: TdxDBGridColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridColumn80: TdxDBGridColumn;
dxDBGridColumn81: TdxDBGridColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridColumn82: TdxDBGridColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridColumn83: TdxDBGridColumn;
dxDBGridColumn84: TdxDBGridColumn;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridMaskColumn20: TdxDBGridMaskColumn;
dxDBGridMaskColumn21: TdxDBGridMaskColumn;
dxDBGridMaskColumn22: TdxDBGridMaskColumn;
dxDBGridMaskColumn23: TdxDBGridMaskColumn;
dxDBGridMaskColumn24: TdxDBGridMaskColumn;
dxDBGridMaskColumn25: TdxDBGridMaskColumn;
dxDBGridMaskColumn26: TdxDBGridMaskColumn;
dxDBGridMaskColumn27: TdxDBGridMaskColumn;
dxDBGridMaskColumn28: TdxDBGridMaskColumn;
dxDBGridMaskColumn29: TdxDBGridMaskColumn;
dxDBGridMaskColumn30: TdxDBGridMaskColumn;
dxDBGridMaskColumn31: TdxDBGridMaskColumn;
dxDBGridMaskColumn32: TdxDBGridMaskColumn;
dxDBGridMaskColumn33: TdxDBGridMaskColumn;
dxDBGridMaskColumn34: TdxDBGridMaskColumn;
dxDBGridMaskColumn35: TdxDBGridMaskColumn;
dxDBGridMaskColumn36: TdxDBGridMaskColumn;
dxDBGridColumn85: TdxDBGridColumn;
dxDBGridColumn86: TdxDBGridColumn;
dxDBGridColumn87: TdxDBGridColumn;
dxDBGridColumn88: TdxDBGridColumn;
dxDBGrid1Column70: TdxDBGridColumn;
dxDBGrid1Column71: TdxDBGridColumn;
dxDBGrid1Column72: TdxDBGridColumn;
dxDBGrid1Column73: TdxDBGridColumn;
dxDBGrid4Column55: TdxDBGridColumn;
dxDBGrid4Column56: TdxDBGridColumn;
dxDBGrid4Column57: TdxDBGridColumn;
dxDBGrid4Column58: TdxDBGridColumn;
dxDBGrid1Column64: TdxDBGridColumn;
dxDBGrid6Column23: TdxDBGridColumn;
dxDBGrid1Column65: TdxDBGridColumn;
dxDBGrid3Column66: TdxDBGridColumn;
dxDBGrid4Column59: TdxDBGridColumn;
dxDBGrid5Column55: TdxDBGridColumn;
dxDBGrid1Column66: TdxDBGridColumn;
dxDBGrid4Column60: TdxDBGridColumn;
dxDBGrid1Column67: TdxDBGridColumn;
dxDBGrid1Column74: TdxDBGridColumn;
Button1: TButton;
Button2: TButton;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinPanel2Resize(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid3ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid4ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid5ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid6ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid7ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure dxDBGrid3DblClick(Sender: TObject);
procedure dxDBGrid4DblClick(Sender: TObject);
procedure dxDBGrid5DblClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_no_seae: Tfrm_rp_no_seae;
implementation
uses u_main, my_sys_function,u_data_share, u_rp_seae_query;
{$R *.dfm}
procedure Tfrm_rp_no_seae.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_no_seae.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption+'1');
savereggrid(dxdbgrid3,caption+'3');
savereggrid(dxdbgrid4,caption+'4');
savereggrid(dxdbgrid5,caption+'5');
frm_rp_no_seae.Hide;
frm_rp_no_seae.ManualFloat(frm_rp_no_seae.BoundsRect );
frm_main.freeTabs('frm_rp_no_seae');
action:=cafree;
frm_rp_no_seae:=nil;
end;
procedure Tfrm_rp_no_seae.bsSkinPanel2Resize(Sender: TObject);
var
i:integer;
begin
i:=round(bsSkinPanel2.Width/7);
bsSkinCheckRadioBox1.Width:=i;
bsSkinCheckRadioBox2.Width:=i;
bsSkinCheckRadioBox3.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton1.Width:=i;
end;
procedure Tfrm_rp_no_seae.bsSkinButton1Click(Sender: TObject);
begin
with SaveDialog do
begin
DefaultExt :='xls';
Filter := '(*.xls)|*.xls';
if Execute then
begin
if bsSkinTabSheet1.Showing then
dxDBGrid1.SaveToXLS(FileName,true)
else if bsSkinTabSheet2.Showing then
dxDBGrid3.SaveToXLS(FileName,true)
else if bsSkinTabSheet3.Showing then
dxDBGrid4.SaveToXLS(FileName,true)
else if bsSkinTabSheet4.Showing then
dxDBGrid5.SaveToXLS(FileName,true)
else if bsSkinTabSheet5.Showing then
dxDBGrid6.SaveToXLS(FileName,true)
else if bsSkinTabSheet6.Showing then
dxDBGrid7.SaveToXLS(FileName,true);
end;
end;
end;
procedure Tfrm_rp_no_seae.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,true,caption+'1');
loadreggrid(dxdbgrid3,true,caption+'3');
loadreggrid(dxdbgrid4,true,caption+'4');
loadreggrid(dxdbgrid5,true,caption+'5');
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
begin
bsSkinTabSheet1.TabVisible:=true;
bsSkinTabSheet2.TabVisible:=true;
dxDBGridColumn17.Visible:=true;
dxDBGridColumn18.Visible:=true;
dxDBGridColumn19.Visible:=true;
dxDBGridColumn20.Visible:=true;
dxDBGridColumn21.Visible:=true;
dxDBGridColumn22.Visible:=true;
dxDBGridColumn23.Visible:=true;
dxDBGridColumn24.Visible:=true;
dxDBGridColumn25.Visible:=true;
dxDBGridColumn38.Visible:=true;
dxDBGridColumn39.Visible:=true;
dxDBGridColumn40.Visible:=true;
dxDBGridColumn41.Visible:=true;
dxDBGridColumn42.Visible:=true;
dxDBGridColumn43.Visible:=true;
dxDBGridColumn44.Visible:=true;
dxDBGridColumn45.Visible:=true;
dxDBGridColumn46.Visible:=true;
dxDBGridColumn59.Visible:=true;
dxDBGridColumn60.Visible:=true;
dxDBGridColumn61.Visible:=true;
dxDBGridColumn62.Visible:=true;
dxDBGridColumn63.Visible:=true;
dxDBGridColumn64.Visible:=true;
dxDBGridColumn65.Visible:=true;
dxDBGridColumn66.Visible:=true;
dxDBGridColumn67.Visible:=true;
end
else
begin
bsSkinTabSheet1.TabVisible:=false;
bsSkinTabSheet2.TabVisible:=false;
dxDBGridColumn17.Visible:=false;
dxDBGridColumn18.Visible:=false;
dxDBGridColumn19.Visible:=false;
dxDBGridColumn20.Visible:=false;
dxDBGridColumn21.Visible:=false;
dxDBGridColumn22.Visible:=false;
dxDBGridColumn23.Visible:=false;
dxDBGridColumn24.Visible:=false;
dxDBGridColumn25.Visible:=false;
dxDBGridColumn38.Visible:=false;
dxDBGridColumn39.Visible:=false;
dxDBGridColumn40.Visible:=false;
dxDBGridColumn41.Visible:=false;
dxDBGridColumn42.Visible:=false;
dxDBGridColumn43.Visible:=false;
dxDBGridColumn44.Visible:=false;
dxDBGridColumn45.Visible:=false;
dxDBGridColumn46.Visible:=false;
dxDBGridColumn59.Visible:=false;
dxDBGridColumn60.Visible:=false;
dxDBGridColumn61.Visible:=false;
dxDBGridColumn62.Visible:=false;
dxDBGridColumn63.Visible:=false;
dxDBGridColumn64.Visible:=false;
dxDBGridColumn65.Visible:=false;
dxDBGridColumn66.Visible:=false;
dxDBGridColumn67.Visible:=false;
end;
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
begin
bsSkinTabSheet3.TabVisible:=true;
bsSkinTabSheet4.TabVisible:=true;
dxDBGridColumn26.Visible:=true;
dxDBGridColumn27.Visible:=true;
dxDBGridColumn28.Visible:=true;
dxDBGridColumn29.Visible:=true;
dxDBGridColumn30.Visible:=true;
dxDBGridColumn31.Visible:=true;
dxDBGridColumn32.Visible:=true;
dxDBGridColumn33.Visible:=true;
dxDBGridColumn34.Visible:=true;
dxDBGridColumn47.Visible:=true;
dxDBGridColumn48.Visible:=true;
dxDBGridColumn49.Visible:=true;
dxDBGridColumn50.Visible:=true;
dxDBGridColumn51.Visible:=true;
dxDBGridColumn52.Visible:=true;
dxDBGridColumn53.Visible:=true;
dxDBGridColumn54.Visible:=true;
dxDBGridColumn55.Visible:=true;
dxDBGridColumn68.Visible:=true;
dxDBGridColumn69.Visible:=true;
dxDBGridColumn70.Visible:=true;
dxDBGridColumn71.Visible:=true;
dxDBGridColumn72.Visible:=true;
dxDBGridColumn73.Visible:=true;
dxDBGridColumn74.Visible:=true;
dxDBGridColumn75.Visible:=true;
dxDBGridColumn76.Visible:=true;
end
else
begin
bsSkinTabSheet3.TabVisible:=false;
bsSkinTabSheet4.TabVisible:=false;
dxDBGridColumn26.Visible:=false;
dxDBGridColumn27.Visible:=false;
dxDBGridColumn28.Visible:=false;
dxDBGridColumn29.Visible:=false;
dxDBGridColumn30.Visible:=false;
dxDBGridColumn31.Visible:=false;
dxDBGridColumn32.Visible:=false;
dxDBGridColumn33.Visible:=false;
dxDBGridColumn34.Visible:=false;
dxDBGridColumn47.Visible:=false;
dxDBGridColumn48.Visible:=false;
dxDBGridColumn49.Visible:=false;
dxDBGridColumn50.Visible:=false;
dxDBGridColumn51.Visible:=false;
dxDBGridColumn52.Visible:=false;
dxDBGridColumn53.Visible:=false;
dxDBGridColumn54.Visible:=false;
dxDBGridColumn55.Visible:=false;
dxDBGridColumn68.Visible:=false;
dxDBGridColumn69.Visible:=false;
dxDBGridColumn70.Visible:=false;
dxDBGridColumn71.Visible:=false;
dxDBGridColumn72.Visible:=false;
dxDBGridColumn73.Visible:=false;
dxDBGridColumn74.Visible:=false;
dxDBGridColumn75.Visible:=false;
dxDBGridColumn76.Visible:=false;
end;
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean
and frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
begin
dxDBGridColumn35.Visible:=true;
dxDBGridColumn36.Visible:=true;
dxDBGridColumn37.Visible:=true;
dxDBGridColumn56.Visible:=true;
dxDBGridColumn57.Visible:=true;
dxDBGridColumn58.Visible:=true;
dxDBGridColumn77.Visible:=true;
dxDBGridColumn78.Visible:=true;
dxDBGridColumn79.Visible:=true;
end
else
begin
dxDBGridColumn35.Visible:=false;
dxDBGridColumn36.Visible:=false;
dxDBGridColumn37.Visible:=false;
dxDBGridColumn56.Visible:=false;
dxDBGridColumn57.Visible:=false;
dxDBGridColumn58.Visible:=false;
dxDBGridColumn77.Visible:=false;
dxDBGridColumn78.Visible:=false;
dxDBGridColumn79.Visible:=false;
end;
end;
procedure Tfrm_rp_no_seae.bsSkinButton9Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>Ƿ<EFBFBD><C7B7>',2,nil,nil,nil,nil,p_accept_bill1,p_accept_fee1,p_pay_bill1,p_pay_fee1,p_total_client1,p_total_sales1,p_total1);
end;
procedure Tfrm_rp_no_seae.bsSkinButton10Click(Sender: TObject);
begin
try
{
if p_total.Active then p_total.close;
p_total1.DataSet:=nil;
if p_total_client.Active then p_total_client.close;
p_total_client1.DataSet:=nil;
if p_total_sales.Active then p_total_sales.close;
p_total_sales1.DataSet:=nil;
if p_accept_bill.Active then p_accept_bill.close;
p_accept_bill1.DataSet:=nil;
if p_accept_fee.Active then p_accept_fee.close;
p_accept_fee1.DataSet:=nil;
if p_pay_bill.Active then p_pay_bill.close;
p_pay_bill1.DataSet:=nil;
if p_pay_fee.Active then p_pay_fee.close;
p_pay_fee1.DataSet:=nil;
}
frm_rp_seae_query:=tfrm_rp_seae_query.Create (self);
rp_seae_query_num:=1;
if bsSkinCheckRadioBox1.Checked then
rp_seae_query_type:=1
else if bsSkinCheckRadioBox2.Checked then
rp_seae_query_type:=2
else
rp_seae_query_type:=3;
rp_seae_query_limited:='0033';
// rp_seae_query_limited:='no';
rp_seae_query_str:='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>Ƿ<EFBFBD><C7B7>';
frm_rp_seae_query.ShowModal;
finally
frm_rp_seae_query.Free;
end;
end;
procedure Tfrm_rp_no_seae.N10Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid_view_no(dxdbgrid1);
exit;
end;
if bsSkinTabSheet2.showing then
begin
update_grid_view_no(dxdbgrid3);
exit;
end;
if bsSkinTabSheet3.showing then
begin
update_grid_view_no(dxdbgrid4);
exit;
end;
if bsSkinTabSheet4.showing then
begin
update_grid_view_no(dxdbgrid5);
exit;
end;
if bsSkinTabSheet5.showing then
begin
update_grid_view_no(dxdbgrid6);
exit;
end;
if bsSkinTabSheet6.showing then
begin
update_grid_view_no(dxdbgrid7);
exit;
end;
end;
procedure Tfrm_rp_no_seae.N14Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid_view_all(dxdbgrid1);
exit;
end;
if bsSkinTabSheet2.showing then
begin
update_grid_view_all(dxdbgrid3);
exit;
end;
if bsSkinTabSheet3.showing then
begin
update_grid_view_all(dxdbgrid4);
exit;
end;
if bsSkinTabSheet4.showing then
begin
update_grid_view_all(dxdbgrid5);
exit;
end;
if bsSkinTabSheet5.showing then
begin
update_grid_view_all(dxdbgrid6);
exit;
end;
if bsSkinTabSheet6.showing then
begin
update_grid_view_all(dxdbgrid7);
exit;
end;
end;
procedure Tfrm_rp_no_seae.N12Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
update_grid(dxdbgrid1,16);
exit;
end;
if bsSkinTabSheet2.showing then
begin
update_grid(dxdbgrid3,17);
exit;
end;
if bsSkinTabSheet3.showing then
begin
update_grid(dxdbgrid4,18);
exit;
end;
if bsSkinTabSheet4.showing then
begin
update_grid(dxdbgrid5,19);
exit;
end;
if bsSkinTabSheet5.showing then
begin
update_grid(dxdbgrid6,20);
exit;
end;
if bsSkinTabSheet6.showing then
begin
update_grid(dxdbgrid7,21);
exit;
end;
end;
procedure Tfrm_rp_no_seae.N16Click(Sender: TObject);
begin
if bsSkinTabSheet1.showing then
begin
grid_save_xls(dxdbgrid1);
exit;
end;
if bsSkinTabSheet2.showing then
begin
grid_save_xls(dxdbgrid3);
exit;
end;
if bsSkinTabSheet3.showing then
begin
grid_save_xls(dxdbgrid4);
exit;
end;
if bsSkinTabSheet4.showing then
begin
grid_save_xls(dxdbgrid5);
exit;
end;
if bsSkinTabSheet5.showing then
begin
grid_save_xls(dxdbgrid6);
exit;
end;
if bsSkinTabSheet6.showing then
begin
grid_save_xls(dxdbgrid7);
exit;
end;
end;
procedure Tfrm_rp_no_seae.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_accept_bill,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid3ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_accept_fee,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid4ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_pay_bill,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid5ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_pay_fee,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid6ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_total_client,'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid7ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_total_sales,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_no_seae.dxDBGrid1DblClick(Sender: TObject);
begin
fee_view(p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_seae.dxDBGrid3DblClick(Sender: TObject);
begin
fee_view(p_accept_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_seae.dxDBGrid4DblClick(Sender: TObject);
begin
fee_view(p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_seae.dxDBGrid5DblClick(Sender: TObject);
begin
fee_view(p_pay_fee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
end;
procedure Tfrm_rp_no_seae.Button1Click(Sender: TObject);
var
sl:TStringList;
stemp,custname,INVO:string;
function getInvNo(bsno,custname,curr:string):string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;sql.Add('select dbo.F_GetDrInvNoStr('''+bsno+''','''+custname+''','''+curr+''') AS INVNO ');
Open;
if (not IsEmpty) then Result:='"'+fieldbyname('INVNO').AsString+'"';
end;
finally
FreeAndNil(aQuery);
end;
end;
begin
sl:=TStringList.Create;
try
sl.Add('<27><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SAP<41><50><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>ұ<EFBFBD><D2B1><EFBFBD>,<2C><>˰ԭ<CBB0>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><>˰<EFBFBD><CBB0><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>˰ԭ<CBB0>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ,<2C><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>,<2C><>Ʊ<EFBFBD><C6B1>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ײ<EFBFBD>Ʒ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
p_accept_bill.First;
while not p_accept_bill.Eof do begin
custname:=p_accept_bill.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
if Pos(',',custname)>1 then custname:='"'+custname+'"';
if (p_accept_bill.FieldByName('Ӧ<><D3A6>RMB').AsFloat<>0) then begin
INVO:=getInvNo(p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,p_accept_bill.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'RMB');
stemp:='<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><><C9BD>)<29><><EFBFBD>޹<EFBFBD>˾,'+custname+','+p_accept_bill.fieldbyname('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').asstring+',Ӧ<><D3A6>,'+FormatDateTime('yyyy-mm-dd',p_accept_bill.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime) +',';
stemp:=stemp+p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,'+p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+',CNY,'+p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+',';
stemp:=stemp+p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+','+p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+','+p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+',';
stemp:=stemp+p_accept_bill.fieldbyname('<27><>TEU').asstring+',TEU,1,0,0,'+INVO+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,<2C><><EFBFBD>漰';
sl.Add(stemp);
end;
if (p_accept_bill.FieldByName('Ӧ<><D3A6>USD').AsFloat<>0) then begin
INVO:=getInvNo(p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,p_accept_bill.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'USD');
stemp:='<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><><C9BD>)<29><><EFBFBD>޹<EFBFBD>˾,'+custname+','+p_accept_bill.fieldbyname('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').asstring+',Ӧ<><D3A6>,'+FormatDateTime('yyyy-mm-dd',p_accept_bill.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime) +',';
stemp:=stemp+p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,'+p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+',USD,'+p_accept_bill.fieldbyname('Ӧ<><D3A6>USD').asstring+',';
stemp:=stemp+floattostr(p_accept_bill.fieldbyname('Ӧ<>պϼ<D5BA>').asfloat-p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asfloat)+','+p_accept_bill.fieldbyname('Ӧ<><D3A6>USD').asstring+','+floattostr(p_accept_bill.fieldbyname('Ӧ<>պϼ<D5BA>').asfloat-p_accept_bill.fieldbyname('Ӧ<><D3A6>RMB').asfloat)+',';
stemp:=stemp+p_accept_bill.fieldbyname('<27><>TEU').asstring+',TEU,'+p_accept_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',0,0,'+INVO+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,<2C><><EFBFBD>漰';
sl.Add(stemp);
end;
p_accept_bill.Next;
end;
with SaveDialog do
begin
DefaultExt :='csv';
Filter := '(*.csv)|*.csv';
if Execute then
begin
sl.SaveToFile(FileName);
end;
end;
finally
FreeAndNil(sl);
end;
end;
procedure Tfrm_rp_no_seae.Button2Click(Sender: TObject);
var
sl:TStringList;
stemp,custname,INVO:string;
function getInvNo(bsno,custname,curr:string):string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;sql.Add('select dbo.F_GetCrInvNoStr('''+bsno+''','''+custname+''','''+curr+''') AS INVNO ');
Open;
if (not IsEmpty) then Result:='"'+fieldbyname('INVNO').AsString+'"';
end;
finally
FreeAndNil(aQuery);
end;
end;
begin
sl:=TStringList.Create;
try
sl.Add('<27><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>SAP<41><50><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>ұ<EFBFBD><D2B1><EFBFBD>,<2C><>˰ԭ<CBB0>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><>˰<EFBFBD><CBB0><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>˰ԭ<CBB0>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ,<2C><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>,<2C><>Ʊ<EFBFBD><C6B1>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ײ<EFBFBD>Ʒ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
p_pay_bill.First;
while not p_pay_bill.Eof do begin
custname:=p_pay_bill.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').asstring;
if Pos(',',custname)>1 then custname:='"'+custname+'"';
if (p_pay_bill.FieldByName('Ӧ<><D3A6>RMB').AsFloat<>0) then begin
INVO:=getInvNo(p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,p_pay_bill.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'RMB');
stemp:='<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><><C9BD>)<29><><EFBFBD>޹<EFBFBD>˾,'+custname+','+p_pay_bill.fieldbyname('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').asstring+',Ӧ<><D3A6>,'+FormatDateTime('yyyy-mm-dd',p_pay_bill.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime) +',';
stemp:=stemp+p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,'+p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+',CNY,'+p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+',';
stemp:=stemp+p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+','+p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+','+p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asstring+',';
stemp:=stemp+p_pay_bill.fieldbyname('<27><>TEU').asstring+',TEU,1,0,0,'+INVO+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,<2C><><EFBFBD>漰';
sl.Add(stemp);
end;
if (p_pay_bill.FieldByName('Ӧ<><D3A6>USD').AsFloat<>0) then begin
INVO:=getInvNo(p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,p_pay_bill.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,'USD');
stemp:='<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><><C9BD>)<29><><EFBFBD>޹<EFBFBD>˾,'+custname+','+p_pay_bill.fieldbyname('<27><><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>').asstring+',Ӧ<><D3A6>,'+FormatDateTime('yyyy-mm-dd',p_pay_bill.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime) +',';
stemp:=stemp+p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,'+p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+',USD,'+p_pay_bill.fieldbyname('Ӧ<><D3A6>USD').asstring+',';
stemp:=stemp+floattostr(p_pay_bill.fieldbyname('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').asfloat-p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asfloat)+','+p_pay_bill.fieldbyname('Ӧ<><D3A6>USD').asstring+','+floattostr(p_pay_bill.fieldbyname('Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>').asfloat-p_pay_bill.fieldbyname('Ӧ<><D3A6>RMB').asfloat)+',';
stemp:=stemp+p_pay_bill.fieldbyname('<27><>TEU').asstring+',TEU,'+p_pay_bill.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',0,0,'+INVO+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>,<2C><><EFBFBD>漰';
sl.Add(stemp);
end;
p_pay_bill.Next;
end;
with SaveDialog do
begin
DefaultExt :='csv';
Filter := '(*.csv)|*.csv';
if Execute then
begin
sl.SaveToFile(FileName);
end;
end;
finally
FreeAndNil(sl);
end;
end;
end.