|
|
unit u_rp_rp_apply;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, ExtCtrls, ComCtrls, bsSkinTabs, bsSkinCtrls, dxExEdtr, dxDBGrid,
|
|
|
dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, DB, ADODB, Menus, XPMenu,
|
|
|
RxMemDS, DBTables, RxQuery, StdCtrls, Buttons, Grids, DBGrids, wwdblook,
|
|
|
RxLookup, wwdbdatetimepicker, Mask, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_rp_apply = class(TForm)
|
|
|
Panel1: TPanel;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
aa: TbsSkinPageControl;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column10: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column11: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column21: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column23: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column24: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column25: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column26: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column27: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column28: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column29: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column31: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column43: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column51: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column54: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column55: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column56: TdxDBGridColumn;
|
|
|
dxDBGrid1Column57: TdxDBGridColumn;
|
|
|
dxDBGrid1Column82: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column83: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column84: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column88: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column89: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column90: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column92: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column93: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column85: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column87: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column86: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1USD: TdxDBGridColumn;
|
|
|
dxDBGrid1RMB: TdxDBGridColumn;
|
|
|
dxDBGrid1Column102: TdxDBGridColumn;
|
|
|
dxDBGrid1Column105: TdxDBGridColumn;
|
|
|
dxDBGrid1Column108: TdxDBGridColumn;
|
|
|
dxDBGrid1Column111: TdxDBGridColumn;
|
|
|
dxDBGrid1Column114: TdxDBGridColumn;
|
|
|
dxDBGrid1Column115: TdxDBGridColumn;
|
|
|
dxDBGrid1Column116: TdxDBGridColumn;
|
|
|
XPMenu1: TXPMenu;
|
|
|
p_detail: TADOStoredProc;
|
|
|
p_detail1: TDataSource;
|
|
|
t_sum1: TDataSource;
|
|
|
dxDBGrid1Column68: TdxDBGridColumn;
|
|
|
dxDBGrid1Column69: TdxDBGridColumn;
|
|
|
dxDBGrid1Column70: TdxDBGridColumn;
|
|
|
p_sum: TADOStoredProc;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGrid2Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid2USD: TdxDBGridColumn;
|
|
|
dxDBGrid2Column29: TdxDBGridColumn;
|
|
|
dxDBGrid2Column30: TdxDBGridColumn;
|
|
|
dxDBGrid2RMB: TdxDBGridColumn;
|
|
|
dxDBGrid2Column32: TdxDBGridColumn;
|
|
|
dxDBGrid2Column33: TdxDBGridColumn;
|
|
|
dxDBGrid2Column34: TdxDBGridColumn;
|
|
|
dxDBGrid2Column35: TdxDBGridColumn;
|
|
|
dxDBGrid2Column36: TdxDBGridColumn;
|
|
|
dxDBGrid1Column61: TdxDBGridColumn;
|
|
|
dxDBGrid1Column62: TdxDBGridColumn;
|
|
|
dxDBGrid1Column63: TdxDBGridColumn;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
Label6: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Label2: TLabel;
|
|
|
Label10: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label124: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Edit1: TEdit;
|
|
|
Edit4: TEdit;
|
|
|
Edit2: TEdit;
|
|
|
Edit3: TEdit;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
wwDBLookupCombo52: TwwDBLookupCombo;
|
|
|
RxDBLookupCombo3: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo6: TRxDBLookupCombo;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
RxDBLookupCombo10: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
Label7: TLabel;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
Label12: TLabel;
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
dxDBGrid1Column52: TdxDBGridColumn;
|
|
|
dxDBGrid1Column53: TdxDBGridColumn;
|
|
|
dxDBGrid1Column58: TdxDBGridColumn;
|
|
|
Label13: TLabel;
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure aaChange(Sender: TObject);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure dxDBGrid2ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure dxDBGrid1DblClick(Sender: TObject);
|
|
|
procedure dxDBGrid1Column116CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean;
|
|
|
var ADone: Boolean);
|
|
|
procedure dxDBGrid2Column34CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean;
|
|
|
var ADone: Boolean);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_rp_apply: Tfrm_rp_rp_apply;
|
|
|
rp_rp_seae_open:boolean;
|
|
|
rp_rp_seae_str:widestring;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share, u_ch_fee_zhupiao;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
savereggrid(dxdbgrid1,caption+'11');
|
|
|
savereggrid(dxdbgrid2,caption+'12');
|
|
|
|
|
|
rp_rp_seae_open:=false;
|
|
|
frm_rp_rp_apply.Hide;
|
|
|
frm_rp_rp_apply.ManualFloat(frm_rp_rp_apply.BoundsRect );
|
|
|
frm_main.freeTabs('frm_rp_rp_apply');
|
|
|
action:=cafree;
|
|
|
frm_rp_rp_apply:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
Edit1.text:='';
|
|
|
Edit4.text:='';
|
|
|
Edit2.text:='';
|
|
|
Edit3.text:='';
|
|
|
wwDBDateTimePicker1.text:='';
|
|
|
wwDBDateTimePicker2.text:='';
|
|
|
wwDBDateTimePicker3.text:='';
|
|
|
wwDBDateTimePicker4.text:='';
|
|
|
wwDBDateTimePicker5.text:='';
|
|
|
wwDBDateTimePicker6.text:='';
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
wwDBLookupCombo52.text:='';
|
|
|
RxDBLookupCombo6.ClearValue;
|
|
|
RxDBLookupCombo3.ClearValue;
|
|
|
RxDBLookupCombo10.ClearValue;
|
|
|
RxDBLookupCombo1.ClearValue;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
loadreggrid(dxdbgrid1,true,caption+'11');
|
|
|
loadreggrid(dxdbgrid2,true,caption+'12');
|
|
|
rp_rp_seae_open:=true;
|
|
|
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
|
|
|
begin
|
|
|
dxDBGrid1.Bands[1].Visible:=true;
|
|
|
dxDBGrid2.Bands[1].Visible:=true;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
dxDBGrid1.Bands[1].Visible:=false;
|
|
|
dxDBGrid2.Bands[1].Visible:=false;
|
|
|
end;
|
|
|
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
|
|
|
begin
|
|
|
dxDBGrid1.Bands[2].Visible:=true;
|
|
|
dxDBGrid2.Bands[2].Visible:=true;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
dxDBGrid1.Bands[2].Visible:=false;
|
|
|
dxDBGrid2.Bands[2].Visible:=false;
|
|
|
end;
|
|
|
if frm_data_share.t_load_employee.FieldByName('<27><><EFBFBD><EFBFBD>').asboolean then
|
|
|
begin
|
|
|
dxDBGrid1.Bands[3].Visible:=true;
|
|
|
dxDBGrid2.Bands[3].Visible:=true;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
dxDBGrid1.Bands[3].Visible:=false;
|
|
|
dxDBGrid2.Bands[3].Visible:=false;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.aaChange(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
{
|
|
|
if not rp_rp_seae_open then
|
|
|
exit;
|
|
|
IF bsSkinTabSheet1.Showing then
|
|
|
exit;
|
|
|
dxDBGrid2.Parent:=aa.ActivePage;
|
|
|
dxDBGrid2Column1.Caption:=aa.ActivePage.Caption;
|
|
|
try
|
|
|
if not p_detail.active then
|
|
|
exit;
|
|
|
if p_detail.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
str:=rp_rp_seae_str;
|
|
|
if str<>'no'then
|
|
|
begin
|
|
|
p_sum.close;
|
|
|
p_sum.Parameters.ParamByName('SQLStr').Value:=
|
|
|
'SELECT COUNT(t_op_seae.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>1) as <20><><EFBFBD><EFBFBD>1, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>2) as <20><><EFBFBD><EFBFBD>2'
|
|
|
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>3) as <20><><EFBFBD><EFBFBD>3, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>4) as <20><><EFBFBD><EFBFBD>4, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>5) as <20><><EFBFBD><EFBFBD>5'
|
|
|
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>6) as <20><><EFBFBD><EFBFBD>6, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>7) as <20><><EFBFBD><EFBFBD>7, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>8) as <20><><EFBFBD><EFBFBD>8'
|
|
|
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>9) as <20><><EFBFBD><EFBFBD>9, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>10) as <20><><EFBFBD><EFBFBD>10'
|
|
|
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><>TEU) as <20><>TEU, sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
|
|
|
+', sum(t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum( t_op_seae.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>USD) as <20><><EFBFBD><EFBFBD>USD'
|
|
|
+', sum(t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum( t_op_gain.Ӧ<><D3A6>USD) as Ӧ<><D3A6>USD, sum(t_op_gain.<2E><><EFBFBD><EFBFBD>RMB) as <20><><EFBFBD><EFBFBD>RMB'
|
|
|
+', sum(t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum( t_op_gain.Ӧ<><D3A6>RMB) as Ӧ<><D3A6>RMB, sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>) as ë<><C3AB><EFBFBD><EFBFBD>'
|
|
|
+', sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>, sum( t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>'
|
|
|
+',(case when isnull(sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>),0)=0 then '+''''+'<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>'+''''+' else '
|
|
|
+'ltrim(str(sum(t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>)/sum(t_op_gain.<2E>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>)*100,10,2))+'+''''+'%'+''''+' end) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
+',t_op_seae.'+aa.ActivePage.Caption+' as base'
|
|
|
+','+''''+aa.ActivePage.Caption+''''+' as ͳ<>Ʊ<EFBFBD>'
|
|
|
+' FROM t_op_seae LEFT JOIN'
|
|
|
+' t_op_gain ON t_op_seae.<2E><><EFBFBD><EFBFBD> = t_op_gain.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str+' group by '+'t_op_seae.'+aa.ActivePage.Caption
|
|
|
+' order by '+'t_op_seae.'+aa.ActivePage.Caption;
|
|
|
p_sum.open;
|
|
|
end;
|
|
|
except
|
|
|
;
|
|
|
end;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinTabSheet1.showing then
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid2);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinTabSheet1.showing then
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid2);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinTabSheet1.showing then
|
|
|
begin
|
|
|
update_grid(dxdbgrid1,22);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
update_grid(dxdbgrid2,23);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinTabSheet1.showing then
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid2);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort_pro(Column,p_detail,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.dxDBGrid2ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort_pro(Column,P_sum,'base');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.dxDBGrid1DblClick(Sender: TObject);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
|
|
|
if p_detail.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring='ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ' then begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
if not assigned(frm_ch_fee_zhupiao) then
|
|
|
frm_ch_fee_zhupiao:=tfrm_ch_fee_zhupiao.Create (self);
|
|
|
try
|
|
|
aQuery.Close;
|
|
|
aQuery.sql.Clear;
|
|
|
aQuery.sql.add('select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD> order by <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>');
|
|
|
aQuery.Open;
|
|
|
frm_ch_fee_zhupiao.fra_fee_zhu1.fenpiao1.DataSet:=aQuery;
|
|
|
with frm_ch_fee_zhupiao do
|
|
|
begin
|
|
|
fra_fee_zhu1.t_ch_accept.close;
|
|
|
fra_fee_zhu1.t_ch_accept.Parameters[1].value:=p_detail.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
fra_fee_zhu1.t_ch_accept.open;
|
|
|
fra_fee_zhu1.zhupiao1.DataSet:=p_detail;
|
|
|
fra_fee_zhu1.dxDBGrid1.FullExpand;
|
|
|
fra_fee_zhu1.bsSkinPanel3.visible:=true;
|
|
|
fra_fee_zhu1.t_ch_pay.close;
|
|
|
fra_fee_zhu1.t_ch_pay.Parameters[1].value:=p_detail.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
fra_fee_zhu1.t_ch_pay.open;
|
|
|
fra_fee_zhu1.zhupiao1.DataSet:=p_detail;
|
|
|
fra_fee_zhu1.dxDBGrid2.FullExpand;
|
|
|
fra_fee_zhu1.bsSkinPanel4.visible:=true;
|
|
|
fra_fee_zhu1.t_op_gain.close;
|
|
|
fra_fee_zhu1.t_op_gain.Parameters[1].value:=p_detail.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
fra_fee_zhu1.t_op_gain.open;
|
|
|
fra_fee_zhu1.t_op_gain_fen.close;
|
|
|
fra_fee_zhu1.t_op_gain_fen.Parameters[1].value:=p_detail.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
fra_fee_zhu1.t_op_gain_fen.open;
|
|
|
fra_fee_zhu1.dxDBGrid3.FullExpand;
|
|
|
end;
|
|
|
frm_ch_fee_zhupiao.ShowModal;
|
|
|
finally
|
|
|
FreeAndNil(frm_ch_fee_zhupiao);
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
|
|
|
end else begin
|
|
|
fee_view(p_detail.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.dxDBGrid1Column116CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
if strtofloatdef(AText,0)<=0 then
|
|
|
AColor:=clRed;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.dxDBGrid2Column34CustomDraw(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
|
|
|
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
|
|
|
begin
|
|
|
if strtofloatdef(AText,0)<=0 then
|
|
|
AColor:=clRed;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
str,str_total:widestring;
|
|
|
str_sum:widestring;
|
|
|
begin
|
|
|
str:='';
|
|
|
|
|
|
if (wwDBComboBox2.Text='<27><><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>') then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>=1 and '+open_data('0037','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no') +' and (t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>ط<EFBFBD>'' or t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' or t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>'' ) '
|
|
|
else if (wwDBComboBox2.Text='<27>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
str:='where v_op_bscard_all.<2E>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>=1 and '+open_data('0037','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','no','no','no')+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''½<>˷<EFBFBD>'' ';
|
|
|
|
|
|
if Edit1.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit4.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit2.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
end;
|
|
|
if Edit3.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit3.text+'%'+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit3.text+'%'+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
end;
|
|
|
|
|
|
if wwDBDateTimePicker3.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker4.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker5.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
|
|
|
end;
|
|
|
if wwDBDateTimePicker6.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker6.text+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker6.text+'''';
|
|
|
end;
|
|
|
if RxDBLookupCombo2.DisplayValue<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
|
|
|
end;
|
|
|
|
|
|
if wwDBLookupCombo52.text<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+'''';
|
|
|
end;
|
|
|
if RxDBLookupCombo6.DisplayValue<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValue+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValue+'''';
|
|
|
end;
|
|
|
if RxDBLookupCombo3.DisplayValue<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValue+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValue+'''';
|
|
|
end;
|
|
|
if RxDBLookupCombo10.DisplayValue<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValue+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValue+'''';
|
|
|
end;
|
|
|
if RxDBLookupCombo1.DisplayValue<>''then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:='where v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValue+''''
|
|
|
else
|
|
|
str:=str+' and v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValue+'''';
|
|
|
end;
|
|
|
|
|
|
str_total:= 'SELECT t_ch_fee.<2E><><EFBFBD><EFBFBD>, '
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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>,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as ë<><C3AB><EFBFBD><EFBFBD>,'
|
|
|
|
|
|
+' v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬, v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ƴ<><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str+' and t_ch_fee.¼<><C2BC><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>ز<EFBFBD>'') '
|
|
|
+' GROUP BY t_ch_fee.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>, v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD>, v_op_bscard_all.װ<>˷<EFBFBD>ʽ,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,v_op_bscard_all.<2E>ջ<EFBFBD><D5BB><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬,v_op_bscard_all.<2E><>Ӫ<EFBFBD><D3AA>λ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.װ<><D7B0><EFBFBD><EFBFBD>, v_op_bscard_all.ж<><D0B6><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, '
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>1, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>2, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>3,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>4, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>5, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>6,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>7, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>8, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>9,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>10,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.ƴ<><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.<2E><>TEU, v_op_bscard_all.<2E><>װ<EFBFBD><D7B0>, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>Ա,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E>ͷ<EFBFBD>Ա, v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><>վ,'
|
|
|
+'v_op_bscard_all.<2E><><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾, v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, v_op_bscard_all.<2E><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>';
|
|
|
|
|
|
p_detail.close;
|
|
|
p_detail.Parameters.ParamByName('SQLStr').value:=str_total;
|
|
|
p_detail.Open;
|
|
|
|
|
|
str_sum:= 'SELECT '
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as Ӧ<><D3A6>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20>ϼ<EFBFBD>Ӧ<EFBFBD><D3A6>,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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 when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<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>,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD>=''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>USD,'
|
|
|
+' SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-SUM(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' and t_ch_fee.<2E>ұ<EFBFBD><>''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as <20><><EFBFBD><EFBFBD>RMB,'
|
|
|
+' sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end)-sum(case when t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>*t_ch_fee.<2E><><EFBFBD><EFBFBD> else 0 end) as ë<><C3AB><EFBFBD><EFBFBD>,'
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ,count(v_op_bscard_all.<2E><><EFBFBD><EFBFBD>) as Ʊ<><C6B1>'
|
|
|
+' FROM t_ch_fee inner join v_op_bscard_all on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> '
|
|
|
+str+' and t_ch_fee.¼<><C2BC><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>ز<EFBFBD>'') '
|
|
|
+' GROUP BY '
|
|
|
+'v_op_bscard_all.ί<>е<EFBFBD>λ';
|
|
|
|
|
|
p_sum.close;
|
|
|
p_sum.Parameters.ParamByName('SQLStr').value:=str_sum;
|
|
|
p_sum.Open;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_rp_apply.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,p_detail1,t_sum1,nil,nil,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
end.
|