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.

226 lines
7.2 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_ch_balance_accept;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid,
dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, bsSkinCtrls;
type
Tfrm_rp_ch_balance_accept = class(TForm)
p_detail: TADOStoredProc;
p_detail1: TDataSource;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridDateColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridDateColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column17: TdxDBGridDateColumn;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinTabSheet3: TbsSkinTabSheet;
p_total: TADOStoredProc;
p_total1: TDataSource;
dxDBGrid2: TdxDBGrid;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
dxDBGridColumn3: TdxDBGridColumn;
RadioGroup1: TbsSkinRadioGroup;
p_currency: TADOStoredProc;
p_currency1: TDataSource;
dxDBGrid3: TdxDBGrid;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridColumn4: TdxDBGridColumn;
dxDBGridColumn5: TdxDBGridColumn;
dxDBGridColumn6: TdxDBGridColumn;
dxDBGrid2Column6: TdxDBGridColumn;
dxDBGrid3Column5: TdxDBGridColumn;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
dxDBGrid4: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridColumn7: TdxDBGridColumn;
dxDBGridColumn8: TdxDBGridColumn;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridColumn11: TdxDBGridColumn;
dxDBGridColumn12: TdxDBGridColumn;
dxDBGridColumn13: TdxDBGridColumn;
dxDBGridColumn14: TdxDBGridColumn;
p_sales: TADOStoredProc;
p_sales1: TDataSource;
bsSkinButton1: TbsSkinButton;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure bsSkinPageControl1Resize(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinPageControl1Change(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_ch_balance_accept: Tfrm_rp_ch_balance_accept;
frm_rp_ch_balance_accept_open:boolean;
frm_rp_ch_balance_accept_str:widestring;
implementation
uses u_main, u_ch_balance_query, my_sys_function, u_rp_ch_balance_view;
{$R *.dfm}
procedure Tfrm_rp_ch_balance_accept.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_ch_balance_accept.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_rp_ch_balance_accept_open:=false;
frm_rp_ch_balance_accept.Hide;
frm_rp_ch_balance_accept.ManualFloat(frm_rp_ch_balance_accept.BoundsRect );
frm_main.freeTabs('frm_rp_ch_balance_accept');
action:=cafree;
frm_rp_ch_balance_accept:=nil;
end;
procedure Tfrm_rp_ch_balance_accept.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,false,caption);
frm_rp_ch_balance_accept_open:=true;
end;
procedure Tfrm_rp_ch_balance_accept.bsSkinPageControl1Resize(
Sender: TObject);
begin
bsSkinPanel1.Left:=bsSkinPageControl1.Width-bsSkinPanel1.Width-5;
end;
procedure Tfrm_rp_ch_balance_accept.bsSkinButton10Click(Sender: TObject);
begin
try
frm_ch_balance_query:=tfrm_ch_balance_query.Create (self);
balance_query_type:=6;
frm_ch_balance_query.ShowModal;
finally
frm_ch_balance_query.Free;
end;
end;
procedure Tfrm_rp_ch_balance_accept.bsSkinPageControl1Change(
Sender: TObject);
begin
if frm_rp_ch_balance_accept_open then
begin
if bsSkinTabSheet2.Showing then
frm_rp_ch_balance_accept.RadioGroup1Click(Sender);
end;
end;
procedure Tfrm_rp_ch_balance_accept.RadioGroup1Click(Sender: TObject);
var
str:widestring;
begin
if p_detail.Active then
begin
str:='select '+RadioGroup1.Items[RadioGroup1.ItemIndex]
+' as ͳ<>Ʊ<EFBFBD>׼,'+''''+RadioGroup1.Items[RadioGroup1.ItemIndex]+''''
+' as base,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,sum(ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
+',count(<28>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>'
+' from t_ch_balance '+frm_rp_ch_balance_accept_str
+' group by '+RadioGroup1.Items[RadioGroup1.ItemIndex]
+',<2C>ұ<EFBFBD>'
+' order by '+RadioGroup1.Items[RadioGroup1.ItemIndex];
p_total.close;
p_total.Parameters.ParamByName('SQLStr').value:=str;
p_total.open;
dxDBGridMaskColumn3.Caption:=RadioGroup1.Items[RadioGroup1.ItemIndex];
end;
end;
procedure Tfrm_rp_ch_balance_accept.bsSkinButton9Click(Sender: TObject);
begin
sys_print('Ӧ<>ս<EFBFBD><D5BD><EFBFBD>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,p_detail1,p_total1,p_sales1,p_currency1,nil,nil,nil);
end;
procedure Tfrm_rp_ch_balance_accept.bsSkinButton1Click(Sender: TObject);
begin
if (not p_detail.active)or(p_detail.IsEmpty)then
begin
showmessage('û<><C3BB><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>Ϣ<EFBFBD><CFA2>');
exit;
end;
try
if not assigned(frm_rp_ch_balance_view) then
frm_rp_ch_balance_view:=tfrm_rp_ch_balance_view.Create (self);
with frm_rp_ch_balance_view do
begin
v_fee_do_seae.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_seae.open;
v_fee_do_seai.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_seai.open;
v_fee_do_aire.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_aire.open;
v_fee_do_airi.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_airi.open;
v_fee_do_seae_sum.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_seae_sum.open;
v_fee_do_seai_sum.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_seai_sum.open;
v_fee_do_aire_sum.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_aire_sum.open;
v_fee_do_airi_sum.Parameters.ParamByName('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').value:=
p_detail.fieldbyname('<27>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>').asstring;
v_fee_do_airi_sum.open;
end;
frm_rp_ch_balance_view.ShowModal;
finally
frm_rp_ch_balance_view.free;
frm_rp_ch_balance_view:=nil;
end;
end;
end.