unit u_rp_ch_balance_detail; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, bsSkinCtrls, Menus; type Tfrm_rp_ch_balance_detail = class(TForm) p_detail: TADOStoredProc; p_detail1: TDataSource; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinPanel1: TbsSkinPanel; bsSkinButton10: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton1: TbsSkinButton; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinPageControl2: TbsSkinPageControl; tabsheet2: TbsSkinTabSheet; tabsheet3: TbsSkinTabSheet; p_detail_bill1: TDataSource; p_detail_bill: TADOStoredProc; p_detail_fee1: TDataSource; p_detail_fee: TADOStoredProc; dxDBGrid9: TdxDBGrid; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridDateColumn11: TdxDBGridDateColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGrid6Column18: TdxDBGridColumn; dxDBGrid6Column19: TdxDBGridColumn; dxDBGrid6Column20: TdxDBGridColumn; dxDBGrid9Column23: TdxDBGridColumn; dxDBGrid6Column21: TdxDBGridColumn; dxDBGrid6Column22: TdxDBGridColumn; dxDBGrid6Column23: TdxDBGridColumn; dxDBGrid9Column24: TdxDBGridColumn; dxDBGrid9Column25: TdxDBGridColumn; dxDBGrid9Column26: TdxDBGridColumn; dxDBGrid6Column24: TdxDBGridColumn; dxDBGrid9Column27: TdxDBGridColumn; dxDBGrid6Column25: TdxDBGridColumn; dxDBGrid6Column26: TdxDBGridColumn; dxDBGrid9Column28: TdxDBGridColumn; dxDBGrid6Column27: TdxDBGridColumn; bsSkinTabSheet3: TbsSkinTabSheet; dxDBGrid1: TdxDBGrid; dxDBGridColumn2: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGrid1Column4: TdxDBGridColumn; dxDBGrid1Column5: TdxDBGridColumn; dxDBGridDateColumn3: TdxDBGridColumn; dxDBGrid9Column29: TdxDBGridColumn; dxDBGrid9Column30: TdxDBGridColumn; N1: TMenuItem; N2: TMenuItem; dxDBGrid6Column28: TdxDBGridColumn; dxDBGrid9Column31: TdxDBGridColumn; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure bsSkinPageControl1Resize(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_rp_ch_balance_detail: Tfrm_rp_ch_balance_detail; frm_rp_ch_balance_detail_str:string; frm_rp_ch_balance_detail_open:boolean; implementation uses u_main, u_ch_balance_query, my_sys_function, u_rp_ch_balance_view; {$R *.dfm} procedure Tfrm_rp_ch_balance_detail.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_ch_balance_detail.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid6,caption+'1'); savereggrid(dxdbgrid9,caption+'2'); frm_rp_ch_balance_detail.Hide; frm_rp_ch_balance_detail.ManualFloat(frm_rp_ch_balance_detail.BoundsRect ); frm_main.freeTabs('frm_rp_ch_balance_detail'); action:=cafree; frm_rp_ch_balance_detail:=nil; end; procedure Tfrm_rp_ch_balance_detail.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid6,true,caption+'1'); loadreggrid(dxdbgrid9,false,caption+'2'); end; procedure Tfrm_rp_ch_balance_detail.bsSkinPageControl1Resize( Sender: TObject); begin bsSkinPanel1.Left:=bsSkinPageControl1.Width-bsSkinPanel1.Width-5; end; procedure Tfrm_rp_ch_balance_detail.bsSkinButton10Click(Sender: TObject); begin try frm_ch_balance_query:=tfrm_ch_balance_query.Create (self); balance_query_type:=8; frm_ch_balance_query.ShowModal; finally frm_ch_balance_query.Free; end; end; procedure Tfrm_rp_ch_balance_detail.bsSkinButton9Click(Sender: TObject); begin sys_print('结算明细统计',2,nil,nil,nil,nil,p_detail1,p_detail_bill1,p_detail_fee1,nil,nil,nil,nil); end; procedure Tfrm_rp_ch_balance_detail.bsSkinButton1Click(Sender: TObject); begin if (not p_detail.active)or(p_detail.IsEmpty)then begin showmessage('没有帐单信息!'); 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('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_seae.open; v_fee_do_seai.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_seai.open; v_fee_do_aire.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_aire.open; v_fee_do_airi.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_airi.open; v_fee_do_seae_sum.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_seae_sum.open; v_fee_do_seai_sum.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_seai_sum.open; v_fee_do_aire_sum.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').asstring; v_fee_do_aire_sum.open; v_fee_do_airi_sum.Parameters.ParamByName('帐单编号').value:= p_detail.fieldbyname('帐单编号').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; procedure Tfrm_rp_ch_balance_detail.N16Click(Sender: TObject); begin if bsSkinTabSheet1.showing then begin if tabsheet2.Showing then grid_save_xls(dxdbgrid6); if tabsheet3.Showing then grid_save_xls(dxdbgrid9); if bsSkinTabSheet3.Showing then grid_save_xls(dxdbgrid1); exit; end; end; procedure Tfrm_rp_ch_balance_detail.N10Click(Sender: TObject); begin if bsSkinTabSheet1.showing then begin if tabsheet2.Showing then update_grid_view_no(dxdbgrid6); if tabsheet3.Showing then update_grid_view_no(dxdbgrid9); exit; end; end; procedure Tfrm_rp_ch_balance_detail.N14Click(Sender: TObject); begin if bsSkinTabSheet1.showing then begin if tabsheet2.Showing then update_grid_view_all(dxdbgrid6); if tabsheet3.Showing then update_grid_view_all(dxdbgrid9); exit; end; end; procedure Tfrm_rp_ch_balance_detail.N2Click(Sender: TObject); begin if bsSkinTabSheet1.showing then begin if tabsheet2.Showing then update_grid(dxdbgrid6,954); if tabsheet3.Showing then update_grid(dxdbgrid9,955); exit; end; end; end.