unit u_rp_dui_accept; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, ComCtrls, bsSkinTabs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, StdCtrls, wwdbdatetimepicker, RxLookup, Mask, wwdbedit, Wwdotdot, Wwdbcomb, dxDBTLCl, dxGrClms; type Tfrm_rp_dui_accept = class(TForm) bsSkinPanel1: TbsSkinPanel; Label9: TLabel; Label10: TLabel; Label4: TLabel; Label5: TLabel; Label1: TLabel; Label2: TLabel; bsSkinButton10: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; RxDBLookupCombo2: TRxDBLookupCombo; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; RxDBLookupCombo4: TRxDBLookupCombo; wwDBComboBox2: TwwDBComboBox; wwDBComboBox1: TwwDBComboBox; bsSkinButton1: TbsSkinButton; p_detail: TADOStoredProc; p_detail1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridDateColumn; dxDBGrid1RMB: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridColumn; dxDBGrid1USD: TdxDBGridColumn; dxDBGrid1Column11: TdxDBGridColumn; dxDBGrid1Column12: TdxDBGridColumn; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_rp_dui_accept: Tfrm_rp_dui_accept; implementation uses u_main, my_sys_function; {$R *.dfm} procedure Tfrm_rp_dui_accept.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_dui_accept.bsSkinButton10Click(Sender: TObject); var str1:widestring; str_tiaojian:widestring; begin str1:='SELECT t_ch_dui.对帐编号,' +'(case t_ch_dui.类别 when '+''''+'1'+''''+' then '+''''+'海运出口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'3'+''''+' then '+''''+'海运进口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'5'+''''+' then '+''''+'空运出口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'7'+''''+' then '+''''+'空运进口'+''''+' else ' +''''+''''+' end) end) end) end) as 业务种类, t_ch_dui.对帐客户,' +'t_ch_dui.对帐日期, t_ch_dui.对帐人, t_ch_dui.对帐名称,' +'t_ch_dui.支付日期, v_dui_fee_all.RMB金额, v_dui_fee_all.RMB结算,' +'v_dui_fee_all.RMB未结, v_dui_fee_all.USD金额, v_dui_fee_all.USD结算,' +'v_dui_fee_all.USD未结 ' +'FROM t_ch_dui INNER JOIN ' +'v_dui_fee_all ON t_ch_dui.对帐编号 = v_dui_fee_all.对帐编号 ' +'where t_ch_dui.类别 in ('+''''+'1'+''''+','+''''+'3'+'''' +','+''''+'5'+''''+','+''''+'7'+''''+','+''''+'9'+''''+')' +' and '+open_data('0039','t_ch_dui.对帐人','no','no','no','no'); if RxDBLookupCombo2.DisplayValue<>''then str_tiaojian:=' and t_ch_dui.对帐客户='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if RxDBLookupCombo4.DisplayValue<>''then str_tiaojian:=str_tiaojian+' and t_ch_dui.对帐人='+''''+RxDBLookupCombo4.DisplayValues[0]+''''; if wwDBDateTimePicker1.Text<>''then str_tiaojian:=str_tiaojian+' and t_ch_dui.对帐日期>='+''''+wwDBDateTimePicker1.Text+''''; if wwDBDateTimePicker2.Text<>''then str_tiaojian:=str_tiaojian+' and t_ch_dui.对帐日期<='+''''+wwDBDateTimePicker2.Text+''''; if wwDBComboBox2.ItemIndex<>-1 then str_tiaojian:=str_tiaojian+' and t_ch_dui.类别='+'''' +inttostr((wwDBComboBox2.ItemIndex+1)*2-1)+''''; if wwDBComboBox1.ItemIndex<>-1 then begin case wwDBComboBox1.ItemIndex of 0: begin str_tiaojian:=str_tiaojian+' and (v_dui_fee_all.RMB未结<>0 or v_dui_fee_all.USD未结<>0)'; end; 1: begin str_tiaojian:=str_tiaojian+' and v_dui_fee_all.RMB未结=0 and v_dui_fee_all.USD未结=0'; end; end; end; p_detail.close; p_detail.Parameters.ParamByName('SQLStr').value:=str1+str_tiaojian; p_detail.open; end; procedure Tfrm_rp_dui_accept.bsSkinButton9Click(Sender: TObject); begin sys_print('应收对帐统计',2,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_rp_dui_accept.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_rp_dui_accept.Hide; frm_rp_dui_accept.ManualFloat(frm_rp_dui_accept.BoundsRect ); frm_main.freeTabs('frm_rp_dui_accept'); action:=cafree; frm_rp_dui_accept:=nil; end; procedure Tfrm_rp_dui_accept.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid1,false,caption); end; procedure Tfrm_rp_dui_accept.bsSkinButton1Click(Sender: TObject); begin RxDBLookupCombo2.ClearValue; RxDBLookupCombo4.ClearValue; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; wwDBComboBox2.ItemIndex:=-1; wwDBComboBox1.ItemIndex:=-1; end; end.