unit u_ch_balance_pay; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, DB, ADODB, u_ch_add_do, u_ch_delete_do, wwdbedit, Wwdotdot, Wwdbcomb, StdCtrls, DBCtrls, bsSkinCtrls, bsdbctrls, RxLookup, Mask, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, Menus, XPMenu, ComCtrls, bsSkinTabs, ExtCtrls; type Tfrm_ch_balance_pay = class(TForm) t_ch_balance: TADOQuery; t_ch_balance1: TDataSource; t_ch_fee_do: TADOQuery; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinNotebook1: TbsSkinNotebook; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridColumn; 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; bsSkinPanel3: TbsSkinPanel; Label25: TLabel; Label17: TLabel; Label12: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; DBEdit14: TDBEdit; DBEdit1: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit; DBEdit10: TDBEdit; DBMemo1: TDBMemo; RxDBLookupCombo2: TRxDBLookupCombo; wwDBComboBox1: TwwDBComboBox; RxDBLookupCombo3: TRxDBLookupCombo; fra_ch_delete_do1: Tfra_ch_delete_do; fra_ch_add_do1: Tfra_ch_add_do; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinPanel2: TbsSkinPanel; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton6: TbsSkinButton; t_ch_check1: TDataSource; t_ch_check: TADOQuery; v_fee_do_seae: TADOQuery; v_fee_do_seae1: TDataSource; v_fee_do_seai: TADOQuery; v_fee_do_seai1: TDataSource; v_fee_do_aire: TADOQuery; v_fee_do_airi: TADOQuery; v_fee_do_airi1: TDataSource; v_fee_do_aire1: TDataSource; Panel1: TPanel; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; bsSkinPanel4: TbsSkinPanel; Label11: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label18: TLabel; Label20: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label26: TLabel; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit7: TDBEdit; DBEdit11: TDBEdit; DBEdit13: TDBEdit; DBMemo2: TDBMemo; DBEdit16: TDBEdit; DBEdit17: TDBEdit; DBEdit18: TDBEdit; DBEdit12: TDBEdit; bsSkinPanel5: TbsSkinPanel; bsSkinButton21: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; DBEdit15: TDBEdit; bsSkinPanel6: TbsSkinPanel; bsSkinGroupBox1: TbsSkinGroupBox; Label38: TLabel; DBEdit27: TDBEdit; Label39: TLabel; DBEdit28: TDBEdit; Label40: TLabel; DBEdit29: TDBEdit; Label41: TLabel; DBEdit30: TDBEdit; DBEdit31: TDBEdit; Label42: TLabel; DBEdit32: TDBEdit; Label43: TLabel; Label44: TLabel; DBEdit33: TDBEdit; Label45: TLabel; DBEdit34: TDBEdit; DBEdit35: TDBEdit; Label46: TLabel; DBEdit36: TDBEdit; Label47: TLabel; Label48: TLabel; DBMemo4: TDBMemo; bsSkinGroupBox2: TbsSkinGroupBox; Label19: TLabel; DBEdit19: TDBEdit; Label21: TLabel; DBEdit20: TDBEdit; Label27: TLabel; Label28: TLabel; Label29: TLabel; DBEdit22: TDBEdit; Label31: TLabel; DBEdit21: TDBEdit; Label30: TLabel; Label32: TLabel; DBEdit23: TDBEdit; Label33: TLabel; Label34: TLabel; DBEdit24: TDBEdit; DBEdit26: TDBEdit; Label36: TLabel; DBEdit25: TDBEdit; Label35: TLabel; Label37: TLabel; DBMemo3: TDBMemo; DBEdit37: TDBEdit; DBEdit38: TDBEdit; Label49: TLabel; DBEdit39: TDBEdit; t_ch_check_detail: TADOQuery; t_ch_check_detail1: TDataSource; DBEdit40: TDBEdit; DBEdit41: TDBEdit; bsSkinPanel7: TbsSkinPanel; DBEdit42: TDBEdit; p_update: TADOStoredProc; t_ch_fee_do_check: TADOQuery; bsSkinButton7: TbsSkinButton; dxDBGrid2Column12: TdxDBGridColumn; Label50: TLabel; DBEdit43: TDBEdit; Label51: TLabel; DBEdit44: TDBEdit; bsSkinButton12: TbsSkinButton; Label52: TLabel; DBEdit45: TDBEdit; Label53: TLabel; DBEdit46: TDBEdit; PopupMenu3: TPopupMenu; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N1: TMenuItem; N6: TMenuItem; N5: TMenuItem; N4: TMenuItem; Label54: TLabel; DBEdit47: TDBEdit; Label55: TLabel; DBEdit48: TDBEdit; bsSkinButton13: TbsSkinButton; dxDBGrid1Column16: TdxDBGridColumn; 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; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGridMaskColumn58: TdxDBGridMaskColumn; dxDBGridMaskColumn59: TdxDBGridMaskColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridMaskColumn60: TdxDBGridMaskColumn; dxDBGrid6Column22: TdxDBGridColumn; dxDBGridDateColumn9: TdxDBGridDateColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGrid11: TdxDBGrid; dxDBGrid5Column4: TdxDBGridColumn; dxDBGrid5Column1: TdxDBGridMaskColumn; dxDBGrid5Column2: TdxDBGridColumn; dxDBGrid5Column5: TdxDBGridColumn; dxDBGrid5Column6: TdxDBGridColumn; dxDBGrid5Column3: TdxDBGridColumn; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGrid; dxDBGrid6Column4: TdxDBGridColumn; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGrid6Column5: TdxDBGridColumn; dxDBGrid6Column6: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; bsSkinTabSheet5: TbsSkinTabSheet; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGrid8Column19: TdxDBGridColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGrid; dxDBGrid7Column4: TdxDBGridColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGrid7Column5: TdxDBGridColumn; dxDBGrid7Column6: TdxDBGridColumn; dxDBGridColumn44: TdxDBGridColumn; bsSkinTabSheet6: TbsSkinTabSheet; dxDBGrid5: TdxDBGrid; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGridColumn45: TdxDBGridColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGridMaskColumn115: TdxDBGridMaskColumn; dxDBGridMaskColumn116: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGrid; dxDBGrid8Column4: TdxDBGridColumn; dxDBGridMaskColumn117: TdxDBGridMaskColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGrid8Column5: TdxDBGridColumn; dxDBGrid8Column6: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; bsSkinPageControl3: TbsSkinPageControl; bsSkinTabSheet7: TbsSkinTabSheet; dxDBGrid7: TdxDBGrid; dxDBGrid2Column22: TdxDBGridColumn; dxDBGridMaskColumn61: TdxDBGridMaskColumn; dxDBGridMaskColumn62: TdxDBGridMaskColumn; dxDBGridMaskColumn63: TdxDBGridMaskColumn; dxDBGridMaskColumn64: TdxDBGridMaskColumn; dxDBGridMaskColumn65: TdxDBGridMaskColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridMaskColumn66: TdxDBGridMaskColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGridDateColumn11: TdxDBGridDateColumn; dxDBGridDateColumn12: TdxDBGridDateColumn; dxDBGridMaskColumn67: TdxDBGridMaskColumn; dxDBGridMaskColumn68: TdxDBGridMaskColumn; dxDBGridMaskColumn69: TdxDBGridMaskColumn; dxDBGridMaskColumn70: TdxDBGridMaskColumn; dxDBGridMaskColumn71: TdxDBGridMaskColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridMaskColumn72: TdxDBGridMaskColumn; dxDBGridMaskColumn73: TdxDBGridMaskColumn; dxDBGridMaskColumn74: TdxDBGridMaskColumn; dxDBGridMaskColumn75: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGrid; dxDBGridColumn39: TdxDBGridColumn; dxDBGridMaskColumn76: TdxDBGridMaskColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridColumn25: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; bsSkinTabSheet8: TbsSkinTabSheet; dxDBGrid8: TdxDBGrid; dxDBGrid3Column22: TdxDBGridColumn; dxDBGridMaskColumn77: TdxDBGridMaskColumn; dxDBGridMaskColumn78: TdxDBGridMaskColumn; dxDBGridMaskColumn79: TdxDBGridMaskColumn; dxDBGridMaskColumn80: TdxDBGridMaskColumn; dxDBGridMaskColumn81: TdxDBGridMaskColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridMaskColumn82: TdxDBGridMaskColumn; dxDBGrid3Column23: TdxDBGridColumn; dxDBGridDateColumn13: TdxDBGridDateColumn; dxDBGridDateColumn14: TdxDBGridDateColumn; dxDBGridMaskColumn83: TdxDBGridMaskColumn; dxDBGridMaskColumn84: TdxDBGridMaskColumn; dxDBGridMaskColumn85: TdxDBGridMaskColumn; dxDBGridMaskColumn86: TdxDBGridMaskColumn; dxDBGridMaskColumn87: TdxDBGridMaskColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridMaskColumn88: TdxDBGridMaskColumn; dxDBGridMaskColumn89: TdxDBGridMaskColumn; dxDBGridMaskColumn90: TdxDBGridMaskColumn; dxDBGridMaskColumn91: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGrid; dxDBGridColumn40: TdxDBGridColumn; dxDBGridMaskColumn92: TdxDBGridMaskColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGridColumn53: TdxDBGridColumn; bsSkinTabSheet9: TbsSkinTabSheet; dxDBGrid9: TdxDBGrid; dxDBGrid4Column19: TdxDBGridColumn; dxDBGridMaskColumn93: TdxDBGridMaskColumn; dxDBGridMaskColumn94: TdxDBGridMaskColumn; dxDBGridMaskColumn95: TdxDBGridMaskColumn; dxDBGridMaskColumn96: TdxDBGridMaskColumn; dxDBGridMaskColumn97: TdxDBGridMaskColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridMaskColumn98: TdxDBGridMaskColumn; dxDBGrid4Column20: TdxDBGridColumn; dxDBGridDateColumn15: TdxDBGridDateColumn; dxDBGridDateColumn16: TdxDBGridDateColumn; dxDBGridMaskColumn99: TdxDBGridMaskColumn; dxDBGridMaskColumn100: TdxDBGridMaskColumn; dxDBGridMaskColumn101: TdxDBGridMaskColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridColumn33: TdxDBGridColumn; dxDBGridMaskColumn102: TdxDBGridMaskColumn; dxDBGridMaskColumn103: TdxDBGridMaskColumn; dxDBGridMaskColumn104: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGrid; dxDBGridColumn41: TdxDBGridColumn; dxDBGridMaskColumn118: TdxDBGridMaskColumn; dxDBGridColumn54: TdxDBGridColumn; dxDBGridColumn55: TdxDBGridColumn; dxDBGridColumn56: TdxDBGridColumn; dxDBGridColumn57: TdxDBGridColumn; bsSkinTabSheet10: TbsSkinTabSheet; dxDBGrid10: TdxDBGrid; dxDBGrid5Column19: TdxDBGridColumn; dxDBGridMaskColumn105: TdxDBGridMaskColumn; dxDBGridMaskColumn106: TdxDBGridMaskColumn; dxDBGridMaskColumn107: TdxDBGridMaskColumn; dxDBGridMaskColumn108: TdxDBGridMaskColumn; dxDBGridMaskColumn109: TdxDBGridMaskColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridColumn35: TdxDBGridColumn; dxDBGridMaskColumn110: TdxDBGridMaskColumn; dxDBGrid5Column20: TdxDBGridColumn; dxDBGridDateColumn17: TdxDBGridDateColumn; dxDBGridDateColumn18: TdxDBGridDateColumn; dxDBGridMaskColumn111: TdxDBGridMaskColumn; dxDBGridMaskColumn112: TdxDBGridMaskColumn; dxDBGridMaskColumn113: TdxDBGridMaskColumn; dxDBGridColumn42: TdxDBGridColumn; dxDBGridColumn58: TdxDBGridColumn; dxDBGridMaskColumn114: TdxDBGridMaskColumn; dxDBGridMaskColumn119: TdxDBGridMaskColumn; dxDBGridMaskColumn120: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGrid; dxDBGridColumn59: TdxDBGridColumn; dxDBGridMaskColumn121: TdxDBGridMaskColumn; dxDBGridColumn60: TdxDBGridColumn; dxDBGridColumn61: TdxDBGridColumn; dxDBGridColumn62: TdxDBGridColumn; dxDBGridColumn63: TdxDBGridColumn; dxDBGrid6Column23: TdxDBGridColumn; dxDBGrid3Column24: TdxDBGridColumn; dxDBGrid4Column21: TdxDBGridColumn; dxDBGrid5Column21: TdxDBGridColumn; dxDBGrid7Column24: TdxDBGridColumn; dxDBGrid8Column24: TdxDBGridColumn; dxDBGrid9Column21: TdxDBGridColumn; dxDBGrid10Column21: TdxDBGridColumn; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormResize(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 DBEdit4Enter(Sender: TObject); procedure t_ch_balanceBeforeEdit(DataSet: TDataSet); procedure RxDBLookupCombo1Enter(Sender: TObject); 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 DBEdit1Change(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure t_ch_balanceAfterPost(DataSet: TDataSet); procedure t_ch_balanceAfterDelete(DataSet: TDataSet); procedure DBEdit14KeyPress(Sender: TObject; var Key: Char); procedure DBEdit1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1KeyPress(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 bsSkinDBCheckRadioBox1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit8KeyPress(Sender: TObject; var Key: Char); procedure DBEdit9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit10KeyPress(Sender: TObject; var Key: Char); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure RxDBLookupCombo2Change(Sender: TObject); procedure DBEdit42Change(Sender: TObject); procedure bsSkinButton21Click(Sender: TObject); procedure bsSkinButton25Click(Sender: TObject); procedure bsSkinPageControl1Changing(Sender: TObject; var AllowChange: Boolean); procedure bsSkinButton24Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinPanel5Resize(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_balance_pay: Tfrm_ch_balance_pay; ch_balance_pay_open:boolean; implementation uses my_sys_function, u_main, u_ch_balance_query, u_data_share, u_ch_check_do, u_ch_shen_query; {$R *.dfm} procedure Tfrm_ch_balance_pay.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_balance_pay.FormClose(Sender: TObject; var Action: TCloseAction); begin ch_balance_pay_open:=false; savereggrid(dxdbgrid1,caption); frm_ch_balance_pay.Hide; frm_ch_balance_pay.ManualFloat(frm_ch_balance_pay.BoundsRect ); frm_main.freeTabs('frm_ch_balance_pay'); ch_balance_pay_open:=false; action:=cafree; frm_ch_balance_pay:=nil; end; procedure Tfrm_ch_balance_pay.FormResize(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; bsSkinButton13.Width:=i; end; procedure Tfrm_ch_balance_pay.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 类型='+''''+'付'+''''+' order by 帐单编号 desc'); t_ch_balance.open; t_ch_fee_do.open; t_ch_check_detail.open; t_ch_check.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; t_ch_fee_do_check.open; ch_balance_pay_open:=true; fra_ch_add_do1.do_ban1.DataSet:=t_ch_balance; fra_ch_add_do1.bs_text.text:='4'; fra_ch_add_do1.t_ch_fee_do.open; fra_ch_delete_do1.v_fee_do_seae.SQL.clear; fra_ch_delete_do1.v_fee_do_seae.sql.add('select * from v_fee_do_seae ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seae.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seae.Open; fra_ch_delete_do1.v_fee_do_seai.SQL.clear; fra_ch_delete_do1.v_fee_do_seai.sql.add('select * from v_fee_do_seai ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seai.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seai.Open; fra_ch_delete_do1.v_fee_do_aire.SQL.clear; fra_ch_delete_do1.v_fee_do_aire.sql.add('select * from v_fee_do_aire ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_aire.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_aire.Open; fra_ch_delete_do1.v_fee_do_airi.SQL.clear; fra_ch_delete_do1.v_fee_do_airi.sql.add('select * from v_fee_do_airi ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_airi.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_airi.Open; fra_ch_delete_do1.v_fee_do_seae_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_seae_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_seae ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),开船日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_seae_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seae_sum.Open; fra_ch_delete_do1.v_fee_do_seai_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_seai_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_seai ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_seai_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seai_sum.Open; fra_ch_delete_do1.v_fee_do_aire_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_aire_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开航日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_aire ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),开航日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),开航日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_aire_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_aire_sum.Open; fra_ch_delete_do1.v_fee_do_airi_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_airi_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_airi ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_airi_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_airi_sum.Open; fra_ch_delete_do1.bs_text.Text:='4'; fra_ch_delete_do1.do_ban1.DataSet:=t_ch_balance; loadreggrid(dxdbgrid1,false,caption); frm_data_share.t_crm_client_all.requery; frm_data_share.t_code_currency.requery; frm_data_share.t_sys_bank.requery; end; procedure Tfrm_ch_balance_pay.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin if t_ch_balance.IsEmpty then exit; if DBEdit42.text='自由'then begin bsSkinNotebook1.PageIndex:=1; end else begin bsSkinNotebook1.PageIndex:=2; end; 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_pay.t_ch_balanceAfterInsert(DataSet: TDataSet); begin t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算类别']:='自由'; t_ch_balance['结算人']:=employee; t_ch_balance['结算日期']:=now; t_ch_balance['自动']:=1; t_ch_balance['结算金额']:=0; t_ch_balance['实结金额']:=0; t_ch_balance['虚结金额']:=0; t_ch_balance['类型']:='付'; t_ch_balance['财务']:=0; end; procedure Tfrm_ch_balance_pay.bsSkinButton1Click(Sender: TObject); begin t_ch_balance.insert; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end; procedure Tfrm_ch_balance_pay.bsSkinButton2Click(Sender: TObject); begin table_post(t_ch_balance); end; procedure Tfrm_ch_balance_pay.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_fee_do.requery; while not t_ch_fee_do.eof do t_ch_fee_do.delete; if t_ch_balance.FieldByName('结算类别').asstring<>'自由'then begin p_update.Parameters.ParamByName('SQLStr').value:='update t_ch_check set 申请状态=' +''''+'批准支付'+''''+',帐单编号='+''''+'''' +' where 帐单编号='+'''' +t_ch_balance.FieldByName('帐单编号').asstring+''''; p_update.ExecProc; t_ch_check.requery; end; t_ch_balance.Delete; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton3Click(Sender: TObject); begin table_cancel(t_ch_balance); end; procedure Tfrm_ch_balance_pay.t_ch_balanceBeforePost(DataSet: TDataSet); begin 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.FieldByName('自动').asboolean then begin t_ch_balance['结算金额']:=t_ch_balance['实结金额']; end else begin {if t_ch_balance['结算金额']''then begin if frm_data_share.t_sys_bank.Locate('币别',RxDBLookupCombo2.DisplayValues[0],[])then begin t_ch_balance['银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; end; end; procedure Tfrm_ch_balance_pay.DBEdit42Change(Sender: TObject); begin if bsSkinNotebook1.PageIndex<>0 then begin if DBEdit42.text='自由'then begin bsSkinNotebook1.PageIndex:=1; end else begin bsSkinNotebook1.PageIndex:=2; end; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton21Click(Sender: TObject); begin close; end; procedure Tfrm_ch_balance_pay.bsSkinButton25Click(Sender: TObject); begin if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring<>'批准支付') and (t_ch_check.FieldByName('申请状态').asstring<>'禁止修改') then begin showmessage('当前申请状态不能实现支付!!'); exit; end; try frm_ch_check_do:=tfrm_ch_check_do.Create (self); frm_ch_check_do.Edit1.text:=t_ch_check.fieldbyname('相关号码').asstring; frm_ch_check_do.ShowModal; finally frm_ch_check_do.Free; frm_ch_check_do:=nil; end; end; procedure Tfrm_ch_balance_pay.bsSkinPageControl1Changing(Sender: TObject; var AllowChange: Boolean); begin if ch_balance_pay_open then begin if (t_ch_balance.State=dsinsert)or(t_ch_balance.State=dsedit) then BEGIN if application.MessageBox('数据已经修改,是否保存?','警告:',MB_OKCANCEL)=IDOK then t_ch_balance.post else t_ch_balance.cancel; END; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton24Click(Sender: TObject); begin try frm_ch_shen_query:=tfrm_ch_shen_query.Create (self); shen_query_type:=6; shen_query_limited:='no'; shen_query_op_limited:='no'; frm_ch_shen_query.ShowModal; finally frm_ch_shen_query.Free; frm_ch_shen_query:=nil; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton12Click(Sender: TObject); begin t_ch_check.close; t_ch_check.sql.clear; t_ch_check.sql.add('select * from t_ch_check ' +'where 申请状态 in ('+''''+'批准支付'+''''+',' +''''+'禁止修改'+''''+')' +' AND 要求支付日期='+''''+datetostr(date)+'''' +' order by 申请编号'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.bsSkinPanel5Resize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel5.width/5); bsSkinButton24.width:=i; bsSkinButton12.width:=i; bsSkinButton7.width:=i; bsSkinButton25.width:=i; end; procedure Tfrm_ch_balance_pay.bsSkinButton7Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton7.ClientToScreen(Point(0,bsSkinButton7.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_pay.N17Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'申请支付'+'''' +') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.N34Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'驳回申请'+'''' +','+''''+'禁止修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.N36Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'提交申请'+'''' +','+''''+'申请修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.N6Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'批准支付'+'''' +','+''''+'禁止修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.N4Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'支付完毕'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_balance_pay.bsSkinButton13Click(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['结算类别']:='自由'; t_ch_balance['结算人']:=employee; t_ch_balance['结算日期']:=now; t_ch_balance['自动']:=1; t_ch_balance['结算金额']:=0; t_ch_balance['实结金额']:=0; t_ch_balance['虚结金额']:=0; t_ch_balance['类型']:='付'; t_ch_balance['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance['备注']:=''; 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; end.