unit u_ch_balance_accept_deng; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, bsSkinCtrls, dxExEdtr, u_ch_add_do, u_ch_delete_do, wwdbedit, Wwdotdot, Wwdbcomb, StdCtrls, DBCtrls, bsdbctrls, RxLookup, Mask, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, ComCtrls, bsSkinTabs, Menus, XPMenu, ExtCtrls; type Tfrm_ch_balance_accept_deng = class(TForm) t_ch_balance: TADOQuery; t_ch_balance1: TDataSource; bsSkinPanel2: TbsSkinPanel; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinNotebook1: TbsSkinNotebook; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridDateColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridDateColumn; bsSkinPanel1: TbsSkinPanel; Label25: TLabel; DBEdit14: TDBEdit; Label17: TLabel; DBEdit1: TDBEdit; Label12: TLabel; RxDBLookupCombo1: TRxDBLookupCombo; Label1: TLabel; wwDBComboBox1: TwwDBComboBox; Label2: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label3: TLabel; DBEdit4: TDBEdit; Label4: TLabel; DBEdit5: TDBEdit; Label5: TLabel; DBEdit6: TDBEdit; Label6: TLabel; RxDBLookupCombo3: TRxDBLookupCombo; Label7: TLabel; DBEdit8: TDBEdit; Label8: TLabel; DBEdit9: TDBEdit; Label9: TLabel; DBEdit10: TDBEdit; Label10: TLabel; DBMemo1: TDBMemo; v_fee_do_seae: TADOQuery; v_fee_do_seai: TADOQuery; v_fee_do_aire: TADOQuery; v_fee_do_airi: TADOQuery; v_fee_do_airi1: TDataSource; v_fee_do_aire1: TDataSource; v_fee_do_seai1: TDataSource; v_fee_do_seae1: TDataSource; Label14: TLabel; RxDBLookupCombo4: TRxDBLookupCombo; Label11: TLabel; DBEdit2: TDBEdit; dxDBGrid1Column15: TdxDBGridColumn; dxDBGrid1Column16: TdxDBGridColumn; bsSkinButton13: TbsSkinButton; PopupMenu3: TPopupMenu; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N1: TMenuItem; N2: TMenuItem; XPMenu1: TXPMenu; Panel1: TPanel; bsSkinButton7: TbsSkinButton; Label13: TLabel; DBEdit3: TDBEdit; v_fee_do_seae_sum: TADOQuery; v_fee_do_seae_sum1: TDataSource; v_fee_do_seai_sum: TADOQuery; v_fee_do_seai_sum1: TDataSource; v_fee_do_aire_sum: TADOQuery; v_fee_do_aire_sum1: TDataSource; v_fee_do_airi_sum: TADOQuery; v_fee_do_airi_sum1: TDataSource; bsSkinPageControl2: TbsSkinPageControl; bsSkinTabSheet3: TbsSkinTabSheet; dxDBGrid2: TdxDBGrid; dxDBGrid2Column22: TdxDBGridColumn; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGrid; dxDBGridColumn39: TdxDBGridColumn; dxDBGridMaskColumn116: TdxDBGridMaskColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid3: TdxDBGrid; dxDBGrid3Column22: TdxDBGridColumn; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGrid3Column23: TdxDBGridColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGrid; dxDBGridColumn40: TdxDBGridColumn; dxDBGridMaskColumn117: TdxDBGridMaskColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGridColumn53: TdxDBGridColumn; bsSkinTabSheet5: TbsSkinTabSheet; dxDBGrid4: TdxDBGrid; dxDBGrid4Column19: TdxDBGridColumn; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGrid4Column20: TdxDBGridColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGrid; dxDBGridColumn41: TdxDBGridColumn; dxDBGridMaskColumn118: TdxDBGridMaskColumn; dxDBGridColumn54: TdxDBGridColumn; dxDBGridColumn55: TdxDBGridColumn; dxDBGridColumn56: TdxDBGridColumn; dxDBGridColumn57: TdxDBGridColumn; bsSkinTabSheet6: TbsSkinTabSheet; dxDBGrid5: TdxDBGrid; dxDBGrid5Column19: TdxDBGridColumn; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGrid5Column20: TdxDBGridColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGrid; dxDBGridColumn42: TdxDBGridColumn; dxDBGridMaskColumn119: TdxDBGridMaskColumn; dxDBGridColumn58: TdxDBGridColumn; dxDBGridColumn59: TdxDBGridColumn; dxDBGridColumn60: TdxDBGridColumn; dxDBGridColumn61: TdxDBGridColumn; Label15: TLabel; RxDBLookupCombo5: TRxDBLookupCombo; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinPanel2Resize(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure t_ch_balanceAfterInsert(DataSet: TDataSet); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure t_ch_balanceBeforePost(DataSet: TDataSet); procedure t_ch_balanceBeforeEdit(DataSet: TDataSet); procedure dxDBGrid1Column2CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure DBEdit14KeyPress(Sender: TObject; var Key: Char); procedure DBEdit1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure DBEdit2KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); procedure DBEdit4KeyPress(Sender: TObject; var Key: Char); procedure DBEdit5KeyPress(Sender: TObject; var Key: Char); procedure DBEdit6KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit8KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char); procedure DBEdit9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit10KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton13Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure dxDBGrid2DblClick(Sender: TObject); procedure dxDBGrid3DblClick(Sender: TObject); procedure dxDBGrid4DblClick(Sender: TObject); procedure dxDBGrid5DblClick(Sender: TObject); procedure RxDBLookupCombo15Change(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo3Change(Sender: TObject); procedure RxDBLookupCombo5Change(Sender: TObject); procedure RxDBLookupCombo5Enter(Sender: TObject); procedure RxDBLookupCombo3Enter(Sender: TObject); procedure RxDBLookupCombo3Exit(Sender: TObject); procedure RxDBLookupCombo5Exit(Sender: TObject); procedure DBEdit1Change(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_balance_accept_deng: Tfrm_ch_balance_accept_deng; implementation uses u_main, u_data_share, u_ch_balance_query, my_sys_function; {$R *.dfm} procedure Tfrm_ch_balance_accept_deng.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_balance_accept_deng.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_ch_balance_accept_deng.Hide; frm_ch_balance_accept_deng.ManualFloat(frm_ch_balance_accept_deng.BoundsRect ); frm_main.freeTabs('frm_ch_balance_accept_deng'); action:=cafree; frm_ch_balance_accept_deng:=nil; end; procedure Tfrm_ch_balance_accept_deng.bsSkinPanel2Resize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel2.Width/11); bsSkinButton10.Width:=i; bsSkinButton9.Width:=i; bsSkinButton2.Width:=i; bsSkinButton3.Width:=i; bsSkinButton4.Width:=i; bsSkinButton1.Width:=i; bsSkinButton11.Width:=i; bsSkinButton6.Width:=i; bsSkinButton8.Width:=i; bsSkinButton7.Width:=i; bsSkinButton13.Left:=bsSkinPanel2.Width-bsSkinButton13.Width-20; end; procedure Tfrm_ch_balance_accept_deng.FormShow(Sender: TObject); begin t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select * from t_ch_balance where 帐单状态<>'+''''+'审核通过'+'''' +' and 类型='+''''+'收'+'''' +' and 结算类别='+''''+'流程'+'''' +' order by 帐单编号 desc'); t_ch_balance.open; v_fee_do_seae.open; v_fee_do_seai.open; v_fee_do_aire.open; v_fee_do_airi.open; v_fee_do_seae_sum.open; v_fee_do_seai_sum.open; v_fee_do_aire_sum.open; v_fee_do_airi_sum.open; if StrToBool(get_parameters_value(83,'false')) then begin RxDBLookupCombo5.Visible:=TRUE; Label15.Visible:=true; end else begin RxDBLookupCombo5.Visible:=false; Label15.Visible:=false; Label6.Caption:='银 行'; end; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin if t_ch_balance.IsEmpty then exit; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end else begin if (t_ch_balance.State=dsinsert)or(t_ch_balance.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_ch_balance.post; end; if answer=mrNo then begin t_ch_balance.cancel; end; if answer=mrCancel then begin exit; end; END; bsSkinNotebook1.PageIndex:=0; bsSkinButton11.Caption:='编辑修改'; end; end; procedure Tfrm_ch_balance_accept_deng.t_ch_balanceAfterInsert( DataSet: TDataSet); var sdate:tdate; begin t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算人']:=employee; sdate:=EncodeDate(Logininfo.offyear,Logininfo.offmonth,1); if sdate>now then t_ch_balance['结算日期']:=sdate else t_ch_balance['结算日期']:=now; // if StrToBool(get_parameters_value(83,'false')) then // t_ch_balance['自动']:=1 // else t_ch_balance['自动']:=0; t_ch_balance['结算金额']:=0; t_ch_balance['实结金额']:=0; t_ch_balance['虚结金额']:=0; t_ch_balance['美元金额']:=0; t_ch_balance['人民币金额']:=0; t_ch_balance['类型']:='收'; t_ch_balance['财务']:=0; t_ch_balance['结算类别']:='流程'; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton1Click(Sender: TObject); begin t_ch_balance.insert; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton2Click(Sender: TObject); begin table_post(t_ch_balance); end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton4Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if (t_ch_balance.FieldByName('帐单状态').asstring<>'录入状态')then begin showmessage('当前业务操作的状态不允许删除!!'); exit; end; if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then begin t_ch_balance.Delete; end; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton3Click(Sender: TObject); begin table_cancel(t_ch_balance); end; procedure Tfrm_ch_balance_accept_deng.t_ch_balanceBeforePost( DataSet: TDataSet); begin table_before_post(t_ch_balance,'客户名称'); if not StrToBool(get_parameters_value(83,'false')) then table_before_post(t_ch_balance,'币别'); table_before_post(t_ch_balance,'核销人'); t_ch_balance['结算金额']:=s_w(strtoint(get_parameters_value(65,'2')),t_ch_balance['结算金额']); t_ch_balance['实结金额']:=s_w(strtoint(get_parameters_value(65,'2')),t_ch_balance['实结金额']); t_ch_balance['虚结金额']:=s_w(strtoint(get_parameters_value(65,'2')),t_ch_balance['虚结金额']); if t_ch_balance.state=dsinsert then t_ch_balance['帐单编号']:=get_no(date,'BA'); t_ch_balance['帐单状态']:=t_ch_balance['帐单状态']; t_ch_balance['虚结金额']:=t_ch_balance['结算金额']-t_ch_balance['实结金额']; end; procedure Tfrm_ch_balance_accept_deng.t_ch_balanceBeforeEdit( DataSet: TDataSet); begin if not modify_all then begin if (t_ch_balance.FieldByName('帐单状态').asstring<>'录入状态')then begin showmessage('当前业务操作的状态不允许更改'); abort; end; end; end; procedure Tfrm_ch_balance_accept_deng.dxDBGrid1Column2CustomDraw( Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if (ANode.strings[dxDBGrid1Column2.Index]='录入状态') then AColor :=clwhite else if (ANode.strings[dxDBGrid1Column2.Index]='提交核销') then AColor :=$0080FFFF else if (ANode.strings[dxDBGrid1Column2.Index]='确认核销') then AColor :=$0080FF80 else if (ANode.strings[dxDBGrid1Column2.Index]='提交审核') then AColor :=$0000FF80 else if (ANode.strings[dxDBGrid1Column2.Index]='审核通过') then AColor :=clLime; AFont.Color:=clblack; end; procedure Tfrm_ch_balance_accept_deng.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose:=frm_close_query(t_ch_balance); end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton9Click(Sender: TObject); begin sys_print('应收费用结算',2,t_ch_balance1,nil, nil,nil,v_fee_do_seae1,v_fee_do_seai1,v_fee_do_aire1,v_fee_do_airi1, t_ch_balance1,v_fee_do_seae_sum1,v_fee_do_seai_sum1); end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton6Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if t_ch_balance.FieldByName('帐单状态').asstring<>'录入状态'then begin showmessage('帐单状态不能提交核销!!'); end else begin try modify_all:=true; t_ch_balance.edit; t_ch_balance['帐单状态']:='提交核销'; t_ch_balance.post; Send_invocie_check_check('收费核销通知,帐单编号:'+t_ch_balance.fieldbyname('帐单编号').asstring +',客户:'+t_ch_balance.fieldbyname('客户名称').asstring,t_ch_balance.fieldbyname('核销人').asstring,'30'); modify_all:=false; except modify_all:=false; t_ch_balance.cancel; showmessage('提交失败!!'); end; end; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton8Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if t_ch_balance.FieldByName('帐单状态').asstring<>'提交核销'then begin showmessage('帐单状态不能取消提交核销!!'); end else begin if t_ch_balance.fieldbyname('实结金额').asfloat<>0 then begin showmessage('当前帐单已经实现了核销,不能取消提交核销!!'); exit; end; try modify_all:=true; t_ch_balance.edit; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance.post; modify_all:=false; except modify_all:=false; t_ch_balance.cancel; showmessage('取消提交核销失败!!'); end; end; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton10Click(Sender: TObject); begin try frm_ch_balance_query:=tfrm_ch_balance_query.Create (self); balance_query_type:=1; frm_ch_balance_query.ShowModal; finally frm_ch_balance_query.Free; end; end; procedure Tfrm_ch_balance_accept_deng.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit1); end; procedure Tfrm_ch_balance_accept_deng.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo1KeyPress( Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit2); end; procedure Tfrm_ch_balance_accept_deng.DBEdit2KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox1); end; procedure Tfrm_ch_balance_accept_deng.wwDBComboBox1KeyPress( Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo2KeyPress( Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_ch_balance_accept_deng.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit5); end; procedure Tfrm_ch_balance_accept_deng.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit6); end; procedure Tfrm_ch_balance_accept_deng.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo3); end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo3KeyPress( Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit8); end; procedure Tfrm_ch_balance_accept_deng.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo4); end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo4KeyPress( Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit9); end; procedure Tfrm_ch_balance_accept_deng.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit10); end; procedure Tfrm_ch_balance_accept_deng.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo1); end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton13Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept_deng.N17Click(Sender: TObject); begin t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select * from t_ch_balance where 帐单状态='+''''+'录入状态'+'''' +' and 类型='+''''+'收'+'''' +' and 结算类别='+''''+'流程'+'''' +' order by 帐单编号 desc'); t_ch_balance.open; end; procedure Tfrm_ch_balance_accept_deng.N34Click(Sender: TObject); begin t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select * from t_ch_balance where 帐单状态='+''''+'提交核销'+'''' +' and 类型='+''''+'收'+'''' +' and 结算类别='+''''+'流程'+'''' +' order by 帐单编号 desc'); t_ch_balance.open; end; procedure Tfrm_ch_balance_accept_deng.N2Click(Sender: TObject); begin t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select * from t_ch_balance where 帐单状态='+''''+'确认核销'+'''' +' and 类型='+''''+'收'+'''' +' and 结算类别='+''''+'流程'+'''' +' order by 帐单编号 desc'); t_ch_balance.open; end; procedure Tfrm_ch_balance_accept_deng.N36Click(Sender: TObject); begin t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select * from t_ch_balance where 帐单状态='+''''+'提交审核'+'''' +' and 类型='+''''+'收'+'''' +' and 结算类别='+''''+'流程'+'''' +' order by 帐单编号 desc'); t_ch_balance.open; end; procedure Tfrm_ch_balance_accept_deng.bsSkinButton7Click(Sender: TObject); var afield : variant; i: Integer; begin if t_ch_balance.IsEmpty then exit; try afield := vararraycreate([0,t_ch_balance.fieldcount-1],varvariant); for i := 0 to (t_ch_balance.fieldcount-1) do begin afield[i] :=t_ch_balance.fields[i].value ; end; t_ch_balance.insert; for i := 0 to (t_ch_balance.fieldcount-1) do begin if t_ch_balance.fields[i].FieldName<>'帐单编号'then t_ch_balance.fields[i].value := afield[i] ; end; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算人']:=employee; t_ch_balance['结算日期']:=now; t_ch_balance['自动']:=0; t_ch_balance['结算金额']:=0; t_ch_balance['实结金额']:=0; t_ch_balance['虚结金额']:=0; t_ch_balance['类型']:='收'; t_ch_balance['结算类别']:='流程'; t_ch_balance['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance['备注']:=''; t_ch_balance['核销日期']:=null; t_ch_balance['相关号码']:=''; t_ch_balance['财务']:=0; t_ch_balance['财务凭证']:=''; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; except if t_ch_balance.state=dsinsert then t_ch_balance.cancel; showmessage('复制添加失败!!'); end; end; procedure Tfrm_ch_balance_accept_deng.dxDBGrid2DblClick(Sender: TObject); begin fee_view(v_fee_do_seae.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_accept_deng.dxDBGrid3DblClick(Sender: TObject); begin fee_view(v_fee_do_seai.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_accept_deng.dxDBGrid4DblClick(Sender: TObject); begin fee_view(v_fee_do_aire.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_accept_deng.dxDBGrid5DblClick(Sender: TObject); begin fee_view(v_fee_do_airi.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo15Change( Sender: TObject); begin { if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo15.DisplayValues[0],[])then begin t_ch_balance['银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; } end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo16Change( Sender: TObject); begin { if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo16.DisplayValues[0],[])then begin t_ch_balance['美元银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; } end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo3Change( Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo3.DisplayValues[0],[])then begin t_ch_balance['银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo5Change( Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo5.DisplayValues[0],[])then begin t_ch_balance['美元银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo5Enter( Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; frm_data_share.t_sys_bank.Filter:='币别=''USD'''; frm_data_share.t_sys_bank.Filtered:=true; end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo3Enter( Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; if StrToBool(get_parameters_value(83,'false')) then begin frm_data_share.t_sys_bank.Filter:='币别=''RMB'''; frm_data_share.t_sys_bank.Filtered:=true; end; end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo3Exit( Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_accept_deng.RxDBLookupCombo5Exit( Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_accept_deng.DBEdit1Change(Sender: TObject); begin if (DBEdit1.text='录入状态') then DBEdit1.Color :=clwhite else if (DBEdit1.text='提交核销') then DBEdit1.Color :=$0080FFFF else if (DBEdit1.text='确认核销') then DBEdit1.Color :=$0080FF80 else if (DBEdit1.text='提交审核') then DBEdit1.Color :=$0000FF80 else if (DBEdit1.text='审核通过') then DBEdit1.Color :=clLime; end; end.