unit u_rp_dui_pay; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, DB, ADODB, Mask, wwdbedit, Wwdotdot, Wwdbcomb, StdCtrls, wwdbdatetimepicker, RxLookup, bsSkinCtrls; type Tfrm_rp_dui_pay = 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_pay: Tfrm_rp_dui_pay; implementation uses u_main, my_sys_function; {$R *.dfm} procedure Tfrm_rp_dui_pay.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_dui_pay.bsSkinButton10Click(Sender: TObject); var str1:widestring; str_tiaojian:widestring; begin str1:='SELECT t_ch_dui.对帐编号,' +'(case t_ch_dui.类别 when '+''''+'2'+''''+' then '+''''+'海运出口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'4'+''''+' then '+''''+'海运进口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'6'+''''+' then '+''''+'空运出口'+''''+' else ' +'(case t_ch_dui.类别 when '+''''+'8'+''''+' 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 ('+''''+'2'+''''+','+''''+'4'+'''' +','+''''+'6'+''''+','+''''+'8'+''''+')' +' 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)+''''; 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_pay.bsSkinButton9Click(Sender: TObject); begin sys_print('应付对帐统计',2,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_rp_dui_pay.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_rp_dui_pay.Hide; frm_rp_dui_pay.ManualFloat(frm_rp_dui_pay.BoundsRect ); frm_main.freeTabs('frm_rp_dui_pay'); action:=cafree; frm_rp_dui_pay:=nil; end; procedure Tfrm_rp_dui_pay.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid1,false,caption); end; procedure Tfrm_rp_dui_pay.bsSkinButton1Click(Sender: TObject); begin RxDBLookupCombo2.ClearValue; RxDBLookupCombo4.ClearValue; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; wwDBComboBox2.ItemIndex:=-1; wwDBComboBox1.ItemIndex:=-1; end; end.