unit u_ch_fee_se; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, u_fee, Menus; type Tfrm_ch_fee_sea = class(TForm) fra_fee1: Tfra_fee; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure fra_fee1bsSkinButton9Click(Sender: TObject); procedure fra_fee1bsSkinButton6Click(Sender: TObject); procedure fra_fee1bsSkinButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_fee_sea: Tfrm_ch_fee_sea; implementation uses my_sys_function, u_op_seae, u_data_share, u_main; {$R *.dfm} procedure Tfrm_ch_fee_sea.FormClose(Sender: TObject; var Action: TCloseAction); begin savewwgrid(fra_fee1.wwDBGrid1); savewwgrid(fra_fee1.wwDBGrid2); frm_ch_fee_sea.Hide; frm_ch_fee_sea.ManualFloat(frm_ch_fee_sea.BoundsRect ); action:=cafree; frm_ch_fee_sea:=nil; end; procedure Tfrm_ch_fee_sea.FormShow(Sender: TObject); var yjstr:string; begin loadwwgrid(fra_fee1.wwDBGrid1); loadwwgrid(fra_fee1.wwDBGrid2); fra_fee1.DBEdit50.DataSource:=frm_op_seae.t_op_seae2; fra_fee1.edit_type.text:='1'; fra_fee1.edit_data.text:='0001'; fra_fee1.edit_report.text:='海运出口'; fra_fee1.t_ch_accept.DataSource:=frm_op_seae.t_op_seae2; if if_open('216') then begin fra_fee1.t_ch_accept.DataSource:=frm_op_seae.t_op_seae2; if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('206')=false) then begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+''''+' and 编号=:编号 and isnull(费用名称,'''')<>''汇兑损益'' and (t_ch_fee.录入人=' +''''+employee+''''+' or (t_ch_fee.录入人<>'+''''+employee+'''' +' and 机密<>1) ) ' +' order by (select top 1 顺序 FROM t_code_fee WHERE 费用名称=T_CH_FEE.费用名称),顺序,CH_ID'); end ELSE begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+'''' +' and isnull(费用名称,'''')<>''汇兑损益'' and 编号=:编号 order by (select top 1 顺序 FROM t_code_fee WHERE 费用名称=T_CH_FEE.费用名称),顺序,CH_ID'); end; fra_fee1.t_ch_accept.open; fra_fee1.a_shen_delete.open; fra_fee1.a_shen_modify_old.open; fra_fee1.a_shen_modify_new.open; fra_fee1.Panel3.visible:=true; end else frm_ch_fee_sea.fra_fee1.Panel3.visible:=false; if if_open('217') then begin yjstr:=getyjstr; if (yjstr='') then yjstr:=' 1=1 '; fra_fee1.t_ch_pay.DataSource:=frm_op_seae.t_op_seae2; if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('206')=false) then begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee where 类型=' +''''+'付'+''''+' and 编号=:编号 and isnull(费用名称,'''')<>''汇兑损益'' and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) and '+yjstr); fra_fee1.t_ch_pay.SQL.Add(' order by (select top 1 顺序 FROM t_code_fee WHERE 费用名称=T_CH_FEE.费用名称),顺序,CH_ID'); end else if (yjstr<>'') then begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee ' +'where 类型=' +''''+'付'+''''+' and '+yjstr +' and isnull(费用名称,'''')<>''汇兑损益'' and 编号=:编号 order by (select top 1 顺序 FROM t_code_fee WHERE 费用名称=T_CH_FEE.费用名称),顺序,CH_ID'); end; fra_fee1.t_ch_pay.open; fra_fee1.p_shen_delete.open; fra_fee1.p_shen_modify_old.open; fra_fee1.p_shen_modify_new.open; fra_fee1.a_price_view.close; fra_fee1.a_price_view.SQL.Clear; fra_fee1.a_price_view.SQL.text:='select * from t_price_prerson where 收付类别=' +''''+'买价'+''''+' and 客户名称=:客户名称 and ' +open_data('3008','录入人','no','no','no','no') +' order by 录入日期 DESC'; fra_fee1.a_price_view.Open; fra_fee1.Panel1.visible:=true; end else fra_fee1.Panel1.visible:=false; if fra_fee1.Panel1.visible and fra_fee1.Panel3.visible then begin fra_fee1.Panel8.Visible:=true; fra_fee1.t_op_gain.DataSource:=frm_op_seae.t_op_seae2; fra_fee1.t_op_gain.open; fra_fee1.DBEdit43.DataSource:=frm_op_seae.t_op_seae2; fra_fee1.t_op_gain_main.DataSource:=frm_op_seae.t_op_seae2; fra_fee1.t_op_gain_main.open; end else begin fra_fee1.Panel8.Visible:=false; end; frm_data_share.t_crm_client.requery; frm_data_share.t_code_currency.requery; if not if_open('267') then begin fra_fee1.wwDBGrid1.RemoveField('费用状态',true); fra_fee1.wwDBGrid1.RemoveField('结算金额',true); fra_fee1.wwDBGrid1.RemoveField('开票金额',true); fra_fee1.wwDBGrid1.RemoveField('申请金额',true); fra_fee1.wwDBGrid2.RemoveField('费用状态',true); fra_fee1.wwDBGrid2.RemoveField('结算金额',true); fra_fee1.wwDBGrid2.RemoveField('开票金额',true); fra_fee1.wwDBGrid2.RemoveField('申请金额',true); end; end; procedure Tfrm_ch_fee_sea.fra_fee1bsSkinButton9Click(Sender: TObject); begin fra_fee1.bsSkinButton9Click(Sender); end; procedure Tfrm_ch_fee_sea.fra_fee1bsSkinButton6Click(Sender: TObject); begin fra_fee1.bsSkinButton6Click(Sender); end; procedure Tfrm_ch_fee_sea.fra_fee1bsSkinButton1Click(Sender: TObject); begin fra_fee1.bsSkinButton1Click(Sender); end; end.