unit u_ch_delete_do; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, bsSkinTabs, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, Menus, StdCtrls, XPMenu, Grids, DBGridEh, bsSkinCtrls, RxMemDS; type Tfra_ch_delete_do = class(TFrame) bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinTabSheet4: TbsSkinTabSheet; v_fee_do_seae: TADOQuery; v_fee_do_seae1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridDateColumn; dxDBGrid1Column10: TdxDBGridDateColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridMaskColumn; dxDBGrid1Column20: TdxDBGridMaskColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column16: TdxDBGridColumn; dxDBGrid1Column17: TdxDBGridColumn; do_ban1: TDataSource; p_fee_do_delete_one: TADOStoredProc; PopupMenu1: TPopupMenu; N1: TMenuItem; bs_text: TEdit; XPMenu1: TXPMenu; v_fee_do_seai: TADOQuery; v_fee_do_seai1: TDataSource; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; 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; v_fee_do_aire: TADOQuery; v_fee_do_aire1: TDataSource; v_fee_do_airi1: TDataSource; v_fee_do_airi: TADOQuery; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGrid2Column22: TdxDBGridColumn; dxDBGrid5: TdxDBGrid; 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; dxDBGrid5Column1: TdxDBGridMaskColumn; dxDBGrid5Column3: TdxDBGridColumn; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGrid7: TdxDBGrid; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGrid8: TdxDBGrid; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGrid5Column4: TdxDBGridColumn; dxDBGrid1Column22: TdxDBGridColumn; dxDBGrid6Column4: TdxDBGridColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGrid7Column4: TdxDBGridColumn; dxDBGrid3Column19: TdxDBGridColumn; dxDBGrid4Column19: TdxDBGridColumn; dxDBGrid8Column4: TdxDBGridColumn; dxDBGrid5Column2: TdxDBGridColumn; dxDBGridDateColumn7: TdxDBGridColumn; dxDBGridDateColumn8: TdxDBGridColumn; dxDBGridDateColumn9: TdxDBGridColumn; dxDBGrid1Column23: TdxDBGridColumn; dxDBGrid2Column24: TdxDBGridColumn; dxDBGrid3Column20: TdxDBGridColumn; dxDBGrid4Column20: TdxDBGridColumn; dxDBGrid5Column5: TdxDBGridColumn; dxDBGrid5Column6: TdxDBGridColumn; dxDBGrid6Column5: TdxDBGridColumn; dxDBGrid6Column6: TdxDBGridColumn; dxDBGrid7Column5: TdxDBGridColumn; dxDBGrid7Column6: TdxDBGridColumn; dxDBGrid8Column5: TdxDBGridColumn; dxDBGrid8Column6: TdxDBGridColumn; bsSkinTabSheet5: TbsSkinTabSheet; dxDBGrid9: TdxDBGrid; dxDBGridColumn16: TdxDBGridColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridDateColumn11: TdxDBGridDateColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; v_fee_do_bscard_sum: TADOQuery; v_fee_do_bscard: TADOQuery; v_fee_do_bscard1: TDataSource; v_fee_do_bscard_sum1: TDataSource; dxDBGrid1Column24: TdxDBGridColumn; dxDBGrid2Column25: TdxDBGridColumn; dxDBGrid3Column21: TdxDBGridColumn; dxDBGrid4Column21: TdxDBGridColumn; dxDBGrid9Column24: TdxDBGridColumn; t_rate: TRxMemoryData; dxDBGrid1Column25: TdxDBGridColumn; dxDBGrid2Column26: TdxDBGridColumn; dxDBGrid3Column22: TdxDBGridColumn; dxDBGrid4Column22: TdxDBGridColumn; N2: TMenuItem; N3: TMenuItem; dxDBGrid9Column17: TdxDBGridColumn; dxDBGrid9Column18: TdxDBGridColumn; dxDBGrid9Column19: TdxDBGridColumn; dxDBGrid9Column20: TdxDBGridColumn; dxDBGrid9Column21: TdxDBGridColumn; procedure N1Click(Sender: TObject); procedure bs_textChange(Sender: TObject); procedure dxDBGrid1DblClick(Sender: TObject); procedure dxDBGrid2DblClick(Sender: TObject); procedure dxDBGrid3DblClick(Sender: TObject); procedure dxDBGrid4DblClick(Sender: TObject); procedure dxDBGrid9DblClick(Sender: TObject); procedure dxDBGrid9Column25CustomDraw(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 dxDBGrid9Column26CustomDraw(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 N3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; implementation uses u_main, my_sys_function, u_fee_do_fen; {$R *.dfm} procedure Tfra_ch_delete_do.N1Click(Sender: TObject); var i:integer; delete_num:real; usddelete_num:real; rmbdelete_num:real; RE:Boolean; begin //取消费用加入 RE:=TRUE; if (bs_text.Text='3') then begin if (do_ban1.DataSet.FieldByName('结算类别').asstring='流程') then begin RE:=FALSE; end; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet5 then begin if bs_text.Text='3'then if (do_ban1.DataSet.FieldByName('结算类别').asstring='流程')then begin if (do_ban1.DataSet.FieldByName('帐单状态').asstring<>'确认核销')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; end; do_ban1.DataSet.Edit; end else begin if bs_text.Text='3'then if (do_ban1.DataSet.FieldByName('结算类别').asstring='流程')then begin if (do_ban1.DataSet.FieldByName('帐单状态').asstring<>'确认核销')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; end; do_ban1.DataSet.Edit; end; usddelete_num:=0; rmbdelete_num:=0; if bsSkinPageControl1.ActivePage=bsSkinTabSheet1 then begin if v_fee_do_seae.IsEmpty then exit; if_ch_delete_do:=true; delete_do_type_num:=1; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin v_fee_do_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_seae.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_seae.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_seae.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_seae.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_seae.fieldbyname('CH_ID').AsInteger,v_fee_do_seae.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_seae.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; end else begin case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_seae.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_seae.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_seae.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_seae.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seae.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seae.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seae.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seae.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_seae.fieldbyname('CH_ID').AsInteger,v_fee_do_seae.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_seae.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; if (bs_text.Text='1') or (bs_text.Text='2') or (bs_text.Text='6') or (bs_text.Text='7') then begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if ((StrToBool(get_parameters_value(83,'false'))) AND RE) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实际金额']:=do_ban1.DataSet['实际金额']-delete_num; end; do_ban1.DataSet.post; end; end else begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实结金额']:=do_ban1.DataSet['实结金额']-delete_num; end; do_ban1.DataSet.post; end; end; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then begin if v_fee_do_seai.IsEmpty then exit; if_ch_delete_do:=true; delete_do_type_num:=2; if dxDBGrid2.SelectedCount>=1 then begin for i:=0 to dxDBGrid2.SelectedCount-1 do begin v_fee_do_seai.GotoBookmark(pointer(dxDBGrid2.selectedrows[i])); case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_seai.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_seai.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_seai.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('原始币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_seai.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_seai.fieldbyname('CH_ID').AsInteger,v_fee_do_seai.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_seai.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; end else begin case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_seai.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_seai.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_seai.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_seai.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_seai.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_seai.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_seai.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_seai.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_seae.fieldbyname('CH_ID').AsInteger,v_fee_do_seae.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_seai.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; if (bs_text.Text='1')or(bs_text.Text='2') or(bs_text.Text='6') or(bs_text.Text='7') then begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if ((StrToBool(get_parameters_value(83,'false'))) AND RE) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实际金额']:=do_ban1.DataSet['实际金额']-delete_num; end; do_ban1.DataSet.post; end; end else begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实结金额']:=do_ban1.DataSet['实结金额']-delete_num; end; do_ban1.DataSet.post; end; end; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet3 then begin if v_fee_do_aire.IsEmpty then exit; if_ch_delete_do:=true; delete_do_type_num:=3; if dxDBGrid3.SelectedCount>=1 then begin for i:=0 to dxDBGrid3.SelectedCount-1 do begin v_fee_do_aire.GotoBookmark(pointer(dxDBGrid3.selectedrows[i])); case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_aire.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_aire.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_aire.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_aire.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_aire.fieldbyname('CH_ID').AsInteger,v_fee_do_aire.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_aire.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; end else begin case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_aire.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_aire.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_aire.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_aire.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_aire.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_aire.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_aire.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_aire.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_aire.fieldbyname('CH_ID').asinteger,v_fee_do_aire.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_aire.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; if (bs_text.Text='1')or(bs_text.Text='2') or(bs_text.Text='6') or(bs_text.Text='7') then begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if ((StrToBool(get_parameters_value(83,'false'))) AND RE) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实际金额']:=do_ban1.DataSet['实际金额']-delete_num; end; do_ban1.DataSet.post; end; end else begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实结金额']:=do_ban1.DataSet['实结金额']-delete_num; end; do_ban1.DataSet.post; end; end; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet4 then begin if v_fee_do_airi.IsEmpty then exit; if_ch_delete_do:=true; delete_do_type_num:=4; if dxDBGrid4.SelectedCount>=1 then begin for i:=0 to dxDBGrid4.SelectedCount-1 do begin v_fee_do_airi.GotoBookmark(pointer(dxDBGrid4.selectedrows[i])); case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_airi.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_airi.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_airi.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_airi.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_airi.fieldbyname('CH_ID').AsInteger,v_fee_do_airi.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_airi.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; end else begin case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_airi.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_airi.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_airi.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_airi.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_airi.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_airi.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_airi.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_airi.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_airi.fieldbyname('CH_ID').AsInteger,v_fee_do_airi.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_airi.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; if (bs_text.Text='1')or(bs_text.Text='2') or (bs_text.Text='6') or (bs_text.Text='7') then begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if ((StrToBool(get_parameters_value(83,'false'))) AND RE) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实际金额']:=do_ban1.DataSet['实际金额']-delete_num; end; do_ban1.DataSet.post; end; end else begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实结金额']:=do_ban1.DataSet['实结金额']-delete_num; end; do_ban1.DataSet.post; end; end; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet5 then begin if v_fee_do_bscard.IsEmpty then exit; try frm_main.db.BeginTrans; if_ch_delete_do:=true; delete_do_type_num:=1; if dxDBGrid9.SelectedCount>=1 then begin for i:=0 to dxDBGrid9.SelectedCount-1 do begin v_fee_do_bscard.GotoBookmark(pointer(dxDBGrid9.selectedrows[i])); case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_bscard.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_bscard.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_bscard.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_bscard.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_bscard.fieldbyname('CH_ID').AsInteger,v_fee_do_bscard.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_bscard.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; end else begin case strtoint(bs_text.Text) of 1,7: begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; 2: begin if v_fee_do_bscard.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 6: begin if v_fee_do_bscard.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 3: begin if v_fee_do_bscard.FieldByName('类型').asstring='收' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; 4: begin if v_fee_do_bscard.FieldByName('类型').asstring='付' then if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num+v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num+v_fee_do_bscard.fieldbyname('金额').asfloat end else if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin if v_fee_do_bscard.FieldByName('币别').AsString='USD' then usddelete_num:=usddelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat else rmbdelete_num:=rmbdelete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end else begin delete_num:=delete_num-v_fee_do_bscard.fieldbyname('金额').asfloat; end; end; end; case strtoint(bs_text.Text) of 3,4: begin Setfee(1,v_fee_do_bscard.fieldbyname('CH_ID').AsInteger,v_fee_do_bscard.fieldbyname('原始金额').AsCurrency); end; end; p_fee_do_delete_one.Parameters[1].value:=v_fee_do_bscard.fieldbyname('DO_ID').asinteger; p_fee_do_delete_one.ExecProc; end; if (bs_text.Text='1')or(bs_text.Text='2') or (bs_text.Text='6') or (bs_text.Text='7') then begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if ((StrToBool(get_parameters_value(83,'false'))) AND RE) and (bs_text.Text<>'1') and (bs_text.Text<>'7') then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实际金额']:=do_ban1.DataSet['实际金额']-delete_num; end; do_ban1.DataSet.post; end; end else begin if (delete_num<>0) or (usddelete_num<>0) or (rmbdelete_num<>0) then begin do_ban1.DataSet.edit; if (StrToBool(get_parameters_value(83,'false'))) AND RE then begin do_ban1.DataSet['美元金额']:=do_ban1.DataSet['美元金额']-usddelete_num; do_ban1.DataSet['人民币金额']:=do_ban1.DataSet['人民币金额']-rmbdelete_num; end else begin do_ban1.DataSet['实结金额']:=do_ban1.DataSet['实结金额']-delete_num; end; do_ban1.DataSet.post; end; end; frm_main.db.CommitTrans; finally if frm_main.db.InTransaction then begin MessageDlg('连接出错,请关闭当前业务重试!',mterror,[mbok],0); frm_main.db.RollbackTrans; end; end; end; end; procedure Tfra_ch_delete_do.bs_textChange(Sender: TObject); begin //列表显示 case strtoint(bs_text.text) of 1,7: begin dxDBGrid5Column4.Visible:=false; dxDBGrid1Column22.Visible:=false; dxDBGrid6Column4.Visible:=false; dxDBGrid2Column23.Visible:=false; dxDBGrid7Column4.Visible:=false; dxDBGrid3Column19.Visible:=false; dxDBGrid4Column19.Visible:=false; dxDBGrid8Column4.Visible:=false; // dxDBGridColumn22.Visible:=false; dxDBGridColumn16.Visible:=false; dxDBGrid1Column6.Caption:='申请金额'; dxDBGridColumn1.Caption:='申请金额'; dxDBGridColumn5.Caption:='申请金额'; dxDBGridColumn9.Caption:='申请金额'; dxDBGridColumn17.Caption:='申请金额'; end; 2,6: begin dxDBGrid5Column4.Visible:=true; dxDBGrid1Column22.Visible:=true; dxDBGrid6Column4.Visible:=true; dxDBGrid2Column23.Visible:=true; dxDBGrid7Column4.Visible:=true; dxDBGrid3Column19.Visible:=true; dxDBGrid4Column19.Visible:=true; dxDBGrid8Column4.Visible:=True; // dxDBGridColumn22.Visible:=True; dxDBGridColumn16.Visible:=True; dxDBGrid1Column6.Caption:='申请金额'; dxDBGridColumn1.Caption:='申请金额'; dxDBGridColumn5.Caption:='申请金额'; dxDBGridColumn9.Caption:='申请金额'; dxDBGridColumn17.Caption:='申请金额'; end; 3,4: begin dxDBGrid5Column4.Visible:=true; dxDBGrid1Column22.Visible:=true; dxDBGrid6Column4.Visible:=true; dxDBGrid2Column23.Visible:=true; dxDBGrid7Column4.Visible:=true; dxDBGrid3Column19.Visible:=true; dxDBGrid4Column19.Visible:=true; dxDBGrid8Column4.Visible:=true; // dxDBGridColumn22.Visible:=True; dxDBGridColumn16.Visible:=True; dxDBGrid1Column6.Caption:='结算金额'; dxDBGridColumn1.Caption:='结算金额'; dxDBGridColumn5.Caption:='结算金额'; dxDBGridColumn9.Caption:='结算金额'; dxDBGridColumn17.Caption:='结算金额'; end; end; end; procedure Tfra_ch_delete_do.dxDBGrid1DblClick(Sender: TObject); begin fee_view(v_fee_do_seae.fieldbyname('编号').asstring); end; procedure Tfra_ch_delete_do.dxDBGrid2DblClick(Sender: TObject); begin fee_view(v_fee_do_seai.fieldbyname('编号').asstring); end; procedure Tfra_ch_delete_do.dxDBGrid3DblClick(Sender: TObject); begin fee_view(v_fee_do_aire.fieldbyname('编号').asstring); end; procedure Tfra_ch_delete_do.dxDBGrid4DblClick(Sender: TObject); begin fee_view(v_fee_do_airi.fieldbyname('编号').asstring); end; procedure Tfra_ch_delete_do.dxDBGrid9DblClick(Sender: TObject); begin fee_view(v_fee_do_bscard.fieldbyname('编号').asstring); end; procedure Tfra_ch_delete_do.dxDBGrid9Column25CustomDraw(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 { AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid9Column25.Index]); AFont.Color:=clblack; } end; procedure Tfra_ch_delete_do.dxDBGrid9Column26CustomDraw(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 { AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid9Column26.Index]); AFont.Color:=clblack; } end; procedure Tfra_ch_delete_do.N3Click(Sender: TObject); begin grid_save_xls(dxDBGrid9); end; end.