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.

2013 lines
104 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_monthtotal;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, ComCtrls, bsSkinTabs, DB, ADODB,DateUtils,
dxExEdtr, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner,
kbmMemTable, kbmMemBinaryStreamFormat, Menus, StdCtrls,
wwdbdatetimepicker, Grids, DBGridEh, Mask, wwdbedit, Wwdotdot, Wwdbcomb,
RxLookup, DBGrids;
type
Tfrm_rp_no_monthtotal = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinButton5: TbsSkinButton;
kbmBinaryStreamFormat1: TkbmBinaryStreamFormat;
kbmThreadDataSet1: TkbmThreadDataSet;
memtblDetail: TkbmMemTable;
p_total1: TDataSource;
bsSkinPanel1: TbsSkinPanel;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGridMaskColumn95: TdxDBGridMaskColumn;
memtotal1: TDataSource;
memtotal: TkbmMemTable;
memtotalField: TStringField;
memtotalField2: TFloatField;
bsSkinRadioGroup1: TbsSkinRadioGroup;
bsSkinPanel3: TbsSkinPanel;
Label3: TLabel;
Label13: TLabel;
Label14: TLabel;
Label4: TLabel;
Label1: TLabel;
Label2: TLabel;
Label5: TLabel;
Label6: TLabel;
cbmonth: TwwDBComboBox;
cbYear: TwwDBComboBox;
RxDBLookupCombo5: TRxDBLookupCombo;
RxDBLookupCombo3: TRxDBLookupCombo;
cbeYear: TwwDBComboBox;
cbemonth: TwwDBComboBox;
Label68: TLabel;
wwDBComboBox31: TwwDBComboBox;
bsSkinTabSheet2: TbsSkinTabSheet;
dxDBGrid2: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid2Column59: TdxDBGridColumn;
dxDBGrid1Column54: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column64: TdxDBGridColumn;
dxDBGrid1Column67: TdxDBGridColumn;
dxDBGrid1Column65: TdxDBGridColumn;
dxDBGrid1Column66: TdxDBGridColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridDateColumn;
dxDBGrid1Column63: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column22: TdxDBGridDateColumn;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridMaskColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column29: TdxDBGridColumn;
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;
dxDBGrid1Column55: TdxDBGridMaskColumn;
dxDBGrid1Column56: TdxDBGridMaskColumn;
dxDBGrid1Column57: TdxDBGridMaskColumn;
dxDBGrid1Column58: TdxDBGridMaskColumn;
dxDBGrid1Column59: TdxDBGridMaskColumn;
dxDBGrid1Column60: TdxDBGridMaskColumn;
dxDBGrid1Column61: TdxDBGridColumn;
dxDBGrid1Column62: TdxDBGridColumn;
dxDBGrid1Column68: TdxDBGridColumn;
dxDBGrid1Column69: TdxDBGridColumn;
dxDBGrid2Column60: TdxDBGridColumn;
dxDBGrid2Column61: TdxDBGridColumn;
dxDBGrid2Column62: TdxDBGridColumn;
dxDBGrid2Column63: TdxDBGridColumn;
dxDBGrid2Column64: TdxDBGridColumn;
dxDBGrid2Column65: TdxDBGridColumn;
dxDBGrid2Column66: TdxDBGridColumn;
dxDBGrid2Column67: TdxDBGridColumn;
dxDBGrid2Column68: TdxDBGridColumn;
p_detail: TADOStoredProc;
p_detail1: TDataSource;
dxDBGrid2Column69: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
Label40: TLabel;
RxDBLookupCombo15: TRxDBLookupCombo;
Label22: TLabel;
RxDBLookupCombo10: TRxDBLookupCombo;
RxDBLookupCombo12: TRxDBLookupCombo;
Label23: TLabel;
bsSkinButton10: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
dxDBGrid2Column70: TdxDBGridColumn;
bsSkinRadioGroup2: TbsSkinRadioGroup;
bsSkinRadioGroup3: TbsSkinRadioGroup;
bsSkinCheckGroup1: TbsSkinCheckGroup;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinCheckRadioBox3Click(Sender: TObject);
procedure bsSkinCheckRadioBox2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure memtblDetailAfterOpen(DataSet: TDataSet);
private
procedure GetNoFee;
procedure GetsaleNoFee;
procedure GetcustsaleNoFee;
procedure Creatememtbl;
function getleftstr(substr:String;leng:integer;left:boolean=true):String;
function getzq(cust:string):string;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_no_monthtotal: Tfrm_rp_no_monthtotal;
FmDate,ToDate:String;
sqlstr:WideString;
implementation
uses u_main, my_sys_function,u_sys_progress, u_data_share;
{$R *.dfm}
procedure Tfrm_rp_no_monthtotal.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_no_monthtotal.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid2,caption+'2');
frm_rp_no_monthtotal.Hide;
frm_rp_no_monthtotal.ManualFloat(frm_rp_no_monthtotal.BoundsRect );
frm_main.freeTabs('frm_rp_no_monthtotal');
action:=cafree;
frm_rp_no_monthtotal:=nil;
end;
procedure Tfrm_rp_no_monthtotal.bsSkinButton10Click(Sender: TObject);
begin
if cbyear.Text='' then begin
MessageDlg('ͳ<><CDB3><EFBFBD><EFBFBD><EAB2BB>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
exit;
end;
if cbeyear.Text='' then begin
MessageDlg('ͳ<><CDB3><EFBFBD><EFBFBD><EAB2BB>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
exit;
end;
if cbmonth.Text='' then begin
MessageDlg('ͳ<><CDB3><EFBFBD>²<EFBFBD><C2B2><EFBFBD>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
exit;
end;
if cbemonth.Text='' then begin
MessageDlg('ͳ<><CDB3><EFBFBD>²<EFBFBD><C2B2><EFBFBD>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
exit;
end;
if EncodeDate(strtoint(cbyear.text),strtoint(cbmonth.Text),1)>EncodeDate(strtoint(cbeyear.text),strtoint(cbemonth.Text),1) then begin
MessageDlg('<27><>ʼ<EFBFBD><CABC><EFBFBD>ڲ<EFBFBD><DAB2>ܴ<EFBFBD><DCB4>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
exit;
end;
Creatememtbl;
if bsSkinRadioGroup1.ItemIndex=0 then
GetNoFee
else if bsSkinRadioGroup1.ItemIndex=1 then
GetsaleNoFee
else if bsSkinRadioGroup1.ItemIndex=2 then
GetcustsaleNoFee
end;
procedure Tfrm_rp_no_monthtotal.bsSkinButton9Click(Sender: TObject);
begin
sys_print('ҵ<><D2B5><EFBFBD>ۺ<EFBFBD>Ƿ<EFBFBD><C7B7>',2,nil,nil,nil,nil,p_total1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_rp_no_monthtotal.GetNoFee;
var
aQuery:TAdoQuery;
aDate,aToDate:TDate;
strdate,stredate,sDate:String;
i:integer;
// S:TChartSeries;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
aDate:=EncodeDate(strtoint(cbYear.Text),strtoint(cbmonth.Text),1);
aToDate:=EncodeDate(strtoint(cbeYear.Text),strtoint(cbemonth.Text),2);
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
if MonthsBetween(aDate,aToDate)=0 then
frm_sys_progress.bsSkinGauge1.MaxValue:=1
else
frm_sys_progress.bsSkinGauge1.MaxValue:=MonthsBetween(aDate,aToDate);
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
while not (aDate>aToDate) do begin
strdate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
stredate:=FormatDateTime('YYYY-MM-DD',aDate);
sDate:=FormatDateTime('YYYYMM',aDate);
CLOSE;
SQL.Clear;
SQL.Add('Select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>, ');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<>պϼ<D5BA>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>');
SQL.Add(',sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD><>0 and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+strdate+'''');
if RxDBLookupCombo5.DisplayValues[1]<>'' then
SQL.Add(' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''');
if wwDBComboBox31.Text<>'' then begin
SQL.Add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''');
end;
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''');
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''');
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''');
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''');
end;
case bsSkinRadioGroup3.ItemIndex of
0,1:;
2:begin
SQL.Add(' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> in (select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_crm_client where <20><><EFBFBD><EFBFBD>=1)');
end;
end;
SQL.Add(' and '+open_data('0033','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա','no','no','no'));
SQL.Add('group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ');
Open;
if not IsEmpty then begin
first;
while not eof do begin
if memtblDetail.Locate('ͳ<>Ʊ<EFBFBD>׼',FieldbyName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then begin
memtblDetail.Edit;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
end;
end;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
end;
end;
end;
if (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
// memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
// memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
end;
end;
end;
memtblDetail.Post;
end else begin
memtblDetail.Insert;
for i:=0 to memtbldetail.FieldCount-1 do begin
if memtbldetail.Fields[i].FieldName='ͳ<>Ʊ<EFBFBD>׼' then begin
memtbldetail.Fields[i].AsString:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString
end else if memtbldetail.Fields[i].FieldName='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>' then begin
memtbldetail.Fields[i].AsString:=getzq(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
end else if memtbldetail.Fields[i].FieldName='<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>' then begin
if frm_data_share.t_crm_client_all.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,[])then
memtbldetail.Fields[i].AsString:=frm_data_share.t_crm_client_all.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
end else
memtbldetail.Fields[i].AsFloat:=0;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
end;
end;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then
begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
end;
end;
end;
if (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: //all
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
// memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
// memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat+memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
end;
1: //rmb
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
end;
2: //usd
begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
end;
end;
end;
memtblDetail.Post;
end;
Next;
end;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
aDate:=IncMonth(aDate,1);
end;
end;
finally
FreeAndNil(aQuery);
freeAndNil(frm_sys_progress);
end;
end;
procedure Tfrm_rp_no_monthtotal.GetsaleNoFee;
var
aQuery:TAdoQuery;
aDate,aToDate:TDate;
strdate,stredate,sDate:String;
i:integer;
// S:TChartSeries;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
aDate:=EncodeDate(strtoint(cbYear.Text),strtoint(cbmonth.Text),1);
aToDate:=EncodeDate(strtoint(cbeYear.Text),strtoint(cbemonth.Text),2);
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=MonthsBetween(aDate,aToDate);
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
while not (aDate>aToDate) do begin
strdate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
stredate:=FormatDateTime('YYYY-MM-DD',aDate);
sDate:=FormatDateTime('YYYYMM',aDate);
CLOSE;
SQL.Clear;
SQL.Add('Select v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<>պϼ<D5BA>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>');
SQL.Add(',sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+strdate+'''');
if RxDBLookupCombo5.DisplayValues[1]<>'' then
SQL.Add(' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''');
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
SQL.Add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''');
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''');
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''');
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''');
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''');
end;
SQL.Add(' and '+open_data('0033','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա','no','no','no'));
SQL.Add('group by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ');
Open;
if not IsEmpty then begin
first;
while not eof do begin
if memtblDetail.Locate('ͳ<>Ʊ<EFBFBD>׼',FieldbyName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then begin
memtblDetail.Edit;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
if (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
memtblDetail.Post;
end else begin
memtblDetail.Insert;
for i:=0 to memtbldetail.FieldCount-1 do begin
if memtbldetail.Fields[i].FieldName='ͳ<>Ʊ<EFBFBD>׼' then
memtbldetail.Fields[i].AsString:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else
memtbldetail.Fields[i].AsFloat:=0;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
if (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
memtblDetail.Post;
end;
Next;
end;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
aDate:=IncMonth(aDate,1);
end;
end;
finally
FreeAndNil(aQuery);
freeAndNil(frm_sys_progress);
end;
end;
procedure Tfrm_rp_no_monthtotal.GetcustsaleNoFee;
var
aQuery:TAdoQuery;
aDate,aToDate:TDate;
strdate,stredate,sDate:String;
i:integer;
// S:TChartSeries;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
aDate:=EncodeDate(strtoint(cbYear.Text),strtoint(cbmonth.Text),1);
aToDate:=EncodeDate(strtoint(cbeYear.Text),strtoint(cbemonth.Text),2);
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=MonthsBetween(aDate,aToDate);
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
while not (aDate>aToDate) do begin
strdate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
stredate:=FormatDateTime('YYYY-MM-DD',aDate);
sDate:=FormatDateTime('YYYYMM',aDate);
CLOSE;
SQL.Clear;
SQL.Add('Select t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<>պϼ<D5BA>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>USD,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4>RMB,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>');
SQL.Add(',sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,');
SQL.Add('sum(case t_ch_fee.<2E><><EFBFBD><EFBFBD> when ''<27><>'' then (case when (t_ch_fee.<2E>ұ<EFBFBD><>''USD'') AND (t_ch_fee.<2E>ұ<EFBFBD><>''RMB'') then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) else 0 end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
SQL.Add('from t_ch_fee inner join v_op_bscard on t_ch_fee.<2E><><EFBFBD><EFBFBD>=v_op_bscard.<2E><><EFBFBD><EFBFBD> where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+stredate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+strdate+'''');
if RxDBLookupCombo5.DisplayValues[1]<>'' then
SQL.Add(' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''');
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
SQL.Add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''');
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''');
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+'''')
// else
SQL.Add(' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''');
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''');
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
SQL.Add(' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''');
end;
SQL.Add(' and '+open_data('0033','v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա','no','no','no'));
SQL.Add('group by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> ');
Open;
if not IsEmpty then begin
first;
while not eof do begin
if memtblDetail.Locate('ͳ<>Ʊ<EFBFBD>׼;ͳ<>Ʊ<EFBFBD>׼2',vararrayof([fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,FieldbyName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString]),[]) then begin
memtblDetail.Edit;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
if (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
memtblDetail.Post;
end else begin
memtblDetail.Insert;
for i:=0 to memtbldetail.FieldCount-1 do begin
if memtbldetail.Fields[i].FieldName='ͳ<>Ʊ<EFBFBD>׼' then
memtbldetail.Fields[i].AsString:=FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString
else if memtbldetail.Fields[i].FieldName='ͳ<>Ʊ<EFBFBD>׼2' then
memtbldetail.Fields[i].AsString:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else if memtbldetail.Fields[i].FieldName='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>' then begin
memtbldetail.Fields[i].AsString:=getzq(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
end else if memtbldetail.Fields[i].FieldName='<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>' then begin
if frm_data_share.t_crm_client_all.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString,[])then
memtbldetail.Fields[i].AsString:=frm_data_share.t_crm_client_all.FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString;
end
else
memtbldetail.Fields[i].AsFloat:=0;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat+FieldbyName('δ<>պϼ<D5BA>').AsFloat;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat+FieldbyName('δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat+FieldbyName('δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat+FieldbyName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
if (wwDBComboBox31.Text='') then begin
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>USD').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4>RMB').AsFloat;
memtblDetail.FieldByName(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName(sDate+'δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD').AsFloat;
memtblDetail.FieldByName('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB').AsFloat:=memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat-memtblDetail.FieldByName('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB').AsFloat;
memtblDetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>').AsFloat:=memtblDetail.FieldByName('δ<>պϼ<D5BA>').AsFloat-memtblDetail.FieldByName('δ<><CEB4><EFBFBD>ϼ<EFBFBD>').AsFloat;
end;
memtblDetail.Post;
end;
Next;
end;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
aDate:=IncMonth(aDate,1);
end;
end;
finally
FreeAndNil(aQuery);
freeAndNil(frm_sys_progress);
end;
end;
procedure Tfrm_rp_no_monthtotal.Creatememtbl;
var
aDate,aToDate:TDate;
sDate,aYear,aMonth:String;
aColumn:TdxDBTreeListColumn;
aBand:TdxTreeListBand;
i:integer;
begin
dxDBGrid1.Bands.Clear;
while dxDBGrid1.columncount>0 do
begin
dxDBGrid1.Columns[0].Destroy;
end;
memtblDetail.Close;
memtblDetail.EmptyTable;
memtblDetail.Fields.Clear;
memtblDetail.FieldDefs.Clear;
memtblDetail.FieldDefs.Add('ͳ<>Ʊ<EFBFBD>׼', ftString, 20, false);
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
aBand.Fixed:=BFLEFT;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
if not (bsSkinRadioGroup1.ItemIndex=2) then
aColumn.Caption:=bsSkinRadioGroup1.Items[bsSkinRadioGroup1.Itemindex]
else
aColumn.Caption:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
aColumn.FieldName:='ͳ<>Ʊ<EFBFBD>׼';
if bsSkinRadioGroup1.ItemIndex=2 then begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
aColumn.FieldName:='ͳ<>Ʊ<EFBFBD>׼2';
memtblDetail.FieldDefs.Add('ͳ<>Ʊ<EFBFBD>׼2', ftString, 20, false);
end;
if (bsSkinRadioGroup1.ItemIndex=0) or (bsSkinRadioGroup1.ItemIndex=2) then begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.BandIndex:=0;
aColumn.FieldName:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>';
memtblDetail.FieldDefs.Add('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>', ftString, 60, false);
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>';
aColumn.BandIndex:=0;
aColumn.FieldName:='<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>';
memtblDetail.FieldDefs.Add('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>', ftString, 60, false);
end;
// aColumn.SummaryFooterText:='˫<><CBAB><EFBFBD><EFBFBD><E9BFB4>ϸ';
aDate:=EncodeDate(strtoint(cbyear.text),strtoint(cbmonth.Text),1);
aToDate:=EncodeDate(strtoint(cbeyear.text),strtoint(cbemonth.Text),2);
i:=1;
while aDate<aToDate do begin
sDate:=FormatDateTime('YYYYMM',aDate);
aYear:=FormatDateTime('YYYY',aDate);
aMonth:=FormatDateTime('MM',aDate);
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:=aYear+'<27><>'+aMonth+'<27><>';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then
begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[0] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:=sDate+'δ<><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[1] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:=sDate+'δ<><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[2] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:=sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[3] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:=sDate+'δ<>պϼ<D5BA>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<>պϼ<D5BA>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:=sDate+'δ<><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>RMB',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:=sDate+'δ<><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>USD',ftFloat, 0, false);
end;
end;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[4] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:=sDate+'δ<><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[5] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:=sDate+'δ<><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[6] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:=sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[7] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:=sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:=sDate+'δ<><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>RMB',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:=sDate+'δ<><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'δ<><CEB4>USD',ftFloat, 0, false);
end;
end;
end;
if (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[9] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>USD';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[10] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>RMB';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
{
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
}
if bsSkinCheckGroup1.Checked[11] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD>RMB',ftFloat, 0, false);
// memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>RMB';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD>RMB',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>USD';
aColumn.FieldName:=sDate+'<27><><EFBFBD><EFBFBD>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add(sDate+'<27><><EFBFBD><EFBFBD>USD',ftFloat, 0, false);
end;
end;
end;
aDate:=IncMonth(aDate,1);
Inc(i);
end;
aBand:=dxDBGrid1.Bands.Add;
aBand.Caption:='<27>ϼ<EFBFBD>';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[0] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[1] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[2] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[3] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:='δ<>պϼ<D5BA>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<>պϼ<D5BA>',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:='δ<>պϼ<D5BA>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<>պϼ<D5BA>',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<>պϼ<D5BA>';
aColumn.FieldName:='δ<>պϼ<D5BA>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<>պϼ<D5BA>',ftFloat, 0, false);
end;
end;
end;
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[4] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[5] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[6] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[7] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<><CEB4><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>RMB';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<><CEB4><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4>USD';
aColumn.FieldName:='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='δ<><CEB4><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('δ<><CEB4><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
end;
end;
if (wwDBComboBox31.Text='') then begin
case bsSkinRadioGroup2.ItemIndex of
0: begin //all
if bsSkinCheckGroup1.Checked[8] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>USD';
aColumn.FieldName:='<27>ϼƲ<CFBC><C6B2><EFBFBD>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
if bsSkinCheckGroup1.Checked[9] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>RMB';
aColumn.FieldName:='<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
{
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.FieldName:='<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
}
if bsSkinCheckGroup1.Checked[10] then
begin
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
end;
memtblDetail.FieldDefs.Add('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
// memtblDetail.FieldDefs.Add('<27>ϼƲ<CFBC><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',ftFloat, 0, false);
end;
1: begin //rmb
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>RMB';
aColumn.FieldName:='<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
2: begin //usd
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD>USD';
aColumn.FieldName:='<27>ϼƲ<CFBC><C6B2><EFBFBD>USD';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
aColumn:=dxDBGrid1.CreateColumn(TdxDBGridColumn);
aColumn.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.FieldName:='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>';
aColumn.SummaryFooterType:=cstSum;
aColumn.BandIndex:=i;
memtblDetail.FieldDefs.Add('<27>ϼƲ<CFBC><C6B2><EFBFBD>USD',ftFloat, 0, false);
memtblDetail.FieldDefs.Add('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>',ftFloat, 0, false);
end;
end;
end;
memtblDetail.CreateTable;
memtblDetail.Open;
end;
procedure Tfrm_rp_no_monthtotal.bsSkinCheckRadioBox3Click(Sender: TObject);
begin
GetNoFee;
end;
procedure Tfrm_rp_no_monthtotal.bsSkinCheckRadioBox2Click(Sender: TObject);
begin
GetNoFee;
end;
procedure Tfrm_rp_no_monthtotal.FormShow(Sender: TObject);
var i:integer;
begin
cbyear.Items.IndexOf(FormatDateTime('YYYY',Now));
cbyear.text:=FormatDateTime('YYYY',Now);
cbeyear.Items.IndexOf(FormatDateTime('YYYY',Now));
cbeyear.text:=FormatDateTime('YYYY',Now);
cbmonth.Items.IndexOf(FormatDateTime('MM',Now));
cbmonth.text:=FormatDateTime('MM',Now);
cbemonth.Items.IndexOf(FormatDateTime('MM',Now));
cbemonth.text:=FormatDateTime('MM',Now);
loadreggrid(dxdbgrid2,true,caption+'2');
for i:=0 to 11 do
begin
bsSkinCheckGroup1.Checked[i]:=True;
end;
end;
function Tfrm_rp_no_monthtotal.getleftstr(substr: String; leng: integer;
left: boolean=true): String;
var
str:String;
begin
str:=substr;
if length(str)>=leng then begin
result:=str;
exit;
end;
while length(str)<leng do begin
if left then
str:='0'+str
else
str:=str+'0';
end;
result:=str;
end;
procedure Tfrm_rp_no_monthtotal.dxDBGrid1DblClick(Sender: TObject);
var
str,salename,str_bill,strdate,stredate:String;
aDate:TDate;
begin
salename:=memtblDetail.fieldbyname('ͳ<>Ʊ<EFBFBD>׼').AsString;
str:=dxDBGrid1.FocusedField.FieldName;
if (str='ͳ<>Ʊ<EFBFBD>׼') or (str='<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>') or(str='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD') or (str='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB') or (str='δ<>պϼ<D5BA>')
or (str='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>USD') or (str='<27>ϼ<EFBFBD>δ<EFBFBD><CEB4>RMB') or (str='δ<><CEB4><EFBFBD>ϼ<EFBFBD>') or (str='δ<>պϼ<D5BA>')
or (str='<27>ϼƲ<CFBC><C6B2><EFBFBD>USD') or (str='<27>ϼƲ<CFBC><C6B2><EFBFBD>RMB') or (str='<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>') then
begin
if bsSkinRadioGroup1.ItemIndex=0 then begin
aDate:=EncodeDate(strtoint(cbeyear.text),strtoint(cbemonth.Text),1);
stredate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
strdate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(cbyear.text),strtoint(cbmonth.Text),1));
str_bill:=' where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+strdate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+stredate+'''';
if RxDBLookupCombo5.DisplayValues[1]<>'' then
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''';
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+salename+'''';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''';
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''';
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''';
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''';
end;
p_detail.close;
p_detail.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> as ͳ<>Ʊ<EFBFBD>׼,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else '
+'1 end) as <20>ƷѶ<C6B7>'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+str_bill
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else 1 end)'
+default_sort_two(53,'v_op_bscard','v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','','');
// sl.Add(p_detail.Parameters.ParamByName('SQLStr').value);
// sl.SaveToFile('d:\1.txt');
p_detail.Open;
end else begin
aDate:=EncodeDate(strtoint(cbeyear.text),strtoint(cbemonth.Text),1);
stredate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
strdate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(cbyear.text),strtoint(cbmonth.Text),1));
str_bill:=' where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+strdate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+stredate+'''';
if RxDBLookupCombo5.DisplayValues[1]<>'' then
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''';
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+salename+'''';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''';
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''';
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''';
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''';
end;
p_detail.close;
p_detail.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as ͳ<>Ʊ<EFBFBD>׼,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else '
+'1 end) as <20>ƷѶ<C6B7>'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+str_bill
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else 1 end)'
+default_sort_two(53,'v_op_bscard','v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','','');
// sl.Add(p_detail.Parameters.ParamByName('SQLStr').value);
// sl.SaveToFile('d:\1.txt');
p_detail.Open;
end;
end else begin
if bsSkinRadioGroup1.ItemIndex=0 then begin
aDate:=EncodeDate(strtoint(copy(str,1,4)),strtoint(copy(str,5,2)),1);
stredate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
strdate:=FormatDateTime('YYYY-MM-DD',aDate);
str_bill:=' where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+strdate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+stredate+'''';
if RxDBLookupCombo5.DisplayValues[1]<>'' then
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''';
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+salename+'''';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''';
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''';
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''';
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''';
end;
p_detail.close;
p_detail.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> as ͳ<>Ʊ<EFBFBD>׼,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else '
+'1 end) as <20>ƷѶ<C6B7>'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+str_bill
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else 1 end)'
+default_sort_two(53,'v_op_bscard','v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','','');
// sl.Add(p_detail.Parameters.ParamByName('SQLStr').value);
// sl.SaveToFile('d:\1.txt');
p_detail.Open;
end else begin
aDate:=EncodeDate(strtoint(copy(str,1,4)),strtoint(copy(str,5,2)),1);
stredate:=FormatDateTime('YYYY-MM-DD',EncodeDate(strtoint(FormatDateTime('YYYY',aDate)),strtoint(FormatDateTime('MM',aDate)),MonthDays[isLeapYear(strtoint(FormatDateTime('YYYY',aDate))),strtoint(FormatDateTime('MM',aDate))]));
strdate:=FormatDateTime('YYYY-MM-DD',aDate);
str_bill:=' where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+strdate+''' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+stredate+'''';
if RxDBLookupCombo5.DisplayValues[1]<>'' then
str_bill:=str_bill+' and t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo5.DisplayValues[1]+'''';
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+salename+'''';
if (wwDBComboBox31.Text='<27><>') or (wwDBComboBox31.Text='<27><>') then
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD>='''+wwDBComboBox31.Text+'''';
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
// if wwDBComboBox14.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo3.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo3.DisplayValues[0]+'''';
end;
if RxDBLookupCombo15.DisplayValues[0]<>'' then begin
// if wwDBComboBox45.Text='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
// str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><>'''+RxDBLookupCombo15.DisplayValues[0]+''''
// else
str_bill:=str_bill+' and v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo15.DisplayValues[0]+'''';
end;
if RxDBLookupCombo12.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+RxDBLookupCombo12.DisplayValues[0]+'''';
end;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
str_bill:=str_bill+' and v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='''+RxDBLookupCombo10.DisplayValues[0]+'''';
end;
p_detail.close;
p_detail.Parameters.ParamByName('SQLStr').value:=
'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as ͳ<>Ʊ<EFBFBD>׼,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20><><EFBFBD><EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20><><EFBFBD>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<>պϼ<D5BA>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as Ӧ<><D3A6>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20>Ѹ<EFBFBD>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>USD,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as Ӧ<><D3A6>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as <20>Ѹ<EFBFBD>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when '+''''+'USD'+''''
+' then 0 else (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> end) ELSE 0 END) as δ<><CEB4>RMB,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as Ӧ<><D3A6><EFBFBD>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as <20>Ѹ<EFBFBD><D1B8>ϼ<EFBFBD>,'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN '+''''+'<27><>'+''''
+' THEN (t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)*t_ch_fee.<2E><><EFBFBD><EFBFBD> ELSE 0 END) as δ<><CEB4><EFBFBD>ϼ<EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else '
+'1 end) as <20>ƷѶ<C6B7>'
+' FROM t_ch_fee inner join v_op_bscard on v_op_bscard.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
+str_bill
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><E1B5A5>, v_op_bscard.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard.װ<>˷<EFBFBD>ʽ,'
+'v_op_bscard.ί<>е<EFBFBD>λ, v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard.ж<><D0B6><EFBFBD><EFBFBD>, '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>, v_op_bscard.<2E><><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>1, v_op_bscard.<2E><><EFBFBD><EFBFBD>2, v_op_bscard.<2E><><EFBFBD><EFBFBD>3,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>4, v_op_bscard.<2E><><EFBFBD><EFBFBD>5, v_op_bscard.<2E><><EFBFBD><EFBFBD>6,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>7, v_op_bscard.<2E><><EFBFBD><EFBFBD>8, v_op_bscard.<2E><><EFBFBD><EFBFBD>9,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>10,v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><>TEU, v_op_bscard.<2E><>װ<EFBFBD><D7B0>, v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard.<2E>ͷ<EFBFBD>Ա, v_op_bscard.<2E><><EFBFBD><EFBFBD>,'
+'v_op_bscard.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard.<2E><><EFBFBD><EFBFBD><ECB5A5>,v_op_bscard.<2E><>Ʊ<EFBFBD><C6B1>,'
+'(case when round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 '
+'else v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4)>1 then '
+'round((case when v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000>v_op_bscard.<2E><><EFBFBD><EFBFBD> then v_op_bscard.<2E><><EFBFBD><EFBFBD>/1000 else '
+'v_op_bscard.<2E><><EFBFBD><EFBFBD> end),4) else 1 end)'
+default_sort_two(53,'v_op_bscard','v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','','');
// sl.Add(p_detail.Parameters.ParamByName('SQLStr').value);
// sl.SaveToFile('d:\1.txt');
p_detail.Open;
end;
end;
bsSkinPageControl1.ActivePageindex:=1;
end;
procedure Tfrm_rp_no_monthtotal.bsSkinButton2Click(Sender: TObject);
begin
cbyear.Text:='';
cbeyear.Text:='';
cbmonth.Text:='';
cbemonth.Text:='';
wwDBComboBox31.Text:='';
RxDBLookupCombo5.ClearValue;
RxDBLookupCombo3.ClearValue;
end;
procedure Tfrm_rp_no_monthtotal.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid2);
end;
procedure Tfrm_rp_no_monthtotal.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid2);
end;
procedure Tfrm_rp_no_monthtotal.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid2,130);
end;
procedure Tfrm_rp_no_monthtotal.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid2);
end;
procedure Tfrm_rp_no_monthtotal.N1Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_rp_no_monthtotal.memtblDetailAfterOpen(DataSet: TDataSet);
begin
AdoFormatdxDBGrid(DataSet);
end;
function Tfrm_rp_no_monthtotal.getzq(cust: string): string;
var
aQuery:TAdoQuery;
str:string;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;sql.Clear;
sql.Add('select * from t_crm_client_sales where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+'''');
open;
if IsEmpty then
result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
else begin
str:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+',';
if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC>ʱ<EFBFBD><CAB1>' then begin
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD>ģʽ').asstring+'<27><>,';
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD>ģʽ').asstring+',';
str:=str+'ÿ<>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'';
end else if fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
str:=str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'<27><>';
end;
result:=str;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
end.