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.

709 lines
24 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_fenzhang;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB,
ADODB, dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, wwdblook, RxLookup,
wwdbdatetimepicker, StdCtrls, Menus, ExtCtrls, XPMenu, kbmMemTable;
type
Tfrm_rp_fenzhang = class(TForm)
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
bsSkinTabSheet2: TbsSkinTabSheet;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
Panel1: TPanel;
bsSkinPanel1: TbsSkinPanel;
Label10: TLabel;
Label5: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
XPMenu1: TXPMenu;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
memtotal1: TDataSource;
dxDBGrid2: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
dxDBGridColumn4: TdxDBGridColumn;
memtotalItems1: TDataSource;
dxDBGrid2Column5: TdxDBGridColumn;
dxDBGrid2Column6: TdxDBGridColumn;
dxDBGrid2Column7: TdxDBGridColumn;
dxDBGrid2Column8: TdxDBGridColumn;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
memtotalItems: TkbmMemTable;
memtotalItemsField: TStringField;
memtotalItemsField2: TStringField;
memtotalItemsField3: TIntegerField;
memtotalItemsField4: TStringField;
memtotalItemsField5: TStringField;
memtotalItemsField6: TStringField;
memtotalItemsField7: TStringField;
memtotalItemsField8: TStringField;
memtotalItemsField9: TStringField;
dxDBGrid2Column9: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
Edit1: TEdit;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
memtotal: TkbmMemTable;
StringField1: TStringField;
FloatField1: TFloatField;
FloatField2: TFloatField;
FloatField3: TFloatField;
StringField2: TStringField;
FloatField4: TFloatField;
FloatField5: TFloatField;
StringField3: TStringField;
FloatField6: TFloatField;
dxDBGrid1Column10: TdxDBGridColumn;
memtotalField: TFloatField;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_fenzhang: Tfrm_rp_fenzhang;
implementation
uses u_main, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_rp_fenzhang.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_rp_fenzhang.Hide;
frm_rp_fenzhang.ManualFloat(frm_rp_fenzhang.BoundsRect );
frm_main.freeTabs('frm_rp_fenzhang');
action:=cafree;
frm_rp_fenzhang:=nil;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton6Click(Sender: TObject);
begin
Edit2.text:='1';
wwDBDateTimePicker1.text:='';
wwDBDateTimePicker2.text:='';
end;
procedure Tfrm_rp_fenzhang.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
str_fields:widestring;
zg_pxdp,fp,gg,ggggd,cq,cqgg,zg_1,f_count,f_other:Double;
aAdoQuery_count,aAdoQuery_fp,aAdoQuery_gg
,aAdoQuery_ggggd,aAdoQuery_cq,aAdoQuery_cqgg
,aAdoQuery_sales,aAdoQuery_op,aAdoQuery_zg_pxdp
,aAdoQuery_fp_act,aAdoQuery_fp_sales_act,aAdoQuery_ass_act,aAdoQuery_fp_op_act:TAdoQuery;
FCLcount,LCLcount:integer;
begin
f_count:=0;
f_other:=0;
aAdoQuery_count:=CreateAdoQuery_rpt();
aAdoQuery_fp:=CreateAdoQuery_rpt(); // <20><>Ʊ<EFBFBD><C6B1>
aAdoQuery_gg:=CreateAdoQuery_rpt(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
aAdoQuery_ggggd:=CreateAdoQuery_rpt(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
aAdoQuery_cq:=CreateAdoQuery_rpt(); // <20><><EFBFBD><EFBFBD>δ<EFBFBD>
aAdoQuery_cqgg:=CreateAdoQuery_rpt(); // <20><><EFBFBD><EFBFBD>δ<EFBFBD>
aAdoQuery_sales:=CreateAdoQuery_rpt(); // <20><><EFBFBD>ۻ<EFBFBD>0.5
aAdoQuery_op:=CreateAdoQuery_rpt(); // <20><><EFBFBD>ۻ<EFBFBD>0.5
aAdoQuery_zg_pxdp:=CreateAdoQuery_rpt(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD>䵥Ʊ
{
aAdoQuery_sales_Other:=CreateAdoQuery_rpt(); // <20><><EFBFBD>ۻ<EFBFBD>0.5
aAdoQuery_op_Other:=CreateAdoQuery_rpt(); // <20><><EFBFBD>ۻ<EFBFBD>0.5
aAdoQuery_zg_pxdp_Other:=CreateAdoQuery_rpt(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD>䵥Ʊ
}
aAdoQuery_fp_op_act:=CreateAdoQuery_rpt();
aAdoQuery_fp_act:=CreateAdoQuery_rpt();
aAdoQuery_fp_sales_act:=CreateAdoQuery_rpt();
aAdoQuery_ass_act:=CreateAdoQuery_rpt();
memtotal.Close;
memtotal.EmptyTable;
memtotal.CreateTable;
memtotal.Open;
////ʵ<><CAB5>Ʊ<EFBFBD><C6B1> <20><>ʼ
// <20><><EFBFBD><EFBFBD>
with aAdoQuery_fp_act do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD>䵥Ʊ
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա=t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_fp_op_act do //
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա<>t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_fp_sales_act do //
begin
Close;
SQL.Clear;
SQL.Add('select <20>ͷ<EFBFBD>Ա <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա<>t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('Group by <20>ͷ<EFBFBD>Ա');
SQL.Add('Order by <20>ͷ<EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_ass_act do // <20><>Ʊ<EFBFBD><C6B1>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae_assistant');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
/////ʵ<><CAB5>Ʊ<EFBFBD><C6B1> <20><><EFBFBD><EFBFBD>
// <20>ǽ<EFBFBD>ӥ<EFBFBD><D3A5><EFBFBD>˿ͻ<CBBF>
// <20>ͷ<EFBFBD>
with aAdoQuery_sales do //
begin
Close;
SQL.Clear;
SQL.Add('select <20>ͷ<EFBFBD>Ա <20><><EFBFBD><EFBFBD>Ա, sum(isnull(t_code_source_dl.<2E>ͷ<EFBFBD>ϵ<EFBFBD><CFB5>,t_code_source.ϵ<><CFB5>)) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('Left Join t_code_source_dl on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source_dl.ҵ<><D2B5><EFBFBD><EFBFBD>Դ AND t_op_seae.<2E><>Դ<EFBFBD><D4B4>ϸ=t_code_source_dl.<2E><>Դ<EFBFBD><D4B4>ϸ ');
SQL.Add('Left Join t_code_source on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source.ҵ<><D2B5><EFBFBD><EFBFBD>Դ ');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա<>t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('and ί<>е<EFBFBD>λ not in (''<27><>ӥ<EFBFBD><D3A5><EFBFBD>˿ͻ<CBBF>'')');
SQL.Add('Group by <20>ͷ<EFBFBD>Ա');
SQL.Add('Order by <20>ͷ<EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
// <20><><EFBFBD><EFBFBD>
with aAdoQuery_op do //
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, sum(isnull(t_code_source_dl.<2E><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>,t_code_source.ϵ<><CFB5>)) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('Left Join t_code_source_dl on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source_dl.ҵ<><D2B5><EFBFBD><EFBFBD>Դ AND t_op_seae.<2E><>Դ<EFBFBD><D4B4>ϸ=t_code_source_dl.<2E><>Դ<EFBFBD><D4B4>ϸ ');
SQL.Add('Left Join t_code_source on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source.ҵ<><D2B5><EFBFBD><EFBFBD>Դ ');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա<>t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add(' and ί<>е<EFBFBD>λ not in (''<27><>ӥ<EFBFBD><D3A5><EFBFBD>˿ͻ<CBBF>'')');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_zg_pxdp do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD>䵥Ʊ
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, sum(isnull(t_code_source_dl.<2E><><EFBFBD><EFBFBD><EFBFBD>Ϳͷ<CDBF><CDB7><EFBFBD>ͬϵ<CDAC><CFB5>,t_code_source.ϵ<><CFB5>)) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('Left Join t_code_source_dl on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source_dl.ҵ<><D2B5><EFBFBD><EFBFBD>Դ AND t_op_seae.<2E><>Դ<EFBFBD><D4B4>ϸ=t_code_source_dl.<2E><>Դ<EFBFBD><D4B4>ϸ ');
SQL.Add('Left Join t_code_source on t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ=t_code_source.ҵ<><D2B5><EFBFBD><EFBFBD>Դ ');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and t_op_seae.<2E><><EFBFBD><EFBFBD>Ա=t_op_seae.<2E>ͷ<EFBFBD>Ա and t_op_seae.ҵ<><D2B5><EFBFBD><EFBFBD>Դ<>'''' and װ<>˷<EFBFBD>ʽ in (''<27><><EFBFBD><EFBFBD>'',''ƴ<>䵥Ʊ'') and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add(' and ί<>е<EFBFBD>λ not in (''<27><>ӥ<EFBFBD><D3A5><EFBFBD>˿ͻ<CBBF>'')');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
// <20><>ӥ<EFBFBD><D3A5><EFBFBD>˿ͻ<CBBF>
// <20>ͷ<EFBFBD>
// <20><><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD>
with aAdoQuery_fp do // <20><>Ʊ<EFBFBD><C6B1>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae_assistant');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_gg do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=1 and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_ggggd do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ĵ<EFBFBD>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><=:EndEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=1 and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_cq do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('and ((<28><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,GetDate())>=15) or (not <20><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>=15))');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_cqgg do // //<2F><><EFBFBD>ڸ<EFBFBD><DAB8>Ļ<EFBFBD>
begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD>Ա, count(*) <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1> from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><=:EndEtd and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''<27><>ͨ<EFBFBD><CDA8>'' ');
SQL.Add('and ((<28><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,GetDate())>=15) or (not <20><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>)>=15))');
SQL.Add('Group by <20><><EFBFBD><EFBFBD>Ա');
SQL.Add('Order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Open;
end;
with aAdoQuery_count do
try
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ա,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (''<27><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>'',''<27><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>1<EFBFBD><31>'',''<27><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>2<EFBFBD><32>'',''<27><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>4<EFBFBD><34>'',''<27><><EFBFBD>ڲ<EFBFBD>'',''<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD><EFBFBD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''Σ<><CEA3>Ʒ<EFBFBD><EFBFBD><EAB1A8>'')');
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
{ SQL.Add('select distinct <20><><EFBFBD><EFBFBD>Ա from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd');
SQL.Add('order by <20><><EFBFBD><EFBFBD>Ա');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
}
Open;First;
while not Eof do
begin
zg_pxdp:=0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD>䵥Ʊ
f_other:=0;
fp:=0;//<2F><>Ʊ
gg:=0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
ggggd:=0;//<2F><><EFBFBD>ĸ<EFBFBD><C4B8>ĵ<EFBFBD>
cq:=0;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
cqgg:=0;// <20><><EFBFBD>ڸ<EFBFBD><DAB8>ĵ<EFBFBD>
{
aAdoQuery_zg_pxdp.Close;
aAdoQuery_zg_pxdp.Parameters.ParamByName('OpName').Value:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
aAdoQuery_zg_pxdp.Open;
aAdoQuery_fp.Close;
aAdoQuery_fp.Parameters.ParamByName('OpName').Value:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
aAdoQuery_fp.Open;
}
memtotal.Insert;
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
//<2F><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
if aAdoQuery_zg_pxdp.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
zg_pxdp:=zg_pxdp+aAdoQuery_zg_pxdp.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_Sales.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
// zg_pxdp:=zg_pxdp+aAdoQuery_Sales.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat/2;
zg_pxdp:=zg_pxdp+aAdoQuery_Sales.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_op.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
// zg_pxdp:=zg_pxdp+aAdoQuery_op.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat/2;
zg_pxdp:=zg_pxdp+aAdoQuery_op.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
// <20><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
{
if aAdoQuery_zg_pxdp_Other.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
zg_pxdp:=zg_pxdp+aAdoQuery_zg_pxdp_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat*1.3;
f_other:=f_other+aAdoQuery_zg_pxdp_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_Sales_Other.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
zg_pxdp:=zg_pxdp+aAdoQuery_Sales_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat/2*1.3;
f_other:=f_other+aAdoQuery_Sales_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_op_Other.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
zg_pxdp:=zg_pxdp+aAdoQuery_op_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat/2*1.3;
f_other:=f_other+aAdoQuery_op_Other.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
}
//end
if aAdoQuery_fp.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
fp:=aAdoQuery_fp.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat:=zg_pxdp*StrToFloat(Edit1.Text)+fp*StrToFloat(Edit2.Text);
if aAdoQuery_gg.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
gg:=aAdoQuery_gg.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_ggggd.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
ggggd:=aAdoQuery_ggggd.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat:=gg+ggggd;
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat:=zg_pxdp+fp*StrToFloat(Edit2.Text);
f_count:=f_count+memtotal.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
if aAdoQuery_cq.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
cq:=aAdoQuery_cq.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_cqgg.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
cqgg:=aAdoQuery_cqgg.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
memtotal.FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat:=cq+cqgg;
if f_other<>0 then
memtotal.FieldByName('<27><>ע').AsString:='<27><>ӥ<EFBFBD>ͻ<EFBFBD>Ʊ<EFBFBD><C6B1>:'+FloatToStr(f_other);
////
if aAdoQuery_fp_act.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
memtotal.FieldByName('<27><><EFBFBD>估ƴƱ<C6B4><C6B1><EFBFBD><EFBFBD>').AsFloat:=aAdoQuery_fp_act.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_fp_sales_act.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
memtotal.FieldByName('<27><><EFBFBD>估ƴƱ<C6B4>ͷ<EFBFBD>').AsFloat:=aAdoQuery_fp_sales_act.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_fp_op_act.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
memtotal.FieldByName('<27><><EFBFBD>估ƴƱ<C6B4><C6B1><EFBFBD><EFBFBD>Ա').AsFloat:=aAdoQuery_fp_op_act.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
if aAdoQuery_ass_act.Locate('<27><><EFBFBD><EFBFBD>Ա',FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString,[]) then
begin
memtotal.FieldByName('<27>ֵ<EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat:=aAdoQuery_ass_act.FieldByName('<27><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>').AsFloat;
end;
////
memtotal.Post;
Next;
end;
finally
aAdoQuery_count.Free;
aAdoQuery_fp.Free;
aAdoQuery_gg.Free;
aAdoQuery_ggggd.Free;
aAdoQuery_cq.Free;
aAdoQuery_cqgg.Free;
aAdoQuery_zg_pxdp.Free;
aAdoQuery_sales.Free;
aAdoQuery_op.Free;
{
aAdoQuery_zg_pxdp_Other.Free;
aAdoQuery_sales_Other.Free;
aAdoQuery_op_Other.Free;
}
aAdoQuery_fp_act.Free;
aAdoQuery_fp_sales_act.Free;
aAdoQuery_ass_act.Free;
aAdoQuery_fp_op_act.Free;
Label1.Caption:='<27><>Ʊ<EFBFBD><C6B1>:'+FloatToStr(f_count);
end;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton9Click(Sender: TObject);
begin
// sys_print('<27><><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,p_fenzhang1,p_sum_daili1,p_sum_currency1,nil,nil,nil,nil);
end;
procedure Tfrm_rp_fenzhang.FormShow(Sender: TObject);
begin
wwDBDateTimePicker1.Date:=Date;
wwDBDateTimePicker2.Date:=Date;
loadreggrid(dxdbgrid1,true,caption);
end;
procedure Tfrm_rp_fenzhang.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,97);
end;
procedure Tfrm_rp_fenzhang.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_rp_fenzhang.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_rp_fenzhang.bsSkinButton10Click(Sender);
end;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton1Click(Sender: TObject);
var aAdoQueryItem:TAdoQuery;
begin
memtotal.Close;
memtotal.EmptyTable;
memtotal.CreateTable;
memtotal.Open;
end;
procedure Tfrm_rp_fenzhang.bsSkinButton2Click(Sender: TObject);
var aAdoQueryItem:TAdoQuery;
LineNo:integer;
begin
memtotalItems.Close;
memtotalItems.EmptyTable;
memtotalItems.CreateTable;
memtotalItems.Open;
LineNo:=0;
aAdoQueryItem:=CreateAdoQuery_rpt();
with aAdoQueryItem do //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><=:EndEtd and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>Ա=:<3A><><EFBFBD><EFBFBD>Ա');
SQL.Add('and ((<28><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,GetDate())>=15) or (not <20><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>=15))');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>Ա').Value:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
Open;First;
while not eof do
begin
LineNo:=LineNo+1;
memtotalItems.Insert;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
memtotalItems.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtotalItems.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').AsDateTime);
if not FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').isnull then
memtotalItems.FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotalItems.FieldByName('<27>ͷ<EFBFBD>Ա').AsString:=FieldByName('<27>ͷ<EFBFBD>Ա').AsString;
memtotalItems.FieldByName('<27>к<EFBFBD>').AsInteger:=LineNo;
memtotalItems.Post;
next;
end;
end;
with aAdoQueryItem do // //<2F><><EFBFBD>ڸ<EFBFBD><DAB8>Ļ<EFBFBD>
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_seae');
SQL.Add('where <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>=:beginEtd and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><=:EndEtd and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''<27><>ͨ<EFBFBD><CDA8>'' and <20><><EFBFBD><EFBFBD>Ա=:<3A><><EFBFBD><EFBFBD>Ա ');
SQL.Add('and ((<28><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>,GetDate())>=15) or (not <20><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> is null and datediff(day,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>)>=15))');
Parameters.ParamByName('beginEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker1.Date);
Parameters.ParamByName('EndEtd').Value:=FormatDateTime('YYYY-MM-DD',wwDBDateTimePicker2.Date);
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>Ա').Value:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
Open;First;
while not eof do
begin
LineNo:=LineNo+1;
memtotalItems.Insert;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
memtotalItems.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
memtotalItems.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString;
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotalItems.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').AsDateTime);
if not FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').isnull then
memtotalItems.FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=FormatDateTime('YYYY-MM-DD',FieldByName('<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime);
memtotalItems.FieldByName('<27>ͷ<EFBFBD>Ա').AsString:=FieldByName('<27>ͷ<EFBFBD>Ա').AsString;
memtotalItems.FieldByName('<27>к<EFBFBD>').AsInteger:=LineNo;
memtotalItems.Post;
next;
end;
end;
end;
end.