{$INCLUDE t_main.inc} 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, wwdbdatetimepicker, sncCurrency, sncDBCurrency, ToolEdit, CurrEdit, RXDBCtrl, DBCtrlsEh, AAFont, AACtrls, RxMemDS, bsSkinGrids, bsDBGrids, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGrid, cxCurrencyEdit, cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalc, cxDBEdit; 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; 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; DBEdit26: TDBEdit; Label36: TLabel; DBEdit25: TDBEdit; Label35: TLabel; Label37: TLabel; DBMemo3: TDBMemo; DBEdit37: 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; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column18: TdxDBGridColumn; dxDBGrid2Column13: TdxDBGridColumn; dxDBGrid2Column14: TdxDBGridColumn; Label69: TLabel; DBEdit57: TDBEdit; Label70: TLabel; DBEdit58: TDBEdit; Label71: TLabel; DBEdit59: TDBEdit; Label72: TLabel; DBEdit60: TDBEdit; bsSkinPanel9: TbsSkinPanel; Label73: TLabel; Label74: TLabel; Label75: TLabel; Label77: TLabel; Label78: TLabel; Label80: TLabel; Label81: TLabel; Label82: TLabel; Label84: TLabel; Label85: TLabel; Label86: TLabel; Label87: TLabel; DBEdit61: TDBEdit; DBEdit62: TDBEdit; DBEdit63: TDBEdit; DBEdit64: TDBEdit; DBMemo6: TDBMemo; DBEdit66: TDBEdit; DBEdit67: TDBEdit; DBEdit68: TDBEdit; DBEdit69: TDBEdit; DBEdit71: TDBEdit; DBEdit72: TDBEdit; DBEdit73: TDBEdit; DBEdit74: TDBEdit; Label83: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; bsSkinPanel10: TbsSkinPanel; dxDBGrid1Column19: TdxDBGridColumn; dxDBGrid1Column20: TdxDBGridColumn; bsSkinButton38: TbsSkinButton; wwDBDateTimePicker3: TwwDBDateTimePicker; bstab5: TbsSkinTabSheet; dxDBGrid19: TdxDBGrid; dxDBGridColumn64: TdxDBGridColumn; dxDBGridMaskColumn122: TdxDBGridMaskColumn; dxDBGridColumn65: TdxDBGridColumn; dxDBGridColumn66: TdxDBGridColumn; dxDBGridColumn67: TdxDBGridColumn; dxDBGridColumn68: TdxDBGridColumn; dxDBGrid20: TdxDBGrid; dxDBGridColumn69: TdxDBGridColumn; dxDBGridMaskColumn123: TdxDBGridMaskColumn; dxDBGridMaskColumn124: TdxDBGridMaskColumn; dxDBGridMaskColumn125: TdxDBGridMaskColumn; dxDBGridMaskColumn126: TdxDBGridMaskColumn; dxDBGridMaskColumn127: TdxDBGridMaskColumn; dxDBGridColumn70: TdxDBGridColumn; dxDBGridColumn71: TdxDBGridColumn; dxDBGridMaskColumn128: TdxDBGridMaskColumn; dxDBGridColumn72: TdxDBGridColumn; dxDBGrid9Column24: TdxDBGridColumn; dxDBGridDateColumn19: TdxDBGridDateColumn; dxDBGridDateColumn20: TdxDBGridDateColumn; dxDBGridMaskColumn129: TdxDBGridMaskColumn; dxDBGridMaskColumn130: TdxDBGridMaskColumn; dxDBGridMaskColumn131: TdxDBGridMaskColumn; dxDBGridMaskColumn132: TdxDBGridMaskColumn; dxDBGridMaskColumn133: TdxDBGridMaskColumn; dxDBGridColumn73: TdxDBGridColumn; dxDBGridColumn74: TdxDBGridColumn; dxDBGridMaskColumn134: TdxDBGridMaskColumn; dxDBGridMaskColumn135: TdxDBGridMaskColumn; dxDBGridMaskColumn136: TdxDBGridMaskColumn; dxDBGridMaskColumn137: TdxDBGridMaskColumn; Label64: TLabel; dxDBGrid1Column22: TdxDBGridColumn; Label79: TLabel; DBEdit70: TDBEdit; dxDBGrid1Column23: TdxDBGridColumn; t_ch_zhipiao1: TDataSource; t_ch_zhipiao: TADOQuery; bskntbshtTBS3: TbsSkinTabSheet; bsSkinPageControl4: TbsSkinPageControl; bsSkinTabSheet11: TbsSkinTabSheet; bsSkinPanel11: TbsSkinPanel; bsSkinButton14: TbsSkinButton; bsSkinButton15: TbsSkinButton; bsSkinButton16: TbsSkinButton; bsSkinButton18: TbsSkinButton; bsSkinButton19: TbsSkinButton; bsSkinButton20: TbsSkinButton; bsSkinButton22: TbsSkinButton; bsSkinButton23: TbsSkinButton; dxDBGrid21: TdxDBGrid; dxDBGridMaskColumn138: TdxDBGridMaskColumn; dxDBGridMaskColumn139: TdxDBGridMaskColumn; dxDBGridMaskColumn140: TdxDBGridMaskColumn; dxDBGridMaskColumn141: TdxDBGridMaskColumn; dxDBGridColumn75: TdxDBGridColumn; dxDBGridDateColumn21: TdxDBGridDateColumn; dxDBGridMaskColumn142: TdxDBGridMaskColumn; dxDBGridMaskColumn143: TdxDBGridMaskColumn; dxDBGridMaskColumn144: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridCheckColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column27: TdxDBGridDateColumn; dxDBGrid1Column28: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridCheckColumn; dxDBGrid1Column29: TdxDBGridCheckColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGrid1Column36: TdxDBGridDateColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridMaskColumn; dxDBGrid1Column34: TdxDBGridDateColumn; bsSkinTabSheet12: TbsSkinTabSheet; bsSkinPanel12: TbsSkinPanel; bsSkinButton26: TbsSkinButton; bsSkinButton27: TbsSkinButton; bsSkinButton28: TbsSkinButton; bsSkinButton29: TbsSkinButton; bsSkinButton30: TbsSkinButton; bsSkinButton31: TbsSkinButton; bsSkinButton33: TbsSkinButton; bsSkinButton35: TbsSkinButton; bsSkinButton36: TbsSkinButton; bsSkinPanel13: TbsSkinPanel; Label88: TLabel; Label89: TLabel; Label90: TLabel; Label91: TLabel; Label92: TLabel; DBEdit75: TDBEdit; DBEdit76: TDBEdit; DBEdit77: TDBEdit; DBEdit78: TDBEdit; RxDBLookupCombo6: TRxDBLookupCombo; s_invoice: TScrollBox; Label93: TLabel; Label94: TLabel; Label96: TLabel; Label97: TLabel; Shape1: TShape; AALabel1: TAALabel; Label98: TLabel; lblYEAR: TLabel; Label99: TLabel; lblMonth: TLabel; Label101: TLabel; lblDay: TLabel; Label102: TLabel; Label103: TLabel; Shape2: TShape; Label104: TLabel; sncCurrencyLabel1: TsncCurrencyLabel; Label105: TLabel; Label106: TLabel; Label107: TLabel; Label108: TLabel; DBText1: TDBText; DBText2: TDBText; DBText3: TDBText; DBText4: TDBText; Label109: TLabel; Label110: TLabel; Label111: TLabel; Shape3: TShape; Label112: TLabel; Label113: TLabel; lbl1: TLabel; lbl2: TLabel; bsSkinPanel14: TbsSkinPanel; Label114: TLabel; Label115: TLabel; DBEdit79: TDBEdit; DBEdit80: TDBEdit; bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; csj: TDBDateTimeEditEh; rxdbj: TRxDBCalcEdit; snccy: TsncDBCurrencyEdit; czphm: TDBEdit; DBEdit81: TDBEdit; DBComboBox1: TDBComboBox; DBComboBox2: TDBComboBox; DBEdit82: TDBEdit; DBEdit83: TDBEdit; dbedt1: TDBEdit; dbedt2: TDBEdit; PopupMenu1: TPopupMenu; MenuItem1: TMenuItem; N2: TMenuItem; N3: TMenuItem; MenuItem2: TMenuItem; N20: TMenuItem; tab5: TbsSkinTabSheet; dxDBGrid22: TdxDBGrid; dxDBGridColumn76: TdxDBGridColumn; dxDBGridMaskColumn145: TdxDBGridMaskColumn; dxDBGridColumn77: TdxDBGridColumn; dxDBGridColumn78: TdxDBGridColumn; dxDBGridColumn79: TdxDBGridColumn; dxDBGridColumn80: TdxDBGridColumn; dxDBGrid23: TdxDBGrid; dxDBGridMaskColumn146: TdxDBGridMaskColumn; dxDBGridMaskColumn147: TdxDBGridMaskColumn; dxDBGridMaskColumn148: TdxDBGridMaskColumn; dxDBGridMaskColumn149: TdxDBGridMaskColumn; dxDBGridMaskColumn150: TdxDBGridMaskColumn; dxDBGridColumn81: TdxDBGridColumn; dxDBGridColumn82: TdxDBGridColumn; dxDBGridColumn83: TdxDBGridColumn; dxDBGridMaskColumn151: TdxDBGridMaskColumn; dxDBGridColumn84: TdxDBGridColumn; dxDBGridDateColumn22: TdxDBGridDateColumn; dxDBGridDateColumn23: TdxDBGridDateColumn; dxDBGridMaskColumn152: TdxDBGridMaskColumn; dxDBGridMaskColumn153: TdxDBGridMaskColumn; dxDBGridMaskColumn154: TdxDBGridMaskColumn; dxDBGridMaskColumn155: TdxDBGridMaskColumn; dxDBGridMaskColumn156: TdxDBGridMaskColumn; dxDBGridColumn85: TdxDBGridColumn; dxDBGridColumn86: TdxDBGridColumn; dxDBGridMaskColumn157: TdxDBGridMaskColumn; dxDBGridMaskColumn158: TdxDBGridMaskColumn; dxDBGridMaskColumn159: TdxDBGridMaskColumn; dxDBGridMaskColumn160: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridColumn; dxDBGrid1Column37: TdxDBGridColumn; RxDBLookupCombo10: TRxDBLookupCombo; RxDBLookupCombo11: TRxDBLookupCombo; wwDBComboBox3: TwwDBComboBox; RxDBLookupCombo21: TRxDBLookupCombo; DBEdit24: TDBEdit; DBEdit84: TDBEdit; Label116: TLabel; RxDBLookupCombo18: TRxDBLookupCombo; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo7: TRxDBLookupCombo; bsSkinPanel8: TbsSkinPanel; Label56: TLabel; Label57: TLabel; Label58: TLabel; Label59: TLabel; Label60: TLabel; Label61: TLabel; Label62: TLabel; Label63: TLabel; Label65: TLabel; Label66: TLabel; Label67: TLabel; Label68: TLabel; Label95: TLabel; Label100: TLabel; Label76: TLabel; DBEdit49: TDBEdit; DBEdit50: TDBEdit; RxDBLookupCombo4: TRxDBLookupCombo; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; DBEdit51: TDBEdit; DBEdit52: TDBEdit; DBEdit53: TDBEdit; DBEdit54: TDBEdit; DBEdit55: TDBEdit; DBEdit56: TDBEdit; DBMemo5: TDBMemo; RxDBLookupCombo5: TRxDBLookupCombo; wwDBComboBox2: TwwDBComboBox; wwDBDateTimePicker2: TwwDBDateTimePicker; RxDBLookupCombo15: TRxDBLookupCombo; RxDBLookupCombo14: TRxDBLookupCombo; RxDBLookupCombo13: TRxDBLookupCombo; RxDBLookupCombo16: TRxDBLookupCombo; DBEdit65: TDBEdit; bsSkinPageControl5: TbsSkinPageControl; tab1: TbsSkinTabSheet; tab2: TbsSkinTabSheet; t_rate: TRxMemoryData; t_ch_cust_befbal1: TDataSource; t_ch_cust_befbal: TADOQuery; t_ch_cust_befbal_sum1: TDataSource; t_ch_cust_befbal_sum: TADOQuery; t_ch_cust_befbalnew: TADOQuery; PopupMenu5: TPopupMenu; N7: TMenuItem; MenuItem5: TMenuItem; MenuItem6: TMenuItem; PopupMenu4: TPopupMenu; MenuItem4: TMenuItem; bsSkinGroupBox3: TbsSkinGroupBox; dxDBGrid33: TdxDBGrid; dxDBGridMaskColumn210: TdxDBGridMaskColumn; dxDBGridMaskColumn211: TdxDBGridMaskColumn; dxDBGridMaskColumn212: TdxDBGridMaskColumn; dxDBGridMaskColumn213: TdxDBGridMaskColumn; dxDBGridColumn118: TdxDBGridColumn; dxDBGridColumn119: TdxDBGridColumn; dxDBGridColumn120: TdxDBGridColumn; Edit1: TEdit; bsSkinGroupBox4: TbsSkinGroupBox; dxDBGrid34: TdxDBGrid; dxDBGridColumn121: TdxDBGridColumn; dxDBGridColumn122: TdxDBGridColumn; dxDBGridColumn123: TdxDBGridColumn; dxDBGridColumn124: TdxDBGridColumn; bsSkinGroupBox5: TbsSkinGroupBox; dxDBGrid24: TdxDBGrid; dxDBGridMaskColumn161: TdxDBGridMaskColumn; dxDBGridMaskColumn162: TdxDBGridMaskColumn; dxDBGridMaskColumn163: TdxDBGridMaskColumn; dxDBGridMaskColumn164: TdxDBGridMaskColumn; dxDBGridColumn87: TdxDBGridColumn; dxDBGridColumn88: TdxDBGridColumn; dxDBGridColumn89: TdxDBGridColumn; Edit2: TEdit; bsSkinGroupBox6: TbsSkinGroupBox; dxDBGrid25: TdxDBGrid; dxDBGridColumn90: TdxDBGridColumn; dxDBGridColumn91: TdxDBGridColumn; dxDBGridColumn92: TdxDBGridColumn; dxDBGridColumn93: TdxDBGridColumn; tab6: TbsSkinTabSheet; DBEdit38: TDBEdit; Label117: TLabel; Label118: TLabel; DBEdit85: TDBEdit; t_ch_fee_do_detail: TADOQuery; dxDBGrid1Column38: TdxDBGridColumn; PopupMenu6: TPopupMenu; N8: TMenuItem; dxDBGrid2Column15: TdxDBGridColumn; Label119: TLabel; DBEdit86: TDBEdit; bsSkinButton17: TbsSkinButton; bsSkinButton32: TbsSkinButton; dxDBGrid20Column25: TdxDBGridColumn; dxDBGrid20Column26: TdxDBGridColumn; dxDBGrid33Column8: TdxDBGridColumn; dxDBGrid34Column5: TdxDBGridColumn; bsSkinTabSheet14: TbsSkinTabSheet; dxDBGrid26: TdxDBGrid; dxDBGridColumn94: TdxDBGridColumn; dxDBGridMaskColumn165: TdxDBGridMaskColumn; dxDBGridColumn95: TdxDBGridColumn; dxDBGridColumn96: TdxDBGridColumn; dxDBGridColumn97: TdxDBGridColumn; dxDBGridColumn98: TdxDBGridColumn; dxDBGrid27: TdxDBGrid; dxDBGridMaskColumn166: TdxDBGridMaskColumn; dxDBGridMaskColumn167: TdxDBGridMaskColumn; dxDBGridMaskColumn168: TdxDBGridMaskColumn; dxDBGridMaskColumn169: TdxDBGridMaskColumn; dxDBGridMaskColumn170: TdxDBGridMaskColumn; dxDBGridColumn99: TdxDBGridColumn; dxDBGridColumn100: TdxDBGridColumn; dxDBGridMaskColumn171: TdxDBGridMaskColumn; dxDBGridColumn101: TdxDBGridColumn; dxDBGridDateColumn24: TdxDBGridDateColumn; dxDBGridMaskColumn172: TdxDBGridMaskColumn; dxDBGridMaskColumn173: TdxDBGridMaskColumn; dxDBGridColumn102: TdxDBGridColumn; dxDBGridMaskColumn174: TdxDBGridMaskColumn; dxDBGridMaskColumn175: TdxDBGridMaskColumn; dxDBGridMaskColumn176: TdxDBGridMaskColumn; v_fee_do_airtruck: TADOQuery; v_fee_do_airtruck1: TDataSource; v_fee_do_airtruck_sum: TADOQuery; v_fee_do_airtruck_sum1: TDataSource; v_fee_do_railway: TADOQuery; v_fee_do_railway1: TDataSource; v_fee_do_railway_sum: TADOQuery; v_fee_do_railway_sum1: TDataSource; Label120: TLabel; DBEdit87: TDBEdit; Label121: TLabel; DBEdit88: TDBEdit; Label122: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; Label123: TLabel; Label124: TLabel; Label125: TLabel; Label126: TLabel; DBEdit89: TDBEdit; DBEdit90: TDBEdit; DBEdit91: TDBEdit; wwDBDateTimePicker5: TwwDBDateTimePicker; DBEdit92: TDBEdit; Label127: TLabel; Label128: TLabel; DBEdit93: TDBEdit; Label129: TLabel; DBEdit94: TDBEdit; bsSkinScrollBar1: TbsSkinScrollBar; cxGrid1DBTableView1: TcxGridDBTableView; cxGrid1Level1: TcxGridLevel; cxGrid1: TcxGrid; cxGrid1DBTableView1DBColumn1: TcxGridDBColumn; cxGrid1DBTableView1DBColumn2: TcxGridDBColumn; cxGrid1DBTableView1DBColumn3: TcxGridDBColumn; cxGrid1DBTableView1DBColumn4: TcxGridDBColumn; cxGrid1DBTableView1DBColumn5: TcxGridDBColumn; cxGrid1DBTableView1DBColumn6: TcxGridDBColumn; cxGrid1DBTableView1DBColumn7: TcxGridDBColumn; cxGrid1DBTableView1DBColumn8: TcxGridDBColumn; cxGrid1DBTableView1DBColumn9: TcxGridDBColumn; cxGrid1DBTableView1DBColumn10: TcxGridDBColumn; cxGrid1DBTableView1DBColumn11: TcxGridDBColumn; cxGrid1DBTableView1DBColumn12: TcxGridDBColumn; cxGrid1DBTableView1DBColumn13: TcxGridDBColumn; cxGrid1DBTableView1DBColumn14: TcxGridDBColumn; dxDBGrid1Column39: TdxDBGridColumn; Panel2: TPanel; Label130: TLabel; bsSkinButton37: TbsSkinButton; t_ch_balanceDSDesigner: TStringField; t_ch_balanceDSDesigner2: TStringField; t_ch_balanceDSDesigner3: TStringField; t_ch_balanceDSDesigner4: TStringField; t_ch_balanceDSDesigner5: TStringField; t_ch_balanceDSDesigner6: TStringField; t_ch_balanceDSDesigner7: TBCDField; t_ch_balanceDSDesigner8: TBCDField; t_ch_balanceDSDesigner9: TBCDField; t_ch_balanceDSDesigner10: TStringField; t_ch_balanceDSDesigner11: TStringField; t_ch_balanceDSDesigner12: TStringField; t_ch_balanceDSDesigner13: TDateTimeField; t_ch_balanceDSDesigner14: TBooleanField; t_ch_balanceDSDesigner15: TStringField; t_ch_balanceDSDesigner16: TStringField; t_ch_balanceDSDesigner17: TDateTimeField; t_ch_balanceDSDesigner18: TStringField; t_ch_balanceDSDesigner19: TStringField; t_ch_balanceDSDesigner20: TDateTimeField; t_ch_balanceDSDesigner21: TStringField; t_ch_balanceDSDesigner22: TBooleanField; t_ch_balanceDSDesigner23: TStringField; t_ch_balanceDSDesigner24: TBCDField; t_ch_balanceDSDesigner25: TBCDField; t_ch_balanceDSDesigner26: TStringField; t_ch_balanceDSDesigner27: TStringField; t_ch_balanceDSDesigner28: TStringField; t_ch_balanceDSDesigner29: TStringField; t_ch_balanceDSDesigner30: TBCDField; t_ch_balanceDSDesigner31: TStringField; t_ch_balanceDSDesigner32: TStringField; t_ch_balanceDSDesigner33: TStringField; dxDBGrid1Column40: TdxDBGridColumn; dxDBGrid1Column41: TdxDBGridColumn; Label133: TLabel; cxDBCalcEdit1: TcxDBCalcEdit; t_ch_balanceDSDesigner34: TDateTimeField; t_ch_balanceDSDesigner35: TSmallintField; t_ch_balanceField: TStringField; t_ch_balanceField2: TFloatField; t_ch_balanceField3: TFloatField; dxDBGrid1Column42: TdxDBGridColumn; Label131: TLabel; RxDBLookupCombo8: TRxDBLookupCombo; t_ch_balanceField4: TStringField; dxDBGrid1Column43: TdxDBGridColumn; t_ch_balanceField5: TStringField; dxDBGrid1Column44: 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); procedure RxDBLookupCombo4Enter(Sender: TObject); procedure DBEdit51Enter(Sender: TObject); procedure t_ch_balanceCalcFields(DataSet: TDataSet); procedure bsSkinButton38Click(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo15Change(Sender: TObject); procedure RxDBLookupCombo15Enter(Sender: TObject); procedure RxDBLookupCombo15Exit(Sender: TObject); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure t_ch_balanceBeforeDelete(DataSet: TDataSet); procedure bsSkinNotebook1PageChanged(Sender: TObject); procedure dxDBGrid6DblClick(Sender: TObject); procedure dxDBGrid3DblClick(Sender: TObject); procedure dxDBGrid4DblClick(Sender: TObject); procedure dxDBGrid5DblClick(Sender: TObject); procedure dxDBGrid20DblClick(Sender: TObject); procedure t_ch_zhipiaoAfterInsert(DataSet: TDataSet); procedure t_ch_zhipiaoBeforeEdit(DataSet: TDataSet); procedure t_ch_zhipiaoBeforePost(DataSet: TDataSet); procedure bsSkinPageControl1Change(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure MenuItem1Click(Sender: TObject); procedure bsSkinButton31Click(Sender: TObject); procedure bsSkinButton19Click(Sender: TObject); procedure bsSkinButton20Click(Sender: TObject); procedure bsSkinButton27Click(Sender: TObject); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton29Click(Sender: TObject); procedure bsSkinButton22Click(Sender: TObject); procedure bsSkinButton33Click(Sender: TObject); procedure bsSkinButton35Click(Sender: TObject); procedure bsSkinButton36Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); procedure t_ch_zhipiaoAfterOpen(DataSet: TDataSet); procedure dxDBGrid21DblClick(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure RxDBLookupCombo3Change(Sender: TObject); procedure RxDBLookupCombo10Change(Sender: TObject); procedure RxDBLookupCombo11Change(Sender: TObject); procedure t_ch_zhipiaoAfterScroll(DataSet: TDataSet); procedure MenuItem4Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure MenuItem6Click(Sender: TObject); procedure t_ch_cust_befbal_sumAfterOpen(DataSet: TDataSet); procedure MenuItem3Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton34Click(Sender: TObject); procedure dxDBGrid20Column25CustomDraw(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 dxDBGrid20Column26CustomDraw(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 fra_ch_add_do1bsSkinButton8Click(Sender: TObject); procedure fra_ch_add_do1MenuItem1Click(Sender: TObject); procedure dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid2SelectedCountChange(Sender: TObject); procedure dxDBGrid1CustomDraw(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 bsSkinButton37Click(Sender: TObject); private shench,iszhipiao,ischangecur:boolean; procedure zhipiaobankchange(sender:TField); procedure zhipiaocustchange(sender:TField); procedure zhipiaoCurrencychange(sender:TField); procedure zhipiaodatechange(sender:TField); procedure zhipiaonumchange(sender:TField); procedure getdetail(balno:string); procedure closedetail; { Private declarations } public { Public declarations } procedure SelectAddVouchers; procedure AddVouchers; end; var frm_ch_balance_pay: Tfrm_ch_balance_pay; ch_balance_pay_open,ch_balance_pay_post,sbpay,notdetail:boolean; implementation uses my_sys_function, u_main, u_ch_balance_query, u_data_share, {$IFDEF FFLIUCHENG}u_ch_check_do,{$ENDIF} u_ch_shen_query, u_select_curr, u_ch_zhipiao_query, u_fee_do_fen, u_sys_progress, u_cw_pingzheng, dmAccu, u_cw_pingzheng_jku8, u_cw_pingzheng_u8; {$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+'1'); savereggrid(dxdbgrid2,caption+'2'); savereggrid(dxdbgrid3,caption+'3'); savereggrid(dxdbgrid4,caption+'4'); savereggrid(dxdbgrid5,caption+'5'); savereggrid(dxdbgrid6,caption+'6'); savereggrid(dxdbgrid21,caption+'21'); savereggrid(fra_ch_add_do1.dxDBGrid19,caption+'19'); savereggrid(fra_ch_delete_do1.dxDBGrid9,caption+'d9'); savecxgridview(cxGrid1DBTableView1,'cx'+caption+'1'); 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 //计算按钮长度 if not iszhipiao then begin bsSkinButton13.Visible:=false; i:=round(bsSkinPanel2.Width/12); 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; bsSkinButton38.Width:=i; // bsSkinButton34.Width:=i; bsSkinButton37.Width:=i; bsSkinButton5.Width:=i; end else begin bsSkinButton13.Visible:=true; i:=round(bsSkinPanel2.Width/13); 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; bsSkinButton38.Width:=i; bsSkinButton13.Width:=i; // bsSkinButton34.Width:=i; bsSkinButton37.Width:=i; bsSkinButton5.Width:=i; end; end; procedure Tfrm_ch_balance_pay.FormShow(Sender: TObject); var i:integer; begin bsSkinPageControl1.ActivePageIndex:=0; if if_reg(461) and (not vold) then begin iszhipiao:=true end else begin iszhipiao:=false; end; ischangecur:=true; { if not iszhipiao then bskntbshtTBS3.TabVisible:=false; } if not iszhipiao then begin bsSkinButton13.Visible:=false; i:=round(bsSkinPanel2.Width/12); 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; bsSkinButton38.Width:=i; // bsSkinButton34.Width:=i; bsSkinButton37.Width:=i; bsSkinButton5.Width:=i; end else begin bsSkinButton13.Visible:=true; i:=round(bsSkinPanel2.Width/13); 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; bsSkinButton38.Width:=i; bsSkinButton13.Width:=i; // bsSkinButton34.Width:=i; bsSkinButton37.Width:=i; bsSkinButton5.Width:=i; end; t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select top 600 * from t_ch_balance where 财务=0 and 帐单状态<>'+''''+'审核通过'+'''' +' and '+open_data('1003','结算人','no','no','no','no') +' and 类型='+''''+'付'+''''+' order by 帐单编号 desc'); t_ch_balance.open; // t_ch_fee_do.open; t_ch_check_detail.open; // t_no.open; ch_balance_pay_open:=true; ch_balance_pay_post:=true; notdetail:=true; //根据是否多业务合并判断 if StrToBool(get_parameters_value(85,'false')) then begin fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=False; fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=False; fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=False; fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=False; fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=True; fra_ch_add_do1.bsSkinPageControl1.TabIndex:=0; // fra_ch_add_do1.bsSkinButton11.Caption:='应付结算'; fra_ch_add_do1.bsSkinButton11.Visible:=True; fra_ch_add_do1.bsSkinCheckRadioBox7.Visible:=True; fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=false; fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=false; fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=false; fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=false; fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=True; fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet5; bsSkinTabSheet7.TabVisible:=false; bsSkinTabSheet8.TabVisible:=false; bsSkinTabSheet9.TabVisible:=false; bsSkinTabSheet10.TabVisible:=false; bstab5.TabVisible:=true; bsSkinPageControl3.ActivePage:=bstab5; end else begin fra_ch_add_do1.bsSkinTabSheet1.TabVisible:=True; fra_ch_add_do1.bsSkinTabSheet2.TabVisible:=True; fra_ch_add_do1.bsSkinTabSheet3.TabVisible:=True; fra_ch_add_do1.bsSkinTabSheet4.TabVisible:=True; fra_ch_add_do1.bsSkinPageControl1.ActivePage:=fra_ch_add_do1.bsSkinTabSheet1; fra_ch_add_do1.bsSkinTabSheet5.TabVisible:=False; fra_ch_delete_do1.bsSkinTabSheet1.TabVisible:=True; fra_ch_delete_do1.bsSkinTabSheet2.TabVisible:=True; fra_ch_delete_do1.bsSkinTabSheet3.TabVisible:=True; fra_ch_delete_do1.bsSkinTabSheet4.TabVisible:=True; fra_ch_delete_do1.bsSkinTabSheet5.TabVisible:=false; fra_ch_delete_do1.bsSkinPageControl1.ActivePage:=fra_ch_delete_do1.bsSkinTabSheet1; bsSkinTabSheet7.TabVisible:=true; bsSkinTabSheet8.TabVisible:=true; bsSkinTabSheet9.TabVisible:=true; bsSkinTabSheet10.TabVisible:=true; bstab5.TabVisible:=false; bsSkinPageControl3.ActivePage:=bsSkinTabSheet7; end; fra_ch_add_do1.do_ban1.DataSet:=t_ch_balance; fra_ch_add_do1.bs_text.text:='4'; fra_ch_add_do1.wwDBComboBox31.text:='付'; fra_ch_add_do1.t_ch_fee_do.open; // getdetail; { if StrToBool(get_parameters_value(85,'false')) then begin fra_ch_delete_do1.v_fee_do_bscard.close; fra_ch_delete_do1.v_fee_do_bscard.SQL.clear; fra_ch_delete_do1.v_fee_do_bscard.sql.add('select * from v_fee_do_bscard ' +'where 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_bscard.Open; fra_ch_delete_do1.v_fee_do_bscard_sum.close; fra_ch_delete_do1.v_fee_do_bscard_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_bscard_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_bscard ' +'where 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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_bscard_sum.Open; end else begin fra_ch_delete_do1.v_fee_do_seae.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seae.Open; fra_ch_delete_do1.v_fee_do_seai.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seai.Open; fra_ch_delete_do1.v_fee_do_aire.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_aire.Open; fra_ch_delete_do1.v_fee_do_airi.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_airi.Open; fra_ch_delete_do1.v_fee_do_seae_sum.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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.Open; fra_ch_delete_do1.v_fee_do_seai_sum.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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.Open; fra_ch_delete_do1.v_fee_do_aire_sum.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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.Open; fra_ch_delete_do1.v_fee_do_airi_sum.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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.open; end; } fra_ch_delete_do1.bs_text.Text:='4'; fra_ch_delete_do1.do_ban1.DataSet:=t_ch_balance; loadreggrid(dxdbgrid1,false,caption+'1'); loadreggrid(dxdbgrid2,false,caption+'2'); loadreggrid(dxdbgrid3,false,caption+'3'); loadreggrid(dxdbgrid4,false,caption+'4'); loadreggrid(dxdbgrid5,false,caption+'5'); loadreggrid(dxdbgrid6,false,caption+'6'); loadreggrid(dxdbgrid21,false,caption+'21'); loadcxgridview(cxGrid1DBTableView1,'cx'+caption+'1'); loadreggrid(fra_ch_add_do1.dxDBGrid19,false,caption+'19'); loadreggrid(fra_ch_delete_do1.dxDBGrid9,false,caption+'d9'); //根据是否单币别判断 sbpay:=StrToBool(get_parameters_value(83,'false')); if sbpay then begin dxdbgrid1.ColumnByFieldName('币别').Visible:=false; dxdbgrid1.ColumnByFieldName('结算金额').Visible:=False; dxdbgrid1.ColumnByFieldName('实结金额').Visible:=false; dxdbgrid1.ColumnByFieldName('虚结金额').Visible:=False; dxdbgrid1.ColumnByFieldName('美元金额').Visible:=True; dxdbgrid1.ColumnByFieldName('人民币金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元结算金额').Visible:=false; dxdbgrid1.ColumnByFieldName('人民币结算金额').Visible:=false; dxdbgrid1.ColumnByFieldName('美元相关号码').Visible:=true; dxdbgrid1.ColumnByFieldName('相关号码').Caption:='人民币相关号码'; bsSkinPanel8.Visible:=true; bsSkinPanel9.Visible:=true; dxdbgrid2.ColumnByFieldName('申请金额').Visible:=False; dxdbgrid2.ColumnByFieldName('实际金额').Visible:=false; dxdbgrid2.ColumnByFieldName('虚开金额').Visible:=False; dxdbgrid2.ColumnByFieldName('美元金额').Visible:=True; dxdbgrid2.ColumnByFieldName('人民币金额').Visible:=True; fra_ch_add_do1.bsSkinPanel12.Visible:=true; Label69.Visible:=true; Label70.Visible:=true; DBEdit57.Visible:=true; DBEdit58.Visible:=true; Label64.visible:=true; RxDBLookupCombo11.Visible:=true; dxDBGrid1Column22.Visible:=false; Label79.Visible:=true; DBEdit70.Visible:=true; Label29.Visible:=false; Label30.Visible:=false; DBEdit37.Visible:=false; DBEdit21.Visible:=false; Label31.Visible:=false; Label32.Visible:=false; DBEdit22.Visible:=false; DBEdit23.Visible:=false; Label117.Visible:=false; DBEdit38.Visible:=false; RxDBLookupCombo10.Width:=325; end else begin dxdbgrid1.ColumnByFieldName('币别').Visible:=True; dxdbgrid1.ColumnByFieldName('结算金额').Visible:=True; dxdbgrid1.ColumnByFieldName('实结金额').Visible:=True; dxdbgrid1.ColumnByFieldName('虚结金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元结算金额').Visible:=true; dxdbgrid1.ColumnByFieldName('人民币结算金额').Visible:=true; dxdbgrid1.ColumnByFieldName('美元金额').Visible:=False; dxdbgrid1.ColumnByFieldName('人民币金额').Visible:=False; dxdbgrid1.ColumnByFieldName('美元相关号码').Visible:=false; bsSkinPanel8.Visible:=False; bsSkinPanel9.Visible:=False; dxdbgrid2.ColumnByFieldName('申请金额').Visible:=True; dxdbgrid2.ColumnByFieldName('实际金额').Visible:=True; dxdbgrid2.ColumnByFieldName('虚开金额').Visible:=True; dxdbgrid2.ColumnByFieldName('美元金额').Visible:=False; dxdbgrid2.ColumnByFieldName('人民币金额').Visible:=False; fra_ch_add_do1.bsSkinPanel12.Visible:=false; Label69.Visible:=false; Label70.Visible:=false; DBEdit57.Visible:=false; DBEdit58.Visible:=false; Label64.visible:=false; RxDBLookupCombo11.Visible:=false; dxDBGrid1Column22.Visible:=true; Label79.Visible:=false; DBEdit70.Visible:=false; Label49.Caption:='相关号码'; Label29.Visible:=true; Label30.Visible:=true; DBEdit37.Visible:=true; DBEdit21.Visible:=true; Label31.Visible:=true; Label32.Visible:=true; DBEdit22.Visible:=true; DBEdit23.Visible:=true; Label117.Visible:=true; DBEdit38.Visible:=true; RxDBLookupCombo10.Width:=165; end; shench:=false; wwDBDateTimePicker1.MinDate:=Logininfo.endday+1; wwDBDateTimePicker2.MinDate:=Logininfo.endday+1; wwDBDateTimePicker3.MinDate:=Logininfo.endday+1; with frm_data_share.t_code_stlmode do begin wwDBComboBox1.Items.Clear; wwDBComboBox2.Items.Clear; wwDBComboBox3.Items.Clear; first; while not eof do begin wwDBComboBox1.Items.Add(fieldbyname('结算方式').AsString); wwDBComboBox2.Items.Add(fieldbyname('结算方式').AsString); wwDBComboBox3.Items.Add(fieldbyname('结算方式').AsString); next; end; end; if not if_reg(494) then begin tab2.TabVisible:=false; tab6.TabVisible:=false; end else begin if if_open('344') then begin t_ch_cust_befbal.Open; t_ch_cust_befbal_sum.Open; end else begin tab2.TabVisible:=false; tab6.TabVisible:=false; end; end; // bsSkinButton37.Enabled:=not t_ch_balance.FieldByName('凭证').AsBoolean; // frm_data_share.t_crm_client_all.requery; frm_data_share.t_code_currency.requery; frm_data_share.t_sys_bank.requery; {$IFDEF FFLIUCHENG} bsSkinTabSheet2.tabvisible:=true; {$ELSE} bsSkinTabSheet2.tabvisible:=false; {$ENDIF} // t_ch_balance.AfterScroll:=getdetail; 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); var balno:string; begin t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算类别']:='自由'; t_ch_balance['结算人']:=employee; if Logininfo.endday+1>now then t_ch_balance['结算日期']:=Logininfo.endday+1 else t_ch_balance['结算日期']:=now; t_ch_balance['自动']:=1; 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['结算方式']:='支票'; t_ch_balance['附件数']:=1; { balno:=get_no(date,'BP'); t_ch_balance['帐单编号']:=balno; getdetail(balno); } end; procedure Tfrm_ch_balance_pay.bsSkinButton1Click(Sender: TObject); begin t_ch_balance.insert; // if bsSkinNotebook1.PageIndex<>0 then getdetail(t_ch_balance.FieldByName('帐单编号').asstring); notdetail:=false; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; notdetail:=true; 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 trim(GetBalanceVou(t_ch_balance.fieldbyname('帐单编号').AsString))<>'' then begin showmessage('已经生成凭证!!'); exit; end; { if trim(t_ch_balance.FieldByName('财务凭证').asstring)<>''then begin showmessage('已经生成凭证不允许删除!!'); exit; end; } if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then begin if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.bsSkinGauge1.ProgressText:='正在处理数据请等候。。。'; frm_sys_progress.Show; frm_main.db.BeginTrans; try delete_ch(4,t_ch_balance); t_ch_fee_do.open; frm_sys_progress.bsSkinGauge1.MaxValue:=t_ch_fee_do.RecordCount+2; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; t_ch_fee_do.first; while not t_ch_fee_do.eof do begin Setfee(1,t_ch_fee_do.fieldbyname('CH_ID').AsInteger,t_ch_fee_do.fieldbyname('原始金额').AsCurrency); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_ch_fee_do.delete; end; t_ch_fee_do.close; t_ch_fee_do_detail.close; t_ch_fee_do_detail.sql.text:='select * from t_ch_cust_befbal where 帐单编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''''; t_ch_fee_do_detail.open; while not t_ch_fee_do_detail.eof do t_ch_fee_do_detail.delete; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; 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; if t_ch_check.Active then t_ch_check.requery; end; p_update.Parameters.ParamByName('SQLStr').value:='update t_ch_dui_auto set 结算日期=null' +',帐单编号='+''''+'''' +' where 帐单编号='+'''' +t_ch_balance.FieldByName('帐单编号').asstring+''''; p_update.ExecProc; t_ch_balance.Delete; if bsSkinNotebook1.PageIndex<>0 then getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_main.db.CommitTrans; finally frm_sys_progress.Close; frm_sys_progress.Free; frm_sys_progress:=nil; if frm_main.db.InTransaction then begin ShowMessage('删除账单时出错,请刷新重试!'); frm_main.db.RollbackTrans; end; end; 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,'客户名称'); if not sbpay then table_before_post(t_ch_balance,'币别'); t_ch_balance['结算金额']:=s_w(strtoint(apointnum),t_ch_balance['结算金额']); t_ch_balance['实结金额']:=s_w(strtoint(apointnum),t_ch_balance['实结金额']); t_ch_balance['虚结金额']:=s_w(strtoint(apointnum),t_ch_balance['虚结金额']); t_ch_balance['美元金额']:=s_w(strtoint(apointnum),t_ch_balance['美元金额']); t_ch_balance['人民币金额']:=s_w(strtoint(apointnum),t_ch_balance['人民币金额']); if t_ch_balance.FieldByName('自动').asboolean then begin t_ch_balance['结算金额']:=t_ch_balance['实结金额']-t_ch_balance['预结金额']; end else begin {if t_ch_balance['结算金额']'' then begin ShowMessage('已经生成凭证'); abort; end; //根据月末结账判断 { sdate:=Logininfo.endday+1; if not t_ch_balance.FieldByName('结算日期').IsNull then if (sdate>t_ch_balance['结算日期']) and (not shench) then begin MessageDlg('此票结算单已月末结账,如果删除请先反结账!',mtError,[mbok],0); abort; end; } end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo1Enter(Sender: TObject); begin if StrToBool(get_parameters_value(85,'false')) then begin if fra_ch_delete_do1.v_fee_do_bscard.IsEmpty then begin RxDBLookupCombo1.ReadOnly:=false; RxDBLookupCombo2.ReadOnly:=false; end else begin RxDBLookupCombo1.ReadOnly:=true; RxDBLookupCombo2.ReadOnly:=true; end; end else begin if fra_ch_delete_do1.v_fee_do_seae.IsEmpty and fra_ch_delete_do1.v_fee_do_seai.IsEmpty and fra_ch_delete_do1.v_fee_do_aire.IsEmpty and fra_ch_delete_do1.v_fee_do_airi.IsEmpty then begin RxDBLookupCombo1.ReadOnly:=false; RxDBLookupCombo2.ReadOnly:=false; end else begin RxDBLookupCombo1.ReadOnly:=true; RxDBLookupCombo2.ReadOnly:=true; end; end; end; procedure Tfrm_ch_balance_pay.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 :=$00DDF21C; AFont.Color:=clblack; end; procedure Tfrm_ch_balance_pay.DBEdit1Change(Sender: TObject); begin if (DBEdit1.Text='') or (DBEdit1.Text='录入状态')then DBEdit1.Color:=clwhite else if (DBEdit1.Text='批准开票') or (DBEdit1.Text='审核通过') then DBEdit1.Color:=$00DDF21C; end; procedure Tfrm_ch_balance_pay.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose:=frm_close_query(t_ch_balance); end; procedure Tfrm_ch_balance_pay.bsSkinButton9Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); if StrToBool(get_parameters_value(85,'false')) then begin sys_print('应付费用结算',2,t_ch_balance1,nil, nil,nil,fra_ch_delete_do1.v_fee_do_bscard1,nil, nil,nil, t_ch_balance1,fra_ch_delete_do1.v_fee_do_bscard_sum1,nil); end else begin sys_print('应付费用结算',2,t_ch_balance1,nil, nil,nil,fra_ch_delete_do1.v_fee_do_seae1,fra_ch_delete_do1.v_fee_do_seai1, fra_ch_delete_do1.v_fee_do_aire1,fra_ch_delete_do1.v_fee_do_airi1, t_ch_balance1,fra_ch_delete_do1.v_fee_do_seae_sum1,fra_ch_delete_do1.v_fee_do_seai_sum1); end; // if bsSkinNotebook1.PageIndex=0 then // closedetail; end; procedure Tfrm_ch_balance_pay.bsSkinButton6Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton6.ClientToScreen(Point(0,bsSkinButton6.Height)); PopupMenu6.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_pay.bsSkinButton8Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if not if_open('256') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_ch_balance.FieldByName('帐单状态').asstring='录入状态'then begin showmessage('帐单没有必要取消审核!!'); end else begin try modify_all:=true; shench:=true; t_ch_balance.edit; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance.post; shench:=false; modify_all:=false; except shench:=false; modify_all:=false; showmessage('审核失败!!'); end; t_ch_balance.Refresh; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton10Click(Sender: TObject); begin ch_balance_pay_open:=false; try frm_ch_balance_query:=tfrm_ch_balance_query.Create (self); balance_query_type:=4; frm_ch_balance_query.bsSkinGroupBox2.Visible:=true; frm_ch_balance_query.ShowModal; bsSkinNotebook1.PageIndex:=0; finally frm_ch_balance_query.Free; ch_balance_pay_open:=true; end; end; procedure Tfrm_ch_balance_pay.t_ch_balanceAfterPost(DataSet: TDataSet); begin t_ch_balance.Refresh; //保存后刷新 if not ch_balance_pay_post then exit; if StrToBool(get_parameters_value(85,'false')) then begin if bsSkinNotebook1.PageIndex=1 then begin fra_ch_delete_do1.v_fee_do_bscard.DisableControls; fra_ch_delete_do1.v_fee_do_bscard_sum.DisableControls; fra_ch_delete_do1.v_fee_do_bscard.Requery; fra_ch_delete_do1.v_fee_do_bscard_sum.Requery; fra_ch_delete_do1.v_fee_do_bscard.EnableControls; fra_ch_delete_do1.v_fee_do_bscard_sum.EnableControls; end; end else begin if fra_ch_delete_do1.v_fee_do_seae.active then begin fra_ch_delete_do1.v_fee_do_seae.Requery; fra_ch_delete_do1.v_fee_do_seae_sum.Requery; end; if fra_ch_delete_do1.v_fee_do_seai.active then begin fra_ch_delete_do1.v_fee_do_seai.Requery; fra_ch_delete_do1.v_fee_do_seai_sum.Requery; end; if fra_ch_delete_do1.v_fee_do_aire.active then begin fra_ch_delete_do1.v_fee_do_aire.Requery; fra_ch_delete_do1.v_fee_do_aire_sum.Requery; end; if fra_ch_delete_do1.v_fee_do_airi.active then begin fra_ch_delete_do1.v_fee_do_airi.Requery; fra_ch_delete_do1.v_fee_do_airi_sum.Requery; end; if if_ch_delete_do then begin case delete_do_type_num of 1,2,3,4,5: begin if fra_ch_add_do1.t_op_seae.Active then begin fra_ch_add_do1.t_ch_fee.Requery(); fra_ch_add_do1.t_ch_fee_sum.Requery(); end; end; end; end; end; { case delete_do_type_num of 1,2,3,4: begin check_do_sum(4,t_ch_balance, fra_ch_delete_do1.v_fee_do_seae_sum,fra_ch_delete_do1.v_fee_do_seai_sum, fra_ch_delete_do1.v_fee_do_aire_sum,fra_ch_delete_do1.v_fee_do_airi_sum); end; end; } delete_do_type_num:=0; if_ch_delete_do:=false; end; procedure Tfrm_ch_balance_pay.t_ch_balanceAfterDelete(DataSet: TDataSet); begin if fra_ch_add_do1.v_op_bscard.Active then fra_ch_add_do1.v_op_bscard.Requery(); if fra_ch_add_do1.t_op_seae.Active then fra_ch_add_do1.t_op_seae.Requery(); if fra_ch_add_do1.t_op_seai.Active then fra_ch_add_do1.t_op_seai.Requery(); if fra_ch_add_do1.t_op_aire.Active then fra_ch_add_do1.t_op_aire.Requery(); if fra_ch_add_do1.t_op_airi.Active then fra_ch_add_do1.t_op_airi.Requery(); end; procedure Tfrm_ch_balance_pay.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit1); end; procedure Tfrm_ch_balance_pay.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox1); end; procedure Tfrm_ch_balance_pay.wwDBComboBox1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_ch_balance_pay.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit5); end; procedure Tfrm_ch_balance_pay.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit6); end; procedure Tfrm_ch_balance_pay.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox1); end; procedure Tfrm_ch_balance_pay.bsSkinDBCheckRadioBox1KeyPress( Sender: TObject; var Key: Char); begin // key_RxDBLookupCombo(Key,RxDBLookupCombo3); end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit8); end; procedure Tfrm_ch_balance_pay.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit9); end; procedure Tfrm_ch_balance_pay.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit10); end; procedure Tfrm_ch_balance_pay.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo1); end; procedure Tfrm_ch_balance_pay.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_ch_balance_pay.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_ch_balance_pay.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,3); end; procedure Tfrm_ch_balance_pay.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_ch_balance_pay.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_ch_balance,'帐单编号'); end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo2Change(Sender: TObject); begin if (t_ch_balance.state=dsinsert)or(t_ch_balance1.state=dsedit)then begin if RxDBLookupCombo2.DisplayValues[0]<>''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); var sdate:TDate; aList:TStringList; i:integer; billnos:string; Current,bm: TBookmarkStr; begin {$IFDEF FFLIUCHENG} if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring<>'批准支付') and (t_ch_check.FieldByName('申请状态').asstring<>'禁止修改') then begin showmessage('当前申请状态不能实现支付!!'); exit; end; sdate:=EncodeDate(Logininfo.offyear,Logininfo.offmonth,1); if sdate>now then begin if MessageDlg('由于本月已经结账,如果结算结算日期将为'+datetostr(sdate)+',确实要结算吗?',mtWarning,[mbyes,mbno],0)<>mryes then exit; end; aList:=TStringList.create; try t_ch_check.DisableControls; t_ch_fee_do_check.DisableControls; if dxDBGrid2.SelectedCount>0 then begin billnos:=''; aList.Clear; for i:=0 to dxDBGrid2.SelectedCount-1 do begin t_ch_check.GotoBookmark(pointer(dxDBGrid2.selectedrows[i])); if aList.IndexOf(t_ch_check['客户名称'])<0 then aList.Add(t_ch_check['客户名称']); if billnos='' then billnos:=t_ch_check.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_check.fieldbyname('申请编号').asstring; end; if aList.Count>1 then begin showmessage('不相同的客户不能同时结算:'+#13#10+aList.Text); exit; end; end else begin billnos:=''; aList.Clear; aList.Add(t_ch_check['客户名称']); if billnos='' then billnos:=t_ch_check.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_check.fieldbyname('申请编号').asstring; if aList.Count=0 then begin showmessage('没有需要结算的信息:'+#13#10+aList.Text); exit; end; end; finally aList.free; t_ch_check.EnableControls; t_ch_fee_do_check.EnableControls; 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.Memo1.text:='申请号码:'+billnos; frm_ch_check_do.ShowModal; finally frm_ch_check_do.Free; frm_ch_check_do:=nil; end; {$ENDIF} 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:='1003'; 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 '); t_ch_check.sql.add('where 申请状态 in (''批准支付'',''禁止修改'')'); t_ch_check.sql.add('AND 要求支付日期>:Date1 and 要求支付日期<:Date2'); t_ch_check.Parameters.ParamByName('Date1').Value:=Date-1; t_ch_check.Parameters.ParamByName('Date2').Value:=Date+1; t_ch_check.sql.add('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 //生成支票 t_ch_zhipiao.close; t_ch_zhipiao.sql.clear; t_ch_zhipiao.sql.add('select top 50 * from t_ch_zhipiao order by 开票日期 desc'); t_ch_zhipiao.open; if sbpay then begin if (t_ch_balance.FieldByName('美元金额').AsFloat<>0) and (t_ch_balance.FieldByName('人民币金额').AsFloat<>0) then begin frm_select_curr:=Tfrm_select_curr.Create(self); try if frm_select_curr.ShowModal=mrok then begin if frm_select_curr.bsSkinRadioGroup1.ItemIndex=0 then begin t_ch_zhipiao.Insert; t_ch_zhipiao['支票金额']:=t_ch_balance['人民币金额']; t_ch_zhipiao['币别']:='RMB'; t_ch_zhipiao['客户名称']:=t_ch_balance['客户名称'] ; t_ch_zhipiao['银行代码']:=t_ch_balance['银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl4.ActivePage:=bsSkinTabSheet12; t_ch_zhipiao.Post; end else begin t_ch_zhipiao.Insert; t_ch_zhipiao['支票金额']:=t_ch_balance['美元金额']; t_ch_zhipiao['币别']:='USD'; t_ch_zhipiao['客户名称']:=t_ch_balance['客户名称'] ; t_ch_zhipiao['银行代码']:=t_ch_balance['美元银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl4.ActivePage:=bsSkinTabSheet12; t_ch_zhipiao.Post; end; end; finally freeandnil(frm_select_curr); end; end else if (t_ch_balance.FieldByName('美元金额').AsFloat<>0) then begin t_ch_zhipiao.Insert; t_ch_zhipiao['支票金额']:=t_ch_balance['美元金额']; t_ch_zhipiao['币别']:='USD'; t_ch_zhipiao['客户名称']:=t_ch_balance['客户名称'] ; t_ch_zhipiao['银行代码']:=t_ch_balance['美元银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl4.ActivePage:=bsSkinTabSheet12; t_ch_zhipiao.Post; end else if (t_ch_balance.FieldByName('人民币金额').AsFloat<>0) then begin t_ch_zhipiao.Insert; t_ch_zhipiao['支票金额']:=t_ch_balance['人民币金额']; t_ch_zhipiao['币别']:='RMB'; t_ch_zhipiao['客户名称']:=t_ch_balance['客户名称'] ; t_ch_zhipiao['银行代码']:=t_ch_balance['银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl4.ActivePage:=bsSkinTabSheet12; t_ch_zhipiao.Post; end; end else begin t_ch_zhipiao.Insert; t_ch_zhipiao['支票金额']:=t_ch_balance['结算金额']; t_ch_zhipiao['币别']:=t_ch_balance['币别']; t_ch_zhipiao['客户名称']:=t_ch_balance['客户名称'] ; t_ch_zhipiao['银行代码']:=t_ch_balance['银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl4.ActivePage:=bsSkinTabSheet12; t_ch_zhipiao.Post; end; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo4Enter(Sender: TObject); begin if StrToBool(get_parameters_value(85,'false')) then begin if fra_ch_delete_do1.v_fee_do_bscard.IsEmpty then begin RxDBLookupCombo4.ReadOnly:=false; end else begin RxDBLookupCombo4.ReadOnly:=true; end; end else begin if fra_ch_delete_do1.v_fee_do_seae.IsEmpty and fra_ch_delete_do1.v_fee_do_seai.IsEmpty and fra_ch_delete_do1.v_fee_do_aire.IsEmpty and fra_ch_delete_do1.v_fee_do_airi.IsEmpty then begin RxDBLookupCombo4.ReadOnly:=false; end else begin RxDBLookupCombo4.ReadOnly:=true; end; end; end; procedure Tfrm_ch_balance_pay.DBEdit51Enter(Sender: TObject); begin if bsSkinDBCheckRadioBox2.Checked then DBEdit51.ReadOnly:=true else DBEdit51.ReadOnly:=false; end; procedure Tfrm_ch_balance_pay.t_ch_balanceCalcFields(DataSet: TDataSet); begin if dataset.FieldByName('币别').AsString='USD' then begin dataset.FieldByName('美元结算金额').AsFloat:=dataset.fieldbyname('结算金额').AsFloat; dataset.FieldByName('人民币结算金额').AsFloat:=0; end else begin dataset.FieldByName('人民币结算金额').AsFloat:=dataset.fieldbyname('结算金额').AsFloat; dataset.FieldByName('美元结算金额').AsFloat:=0; end; if frm_data_share.t_crm_client.Locate('客户简称',t_ch_balance.fieldbyname('客户名称').asstring,[])then begin t_ch_balance.fieldbyname('财务代码').asstring:=frm_data_share.t_crm_client.fieldbyname('财务应付帐款代码').asstring; t_ch_balance.fieldbyname('客户代码').asstring:=frm_data_share.t_crm_client.fieldbyname('代码').asstring; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton38Click(Sender: TObject); var book1:Tbookmark; begin if t_ch_balance.IsEmpty then exit; if bsSkinNotebook1.PageIndex=0 then begin book1:=t_ch_balance.GetBookmark; t_ch_balance.Requery; t_ch_balance.GotoBookmark(book1); end else begin book1:=t_ch_balance.GetBookmark; t_ch_balance.Refresh; t_ch_balance.GotoBookmark(book1); end; { if t_ch_balance=nil then exit; book1:=t_ch_balance.GetBookmark; t_ch_balance.Refresh; t_ch_balance.GotoBookmark(book1); } end; procedure Tfrm_ch_balance_pay.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 else begin t_ch_balance['美元银行']:=''; end; end; procedure Tfrm_ch_balance_pay.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 else begin t_ch_balance['银行']:=''; end; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo15Enter(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; if sbpay then begin frm_data_share.t_sys_bank.Filter:='币别=''RMB'''; frm_data_share.t_sys_bank.Filtered:=true; end; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo15Exit(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo16Enter(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_pay.RxDBLookupCombo16Exit(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_pay.t_ch_balanceBeforeDelete(DataSet: TDataSet); var sdate:tdate; begin { sdate:=Logininfo.endday+1; if not t_ch_balance.FieldByName('结算日期').IsNull then if sdate>t_ch_balance['结算日期'] then begin MessageDlg('此票结算单已月末结账,如果删除请先反结账!',mtError,[mbok],0); abort; end; } end; procedure Tfrm_ch_balance_pay.bsSkinNotebook1PageChanged(Sender: TObject); begin if not notdetail then exit; getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); end; procedure Tfrm_ch_balance_pay.dxDBGrid6DblClick(Sender: TObject); begin fee_view(v_fee_do_seae.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_pay.dxDBGrid3DblClick(Sender: TObject); begin fee_view(v_fee_do_seai.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_pay.dxDBGrid4DblClick(Sender: TObject); begin fee_view(v_fee_do_aire.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_pay.dxDBGrid5DblClick(Sender: TObject); begin fee_view(v_fee_do_airi.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_pay.dxDBGrid20DblClick(Sender: TObject); begin fee_view(fra_ch_delete_do1.v_fee_do_bscard.fieldbyname('编号').asstring); end; procedure Tfrm_ch_balance_pay.t_ch_zhipiaoAfterInsert(DataSet: TDataSet); begin t_ch_zhipiao['制单人']:=employee; t_ch_zhipiao['开票日期']:=date; t_ch_zhipiao['支票金额']:=0; t_ch_zhipiao['支票类型']:='转帐支票'; t_ch_zhipiao['币别']:='RMB'; t_ch_zhipiao['年']:=my_strtoyear(date); t_ch_zhipiao['月']:=my_strtomonth(Date); t_ch_zhipiao['日']:=my_strtodday(Date); t_ch_zhipiao['复核状态']:=0; t_ch_zhipiao['是否打印']:=0; t_ch_zhipiao['是否废除']:=0; end; procedure Tfrm_ch_balance_pay.t_ch_zhipiaoBeforeEdit(DataSet: TDataSet); begin if not modify_all then begin if t_ch_zhipiao.FieldByName('是否废除').asboolean then begin showmessage('支票已经废除,不能修改!!'); abort; end; if t_ch_zhipiao.FieldByName('是否打印').asboolean then begin showmessage('支票已经打印,不能修改!!'); abort; end; end; end; procedure Tfrm_ch_balance_pay.t_ch_zhipiaoBeforePost(DataSet: TDataSet); begin table_before_post(t_ch_zhipiao,'支票金额'); table_before_post(t_ch_zhipiao,'币别'); // table_before_post(t_ch_zhipiao,'支票号码'); end; procedure Tfrm_ch_balance_pay.bsSkinPageControl1Change(Sender: TObject); begin if not ch_balance_pay_open then exit; if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then begin if not t_ch_check.Active then begin t_ch_check.close; t_ch_check.sql.Clear; t_ch_check.sql.Add('select * from t_ch_check where 申请状态 in (''批准支付'',''禁止修改'') '); t_ch_check.sql.Add(' and '+open_data('1003','申请人','no','no','no','no')); t_ch_check.sql.Add('order by 申请编号'); 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_airtruck.open; v_fee_do_railway.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; v_fee_do_airtruck_sum.open; v_fee_do_railway_sum.open; end; end; if bsSkinPageControl1.ActivePage=bskntbshtTBS3 then begin if t_ch_zhipiao.Active then exit; t_ch_zhipiao.close; t_ch_zhipiao.sql.clear; t_ch_zhipiao.sql.add('select top 50 * from t_ch_zhipiao order by 开票日期 desc'); t_ch_zhipiao.open; end else begin t_ch_zhipiao.close; end; end; procedure Tfrm_ch_balance_pay.zhipiaobankchange(sender: TField); begin try if (t_ch_zhipiao.state=dsinsert) or (t_ch_zhipiao.state=dsedit) then begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',t_ch_zhipiao['银行代码'],[])then t_ch_zhipiao['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_zhipiao['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; ischangecur:=false; try t_ch_zhipiao['币别']:=frm_data_share.t_sys_bank.fieldbyname('币别').asstring; finally ischangecur:=true; end; end; except ; end; end; procedure Tfrm_ch_balance_pay.zhipiaoCurrencychange(sender: TField); begin //支票币别更改 if ischangecur then begin if frm_data_share.t_sys_bank.Locate('代码',t_ch_zhipiao.fieldbyname('银行代码').AsString,[]) then begin if frm_data_share.t_sys_bank['币别']<>t_ch_zhipiao['币别'] then begin if frm_data_share.t_sys_bank.Locate('币别',t_ch_zhipiao['币别'],[]) then begin t_ch_zhipiao['银行代码']:=frm_data_share.t_sys_bank.fieldbyname('代码').asstring; t_ch_zhipiao['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_zhipiao['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; end else begin if frm_data_share.t_sys_bank.Locate('币别',t_ch_zhipiao['币别'],[]) then begin t_ch_zhipiao['银行代码']:=frm_data_share.t_sys_bank.fieldbyname('代码').asstring; t_ch_zhipiao['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_zhipiao['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; end; if not t_ch_zhipiao.fieldbyname('支票金额').IsNull then zhipiaonumchange(sender) else begin if t_ch_zhipiao['币别']='RMB' then begin snccy.CurrencySymbol:='¥'; Label104.Visible:=false; Label111.Visible:=True; end else begin snccy.CurrencySymbol:='$'; Label104.Visible:=true; Label111.Visible:=false; end; end; end; procedure Tfrm_ch_balance_pay.zhipiaocustchange(sender: TField); begin //支票更改客户名称 try if (t_ch_zhipiao.state=dsinsert) or (t_ch_zhipiao.state=dsedit) then begin if not frm_data_share.t_crm_client.IsEmpty then if frm_data_share.t_crm_client.Locate('客户简称',t_ch_zhipiao['客户名称'],[])then if t_ch_zhipiao['币别']='RMB' then begin t_ch_zhipiao['收款单位']:=frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring; t_ch_zhipiao['汇入行名称']:=frm_data_share.t_crm_client.fieldbyname('开户行RMB').asstring; t_ch_zhipiao['收款人帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号RMB').asstring; end else begin t_ch_zhipiao['收款单位']:=frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring; t_ch_zhipiao['汇入行名称']:=frm_data_share.t_crm_client.fieldbyname('开户行USD').asstring; t_ch_zhipiao['收款人帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号USD').asstring; end; end; except ; end; end; procedure Tfrm_ch_balance_pay.zhipiaodatechange(sender: TField); begin t_ch_zhipiao['年']:=my_strtoyear(Sender.AsDateTime); t_ch_zhipiao['月']:=my_strtomonth(Sender.AsDateTime); t_ch_zhipiao['日']:=my_strtodday(Sender.AsDateTime); t_ch_zhipiao['年小']:=FormatDateTime('YY',Sender.AsDateTime); t_ch_zhipiao['月小']:=FormatDateTime('MM',Sender.AsDateTime); t_ch_zhipiao['日小']:=FormatDateTime('DD',Sender.AsDateTime); end; procedure Tfrm_ch_balance_pay.zhipiaonumchange(sender: TField); var lowamont:String; lenlowamont,i,J:Integer; upword:array[0..12] of string[4]; begin //支票大写生成 upword[0]:='分';upword[1]:='角';upword[2]:='元';upword[3]:='十';upword[4]:='百'; upword[5]:='千';upword[6]:='万';upword[7]:='十万';upword[8]:='百万';upword[9]:='千万'; upword[10]:='亿';upword[11]:='十亿';upword[12]:='百亿'; if Sender.DataSet['币别']='RMB' then begin lowamont:=formatfloat('0.00',Sender.DataSet['支票金额']); lenlowamont:=length(lowamont); delete(lowamont,lenlowamont-2,1); lenlowamont:=length(lowamont); J:=0; for i:=0 to 12 do begin Sender.DataSet[upword[i]]:=''; end; for i:=lenlowamont downto 1 do begin Sender.DataSet[upword[j]]:=lowamont[i]; J:=J+1; end; Sender.DataSet[upword[lenlowamont]]:='¥'; // Sender.DataSet['金额小写']:=FloatToStr(Sender.DataSet['支票金额']); Sender.DataSet['金额大写']:=DXZH(FloatToStr(Sender.DataSet['支票金额'])) end else begin lowamont:=formatfloat('0.00',Sender.DataSet['支票金额']); lenlowamont:=length(lowamont); delete(lowamont,lenlowamont-2,1); lenlowamont:=length(lowamont); for i:=0 to 12 do begin Sender.DataSet[upword[i]]:=''; end; J:=0; for i:=lenlowamont downto 1 do begin Sender.DataSet[upword[j]]:=lowamont[i]; J:=J+1; end; Sender.DataSet[upword[lenlowamont]]:='D'; Sender.DataSet[upword[lenlowamont+1]]:='S'; Sender.DataSet[upword[lenlowamont+2]]:='U'; Sender.DataSet['金额大写']:=DXZHUSD(FloatToStr(Sender.DataSet['支票金额'])); end; end; procedure Tfrm_ch_balance_pay.bsSkinButton15Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton15.ClientToScreen(Point(0,bsSkinButton15.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_pay.MenuItem1Click(Sender: TObject); begin if t_ch_zhipiao.IsEmpty then exit; if t_ch_zhipiao.FieldByName('是否废除').asboolean then begin showmessage('支票已经废除,不能打印!!'); exit; end; if not t_ch_zhipiao.FieldByName('是否打印').asboolean then begin t_ch_zhipiao.Edit; t_ch_zhipiao['是否打印']:=1; t_ch_zhipiao.post; end; sys_print('业务支票打印',TMenuItem(sender).tag,t_ch_zhipiao1,nil,nil,nil,nil,nil,nil,nil,t_ch_zhipiao1,nil,nil); end; procedure Tfrm_ch_balance_pay.bsSkinButton31Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton31.ClientToScreen(Point(0,bsSkinButton31.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_pay.bsSkinButton19Click(Sender: TObject); begin t_ch_zhipiao.Insert; bsSkinPageControl4.ActivePageIndex:=1; end; procedure Tfrm_ch_balance_pay.bsSkinButton20Click(Sender: TObject); begin table_post(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton27Click(Sender: TObject); begin table_post(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton23Click(Sender: TObject); begin table_cancel(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton29Click(Sender: TObject); begin table_cancel(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton22Click(Sender: TObject); var str:widestring; if_shen:string; in_id:integer; begin if t_ch_zhipiao.IsEmpty then exit; if t_ch_zhipiao.FieldByName('是否废除').asboolean then begin showmessage('支票已经废除!!'); exit; end; str:=trim(InputBox('请输入废除原因', '废除原因:', '')); if str=''then begin showmessage('废除原因不能为空,废除失败!!'); exit; end else if str=''then begin exit; end; in_id:=t_ch_zhipiao.FieldByName('ZP_ID').asinteger; t_ch_zhipiao.Refresh; if not t_ch_zhipiao.locate('ZP_ID',in_id,[]) then exit; try modify_all:=true; t_ch_zhipiao.Edit; t_ch_zhipiao['是否废除']:=1; t_ch_zhipiao['废除原因']:=str; t_ch_zhipiao['废除人']:=employee; t_ch_zhipiao['废除日期']:=now; t_ch_zhipiao['申请编号']:=''; t_ch_zhipiao.post; modify_all:=false; except modify_all:=false; showmessage('废除失败!!'); exit; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton33Click(Sender: TObject); begin bsSkinTabSheet11.Show; end; procedure Tfrm_ch_balance_pay.bsSkinButton35Click(Sender: TObject); begin table_Prior(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton36Click(Sender: TObject); begin table_next(t_ch_zhipiao); end; procedure Tfrm_ch_balance_pay.bsSkinButton18Click(Sender: TObject); begin bsSkinTabSheet12.Show; end; procedure Tfrm_ch_balance_pay.t_ch_zhipiaoAfterOpen(DataSet: TDataSet); begin t_ch_zhipiao.fieldbyname('客户名称').OnChange:=zhipiaocustchange; t_ch_zhipiao.fieldbyname('开票日期').OnChange:=zhipiaodatechange; t_ch_zhipiao.fieldbyname('支票金额').OnChange:=zhipiaonumchange; t_ch_zhipiao.fieldbyname('币别').OnChange:=zhipiaoCurrencychange; t_ch_zhipiao.fieldbyname('银行代码').OnChange:=zhipiaobankchange; end; procedure Tfrm_ch_balance_pay.dxDBGrid21DblClick(Sender: TObject); begin bsSkinTabSheet12.Show; end; procedure Tfrm_ch_balance_pay.bsSkinButton16Click(Sender: TObject); begin try frm_ch_zhipiao_query:=tfrm_ch_zhipiao_query.Create (self); zhipiao_query_type:=1; frm_ch_zhipiao_query.ShowModal; finally frm_ch_zhipiao_query.Free; end; end; procedure Tfrm_ch_balance_pay.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 else begin t_ch_balance['银行']:=''; end; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo10Change(Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo10.DisplayValues[0],[])then begin t_ch_balance['银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end else begin t_ch_balance['银行']:=''; end; end; procedure Tfrm_ch_balance_pay.RxDBLookupCombo11Change(Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo11.DisplayValues[0],[])then begin t_ch_balance['美元银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end else begin t_ch_balance['美元银行']:=''; end; end; procedure Tfrm_ch_balance_pay.t_ch_zhipiaoAfterScroll(DataSet: TDataSet); begin if t_ch_zhipiao['币别']='RMB' then begin snccy.CurrencySymbol:='¥'; Label104.Visible:=false; Label111.Visible:=True; end else begin snccy.CurrencySymbol:='$'; Label104.Visible:=true; Label111.Visible:=false; end; end; procedure Tfrm_ch_balance_pay.MenuItem4Click(Sender: TObject); var i:integer; delete_num:real; usddelete_num:real; rmbdelete_num:real; RE:Boolean; begin RE:=TRUE; if (t_ch_balance.FieldByName('结算类别').asstring='流程') then begin showmessage('当前业务操作的状态不允许更改'); exit; end; t_ch_balance.Edit; delete_num:=0; if t_ch_cust_befbal.IsEmpty then exit; if_ch_delete_do:=true; delete_do_type_num:=1; delete_num:=delete_num+t_ch_cust_befbal.fieldbyname('核销金额').asfloat; t_ch_cust_befbal.Delete; if (delete_num<>0) then begin t_ch_balance.edit; t_ch_balance['预结金额']:=t_ch_balance['预结金额']-delete_num; t_ch_balance.post; end; t_ch_cust_befbal.Requery(); t_ch_cust_befbal_sum.Requery(); end; procedure Tfrm_ch_balance_pay.N7Click(Sender: TObject); var do_num:real; i:integer; jia_num:real; rate_num:real; if_hexiao:boolean; begin //预付费用结算 if t_ch_cust_befbal_sum.IsEmpty then exit; if (t_ch_balance.FieldByName('结算类别').asstring='流程')then begin if (t_ch_balance.FieldByName('帐单状态').asstring<>'确认核销')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; if_hexiao:=true; end else if_hexiao:=false; if (t_ch_balance.FieldByName('帐单状态').asstring='审核通过')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; { if not t_ch_balance.FieldByName('结算日期').IsNull then if Logininfo.endday>t_ch_balance.FieldByName('结算日期').AsDateTime then begin MessageDlg('此票结算单已月末结账,如果修改或删除请先反结账!',mtError,[mbok],0); exit; end; } if (t_ch_balance.State=dsinsert)or(t_ch_balance.State=dsedit)then begin end else begin t_ch_balance.edit; end; jia_num:=0; if not t_ch_cust_befbalnew.Active then t_ch_cust_befbalnew.Open; t_rate.open; t_ch_cust_befbalnew.Insert; t_ch_cust_befbalnew['方式']:='结算核销'; t_ch_cust_befbalnew['状态']:='录入状态'; t_ch_cust_befbalnew['录入人']:=employee; t_ch_cust_befbalnew['录入日期']:=date; t_ch_cust_befbalnew['核销人']:=t_ch_balance['核销人']; t_ch_cust_befbalnew['核销日期']:=t_ch_balance['核销日期']; t_ch_cust_befbalnew['帐单编号']:=t_ch_balance['帐单编号']; t_ch_cust_befbalnew['结算方式']:=t_ch_balance['结算方式']; t_ch_cust_befbalnew['客户名称']:=t_ch_balance['客户名称']; t_ch_cust_befbalnew['银行']:=t_ch_balance['银行']; t_ch_cust_befbalnew['类型']:=t_ch_cust_befbal_sum['类型']; t_ch_cust_befbalnew['银行代码']:=t_ch_balance['银行代码']; t_ch_cust_befbalnew['预收金额']:=0; t_ch_cust_befbalnew['核销金额']:=0; if t_ch_balance.FieldByName('币别').asstring=t_ch_cust_befbal_sum.fieldbyname('币别').asstring then begin t_ch_cust_befbalnew['币别']:=t_ch_balance['币别']; t_ch_cust_befbalnew['核销币别']:=t_ch_balance['币别']; t_ch_cust_befbalnew['预收金额']:=-t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat; t_ch_cust_befbalnew['核销金额']:=t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat; if t_ch_balance.FieldByName('类型').AsString='收' then begin if t_ch_cust_befbal_sum.fieldbyname('类型').asstring='收'then jia_num:=jia_num+t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat else jia_num:=jia_num-t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat end else begin if t_ch_cust_befbal_sum.fieldbyname('类型').asstring='付'then jia_num:=jia_num+t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat else jia_num:=jia_num-t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat; end; end else begin rate_num:=get_zh_cur(t_rate,t_ch_cust_befbal_sum.fieldbyname('币别').asstring,t_ch_balance.FieldByName('币别').asstring); if rate_num=-1 then begin t_ch_cust_befbalnew.Cancel; t_ch_balance['预结金额']:=jia_num; t_ch_balance.post; // update_table(bs_text,do_ban1,nil,t_ch_fee,t_ch_fee_sum,2,jia_num,str1,str2,add_fee,add_bill); t_ch_cust_befbal.Requery(); t_ch_cust_befbal_sum.Requery(); exit; end else begin t_ch_cust_befbalnew['币别']:=t_ch_cust_befbal_sum['币别']; t_ch_cust_befbalnew['核销币别']:=t_ch_balance['币别']; t_ch_cust_befbalnew['预收金额']:=-t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat; t_ch_cust_befbalnew['核销金额']:=s_w(strtoint(apointnum),t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat*rate_num); if t_ch_balance.FieldByName('类型').AsString='收' then begin if t_ch_cust_befbal_sum.fieldbyname('类型').asstring='收'then jia_num:=jia_num+s_w(strtoint(apointnum),t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat*rate_num) else jia_num:=jia_num-s_w(strtoint(apointnum),t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat*rate_num); end else begin if t_ch_cust_befbal_sum.fieldbyname('类型').asstring='付'then jia_num:=jia_num+s_w(strtoint(apointnum),t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat*rate_num) else jia_num:=jia_num-s_w(strtoint(apointnum),t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat*rate_num); end; end; end; t_ch_cust_befbalnew['收付单号']:=t_ch_cust_befbal_sum.fieldbyname('收付单号').asstring; t_ch_cust_befbalnew.post; t_ch_balance['预结金额']:=jia_num; t_ch_balance.post; t_ch_cust_befbal.Requery(); t_ch_cust_befbal_sum.Requery(); end; procedure Tfrm_ch_balance_pay.MenuItem6Click(Sender: TObject); var can_do_num,do_num:real; rate_num,jia_num:real; if_hexiao:boolean; str1,str2:Tstringlist; bk:TBookmark; begin //预付费用部分加入 if (t_ch_balance.FieldByName('结算类别').asstring='流程')then begin if (t_ch_balance.FieldByName('帐单状态').asstring<>'确认核销')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; if_hexiao:=true; end else if_hexiao:=false; if (t_ch_balance.FieldByName('帐单状态').asstring='审核通过')then begin showmessage('当前业务操作的状态不允许更改'); exit; end; { if not t_ch_balance.FieldByName('结算日期').IsNull then if Logininfo.endday>t_ch_balance.FieldByName('结算日期').AsDateTime then begin MessageDlg('此票结算单已月末结账,如果修改或删除请先反结账!',mtError,[mbok],0); exit; end; } if t_ch_cust_befbal_sum.IsEmpty then exit; if (t_ch_balance.State=dsinsert)or(t_ch_balance.State=dsedit)then begin end else begin t_ch_balance.edit; end; jia_num:=0; if not t_ch_cust_befbalnew.Active then t_ch_cust_befbalnew.Open; t_rate.open; t_ch_cust_befbalnew.Insert; t_ch_cust_befbalnew['方式']:='结算核销'; t_ch_cust_befbalnew['状态']:='录入状态'; t_ch_cust_befbalnew['录入人']:=employee; t_ch_cust_befbalnew['录入日期']:=date; t_ch_cust_befbalnew['核销人']:=t_ch_balance['核销人']; t_ch_cust_befbalnew['核销日期']:=t_ch_balance['核销日期']; t_ch_cust_befbalnew['帐单编号']:=t_ch_balance['帐单编号']; t_ch_cust_befbalnew['结算方式']:=t_ch_balance['结算方式']; t_ch_cust_befbalnew['客户名称']:=t_ch_balance['客户名称']; t_ch_cust_befbalnew['银行']:=t_ch_balance['银行']; t_ch_cust_befbalnew['类型']:=t_ch_cust_befbal_sum['类型']; t_ch_cust_befbalnew['银行代码']:=t_ch_balance['银行代码']; t_ch_cust_befbalnew['预收金额']:=0; t_ch_cust_befbalnew['核销金额']:=0; if t_ch_balance.FieldByName('币别').asstring=t_ch_cust_befbal_sum.fieldbyname('币别').asstring then begin try frm_fee_do_fen:=Tfrm_fee_do_fen.Create(application); if not t_ch_balance.FieldByName('自动').asboolean then begin if can_do_num>t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat then frm_fee_do_fen.Edit2.text:=floattostr(t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat) else frm_fee_do_fen.Edit2.text:=floattostr(can_do_num); end else frm_fee_do_fen.Edit2.text:=floattostr(t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat); frm_fee_do_fen.ShowModal; if frm_fee_do_fen.ModalResult = mrOk then begin do_num:=strtofloat(frm_fee_do_fen.Edit1.text); end else begin do_num:=0; end; finally frm_fee_do_fen.Free; frm_fee_do_fen:=nil; end; if do_num=0 then begin t_ch_cust_befbalnew.Cancel; exit; end; if ((t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat>0) and(do_num>t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat)) or ((t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat<0) and(do_numt_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat then frm_fee_do_fen.Edit2.text:=floattostr(t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat) else frm_fee_do_fen.Edit2.text:=floattostr(can_do_num/rate_num); end else frm_fee_do_fen.Edit2.text:=floattostr(t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat); frm_fee_do_fen.ShowModal; if frm_fee_do_fen.ModalResult = mrOk then begin do_num:=strtofloat(frm_fee_do_fen.Edit1.text); end else begin do_num:=0; end; finally frm_fee_do_fen.Free; frm_fee_do_fen:=nil; end; if do_num=0 then begin t_ch_cust_befbalnew.Cancel; exit; end; if ((t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat>0) and(do_num>t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat)) or ((t_ch_cust_befbal_sum.fieldbyname('预收金额').asfloat<0) and(do_num'' then begin ShowMessage('请检查以下费用'+#13#10+str_feeValid); end; shench:=false; modify_all:=false; except shench:=false; modify_all:=false; showmessage('审核失败!!'); end; t_ch_balance.Refresh; end; end; procedure Tfrm_ch_balance_pay.N8Click(Sender: TObject); var aAdoQuery,bAdoQuery:TAdoQuery; s,s1:string; i:Integer; begin if t_ch_balance.IsEmpty then exit; if dxDBGrid1.SelectedCount<1 then begin exit; end; s:=''; try aAdoQuery:=CreateAdoQuery; bAdoQuery:=CreateAdoQuery; with aAdoQuery do begin Close;sql.Clear; sql.Add('select '); sql.Add('sum(case 币别 when ''USD'' then 原始金额 else 0 end) as USDAMT'); sql.Add(',sum(case 币别 when ''RMB'' then 原始金额 else 0 end) as RMBAMT'); sql.Add('From t_ch_fee_do'); sql.Add('where 工作编号=:bsno'); end; with bAdoQuery do begin Close;sql.Clear; sql.Add('select do.ch_id,v.主提单号,count(*)'); sql.Add('from t_ch_fee_do do'); sql.Add('left join V_op_bscard_All v on do.业务编号=v.编号'); sql.Add('where do.工作编号=:bsno'); sql.Add('group by do.ch_id,v.主提单号'); sql.Add('having count(*)>1'); end; t_ch_balance.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_ch_balance.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); aAdoQuery.close; aAdoQuery.Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; aAdoQuery.open; bAdoQuery.close; bAdoQuery.Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; bAdoQuery.open; if (t_ch_balance.FieldByName('人民币金额').Value<> aAdoQuery.FieldByName('RMBAMT').Value) or (t_ch_balance.FieldByName('美元金额').Value<> aAdoQuery.FieldByName('USDAMT').Value) then begin if s='' then s:=t_ch_balance.FieldByName('帐单编号').Value+':USD'+FormatFloat('0;0;0',aAdoQuery.FieldByName('USDAMT').AsFloat)+' RMB:'+FormatFloat('0;0;0',aAdoQuery.FieldByName('RMBAMT').AsFloat) else s:=s+#13#10+t_ch_balance.FieldByName('帐单编号').Value+':USD'+FormatFloat('0;0;0',aAdoQuery.FieldByName('USDAMT').AsFloat)+' RMB:'+FormatFloat('0;0;0',aAdoQuery.FieldByName('RMBAMT').AsFloat); end; if not bAdoQuery.IsEmpty then begin if s1='' then s1:=t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bAdoQuery.FieldByName('主提单号').AsString else s1:=s1+#13#10+t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bAdoQuery.FieldByName('主提单号').AsString; end; end; finally aAdoQuery.Free; bAdoQuery.Free; t_ch_balance.EnableControls; t_ch_balance.Refresh; if s<>'' then ShowMessage(s); if s1<>'' then ShowMessage(s1); end; end; procedure Tfrm_ch_balance_pay.bsSkinButton17Click(Sender: TObject); begin if t_ch_zhipiao.IsEmpty then exit; if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then t_ch_zhipiao.delete; end; procedure Tfrm_ch_balance_pay.bsSkinButton34Click(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['美元金额']:=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['财务凭证']:=''; // t_ch_balance['帐单编号']:=get_no(date,'BP'); { if bsSkinNotebook1.PageIndex<>0 then getdetail; } notdetail:=false; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; notdetail:=true; except if t_ch_balance.state=dsinsert then t_ch_balance.cancel; showmessage('复制添加失败!!'); end; end; procedure Tfrm_ch_balance_pay.dxDBGrid20Column25CustomDraw(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[dxDBGrid20Column25.Index]); AFont.Color:=clblack; end; procedure Tfrm_ch_balance_pay.dxDBGrid20Column26CustomDraw(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[dxDBGrid20Column26.Index]); AFont.Color:=clblack; end; procedure Tfrm_ch_balance_pay.getdetail(balno:string); begin //添加费用的数据集,只在需要的时候打开提高速度 if StrToBool(get_parameters_value(85,'false')) then begin fra_ch_delete_do1.v_fee_do_bscard.close; fra_ch_delete_do1.v_fee_do_bscard.SQL.clear; fra_ch_delete_do1.v_fee_do_bscard.sql.add('select * from v_fee_do_bscard ' +'where 工作编号='''+balno+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_bscard.Open; fra_ch_delete_do1.v_fee_do_bscard_sum.close; fra_ch_delete_do1.v_fee_do_bscard_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_bscard_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_bscard ' +'where 工作编号='''+balno+''' 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_bscard_sum.Open; end else begin fra_ch_delete_do1.v_fee_do_seae.close; 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 工作编号='''+balno+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seae.Open; fra_ch_delete_do1.v_fee_do_seai.close; 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 工作编号='''+balno+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seai.Open; fra_ch_delete_do1.v_fee_do_aire.close; 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 工作编号='''+balno+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_aire.Open; fra_ch_delete_do1.v_fee_do_airi.close; 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 工作编号='''+balno+''' order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_airi.Open; fra_ch_delete_do1.v_fee_do_seae_sum.close; 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 工作编号='''+balno+''' 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.Open; fra_ch_delete_do1.v_fee_do_seai_sum.close; 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 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''' 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.Open; fra_ch_delete_do1.v_fee_do_aire_sum.close; 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 工作编号='''+balno+''' 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.Open; fra_ch_delete_do1.v_fee_do_airi_sum.close; 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 工作编号='''+balno+''' 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.open; end; end; procedure Tfrm_ch_balance_pay.closedetail; begin //关闭添加费用数据集 if StrToBool(get_parameters_value(85,'false')) then begin fra_ch_delete_do1.v_fee_do_bscard.close; fra_ch_delete_do1.v_fee_do_bscard_sum.close; end else begin fra_ch_delete_do1.v_fee_do_seae.close; fra_ch_delete_do1.v_fee_do_seai.close; fra_ch_delete_do1.v_fee_do_aire.close; fra_ch_delete_do1.v_fee_do_airi.close; fra_ch_delete_do1.v_fee_do_seae_sum.close; fra_ch_delete_do1.v_fee_do_seai_sum.close; fra_ch_delete_do1.v_fee_do_aire_sum.close; fra_ch_delete_do1.v_fee_do_airi_sum.close; end; end; { SELECT * FROM ch_check WHERE (申请编号 NOT IN (SELECT DISTINCT t_ch_fee_do.工作编号 FROM t_ch_fee_do INNER JOIN t_ch_fee ON t_ch_fee_do.CH_ID = t_ch_fee.CH_ID AND t_ch_fee_do.原始金额 >( t_ch_fee.金额 - t_ch_fee.结算金额) AND t_ch_fee_do.类型 = '3')) and (申请编号<>'') order by 申请编号 } procedure Tfrm_ch_balance_pay.fra_ch_add_do1bsSkinButton8Click( Sender: TObject); begin fra_ch_add_do1.bsSkinButton8Click(Sender); end; procedure Tfrm_ch_balance_pay.fra_ch_add_do1MenuItem1Click( Sender: TObject); begin fra_ch_add_do1.MenuItem1Click(Sender); end; procedure Tfrm_ch_balance_pay.dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_ch_balance,'申请编号'); end; procedure Tfrm_ch_balance_pay.dxDBGrid2SelectedCountChange( Sender: TObject); var i:integer; amt,usdAmt:Double; begin if t_ch_check.IsEmpty then exit; if dxDBGrid2.SelectedCount>=1 then begin amt:=0; usdAmt:=0; for i:=0 to dxDBGrid2.SelectedCount-1 do begin t_ch_check.GotoBookmark(pointer(dxDBGrid2.selectedrows[i])); if t_ch_check.fieldByName('币别').AsString='RMB' then amt:=amt+t_ch_check.fieldByName('申请金额').AsFloat else usdAmt:=usdAmt+t_ch_check.fieldByName('申请金额').AsFloat; end; end else begin amt:=0; usdAmt:=0; if t_ch_check.fieldByName('币别').AsString='RMB' then amt:=amt+t_ch_check.fieldByName('申请金额').AsFloat else usdAmt:=usdAmt+t_ch_check.fieldByName('申请金额').AsFloat; end; Label130.Caption:='你选择了'+inttostr(dxDBGrid2.SelectedCount)+'票业务,'+'RMB金额:'+FormatFloat('#,##,0.00;-0.00',amt)+' 外币金额:'+FormatFloat('#,##,0.00;-0.00',usdAmt); end; procedure Tfrm_ch_balance_pay.SelectAddVouchers; var t_cw_design,aQuery,bQuery,aAdoQueryCheck:TAdoQuery; s_error:string; i:integer; begin if not if_open('185') and not if_open('523') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.bsSkinGauge1.ProgressText:='正在校验数据。。。'; frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=dxDBGrid1.SelectedCount; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; t_ch_balance.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_ch_balance.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; if trim(GetBalanceVou(t_ch_balance.fieldbyname('帐单编号').AsString))<>'' then begin showmessage('已经生成凭证!!'); exit; end; if t_ch_balance.FieldByName('结算日期').IsNull then begin ShowMessage('结算日期不能为空'); Exit; end; if t_ch_balance.fieldbyname('附件数').AsInteger=0 then begin ShowMessage('附件数不能为0,请输入附件数'); Exit; end; if Trim(t_ch_balance.FieldByName('财务代码').AsString)='' then begin ShowMessage(t_ch_balance.FieldByName('客户名称').AsString+' 没有财务代码'); Exit; end; if Trim(t_ch_balance.FieldByName('结算人').AsString)<>employee then begin ShowMessage('账单编号:'+t_ch_balance.FieldByName('帐单编号').AsString+', 结算人不是当前人员!'); end; s_error:=''; aAdoQueryCheck:=CreateAdoQuery; with aAdoQueryCheck do try close;sql.Clear; sql.Add('select v.主提单号,v.业务类型,fee.费用名称,fee.客户名称,fee.金额,fee.结算金额,do.原始金额,do.工作编号 帐单编号 from t_ch_fee fee'); sql.Add('left JOIN t_ch_fee_do do on fee.编号=do.业务编号 and fee.ch_id=do.ch_id'); sql.Add('left join V_op_bscard_All v on fee.编号=v.编号'); sql.Add('where do.工作编号=:工作编号 and ((fee.结算金额=0 and fee.金额<>0) or (fee.金额>0 and fee.金额fee.结算金额))'); sql.Add('and do.类型 in (3,4) '); sql.Add(''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not Eof do begin if Trim(s_error)='' then s_error:=fieldbyname('主提单号').AsString+'/'+fieldbyname('费用名称').AsString+'/'+fieldbyname('客户名称').AsString+'/'+fieldbyname('金额').AsString else s_error:=s_error+#13#10+fieldbyname('主提单号').AsString+'/'+fieldbyname('费用名称').AsString+'/'+fieldbyname('客户名称').AsString+'/'+fieldbyname('金额').AsString; Next; end; if Trim(s_error)<>'' then begin ShowMessage(s_error+#13#10+'存在异常请核对帐单'); Exit; end; s_error:=''; Close;sql.Clear; sql.Add('select '); sql.Add('sum(case 币别 when ''USD'' then 原始金额 else 0 end) as USDAMT'); sql.Add(',sum(case 币别 when ''RMB'' then 原始金额 else 0 end) as RMBAMT'); sql.Add('From t_ch_fee_do'); sql.Add('where 工作编号=:bsno'); Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; open; if (t_ch_balance.FieldByName('人民币金额').Value<> FieldByName('RMBAMT').Value) or (t_ch_balance.FieldByName('美元金额').Value<> FieldByName('USDAMT').Value) then begin s_error:=t_ch_balance.FieldByName('帐单编号').Value+':USD'+FormatFloat('0;0;0',FieldByName('USDAMT').AsFloat)+' RMB:'+FormatFloat('0;0;0',FieldByName('RMBAMT').AsFloat); end; if Trim(s_error)<>'' then begin ShowMessage(s_error+#13#10+'帐单总数不等于帐单明细请核对帐单'); Exit; end; finally free; end; try s_error:=''; bQuery:=CreateAdoQuery; with bQuery do begin Close;sql.Clear; sql.Add('select do.ch_id,v.主提单号,count(*)'); sql.Add('from t_ch_fee_do do'); sql.Add('left join V_op_bscard_All v on do.业务编号=v.编号'); sql.Add('where do.工作编号=:bsno'); sql.Add('group by do.ch_id,v.主提单号'); sql.Add('having count(*)>1'); Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; open; end; if not bQuery.IsEmpty then begin if s_error='' then s_error:=t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bQuery.FieldByName('主提单号').AsString else s_error:=s_error+#13#10+t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bQuery.FieldByName('主提单号').AsString; ShowMessage(s_error+#13#10+'帐单总数不等于帐单明细请核对帐单'); Exit; end; finally bQuery.Free; end; end finally t_ch_balance.EnableControls; frm_sys_progress.Close; frm_sys_progress.Free; frm_sys_progress:=nil; end; try if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.bsSkinGauge1.ProgressText:='正在生成凭证。。。'; frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=dxDBGrid1.SelectedCount; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; t_cw_design:=CreateAdoQuery; with t_cw_design do begin Close;Sql.Clear; SQL.Add('select * from t_cw_design'); Open; end; aQuery:=CreateAdoQuery; aQuery.Close; aQuery.SQL.Clear; aQuery.SQL.add('update t_ch_balance set 财务=1,财务凭证=:财务凭证,凭证日期=:凭证日期 where 帐单编号=:帐单编号'); dmacc:=TdmAcc.Create(self); t_ch_balance.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_ch_balance.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; NewDCVou(t_ch_balance,dmacc.AdotblVou,dmacc.AdotblVouItems,t_cw_design,employee ,Logininfo.bsDate,6.25,6.3,True); { if not assigned(frm_cw_pingzheng) then frm_cw_pingzheng:=tfrm_cw_pingzheng.Create (self); frm_cw_pingzheng.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng',frm_cw_pingzheng.caption),nil,alClient); frm_cw_pingzheng.EditOrdNoFrm.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng.EditOrdNoTo.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng.show; } aQuery.Parameters.ParamByName('财务凭证').Value:=dmacc.ADOTblVou.fieldbyname('ordno').AsString; aQuery.Parameters.ParamByName('帐单编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; aQuery.Parameters.ParamByName('凭证日期').Value:=Logininfo.bsDate; // aQuery.Parameters.ParamByName('凭证日期').Value:=FormatDateTime('YYYY-MM-DD',t_ch_balance.fieldbyname('结算日期').Value); aQuery.ExecSQL; end; // bsSkinButton1.OnClick(bsSkinButton1); finally frm_sys_progress.Close; frm_sys_progress.Free; frm_sys_progress:=nil; t_ch_balance.EnableControls; t_ch_balance.Requery(); t_cw_design.Free; aQuery.Free; freeAndNil(dmacc); end; end; procedure Tfrm_ch_balance_pay.AddVouchers; var t_cw_design,aQuery,bQuery,aAdoQueryCheck:TAdoQuery; s_error:string; i:integer; begin if not if_open('185') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if trim(GetBalanceVou(t_ch_balance.fieldbyname('帐单编号').AsString))<>'' then begin showmessage('已经生成凭证!!'); exit; end; if t_ch_balance.FieldByName('结算日期').IsNull then begin ShowMessage('结算日期不能为空'); Exit; end; if t_ch_balance.fieldbyname('附件数').AsInteger=0 then begin ShowMessage('附件数不能为0,请输入附件数'); Exit; end; if Trim(t_ch_balance.FieldByName('财务代码').AsString)='' then begin ShowMessage(t_ch_balance.FieldByName('客户名称').AsString+' 没有财务代码'); Exit; end; if Trim(t_ch_balance.FieldByName('结算人').AsString)<>employee then begin ShowMessage('账单编号:'+t_ch_balance.FieldByName('帐单编号').AsString+', 结算人不是当前人员!'); end; s_error:=''; aAdoQueryCheck:=CreateAdoQuery; with aAdoQueryCheck do try close;sql.Clear; sql.Add('select v.主提单号,v.业务类型,fee.费用名称,fee.客户名称,fee.金额,fee.结算金额,do.原始金额,do.工作编号 帐单编号 from t_ch_fee fee'); sql.Add('left JOIN t_ch_fee_do do on fee.编号=do.业务编号 and fee.ch_id=do.ch_id'); sql.Add('left join V_op_bscard_All v on fee.编号=v.编号'); sql.Add('where do.工作编号=:工作编号 and ((fee.结算金额=0 and fee.金额<>0) or (fee.金额>0 and fee.金额fee.结算金额))'); sql.Add('and do.类型 in (3,4) '); sql.Add(''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not Eof do begin if Trim(s_error)='' then s_error:=fieldbyname('主提单号').AsString+'/'+fieldbyname('费用名称').AsString+'/'+fieldbyname('客户名称').AsString+'/'+fieldbyname('金额').AsString else s_error:=s_error+#13#10+fieldbyname('主提单号').AsString+'/'+fieldbyname('费用名称').AsString+'/'+fieldbyname('客户名称').AsString+'/'+fieldbyname('金额').AsString; Next; end; if Trim(s_error)<>'' then begin ShowMessage(s_error+#13#10+'存在异常请核对帐单'); Exit; end; s_error:=''; Close;sql.Clear; sql.Add('select '); sql.Add('sum(case 币别 when ''USD'' then 原始金额 else 0 end) as USDAMT'); sql.Add(',sum(case 币别 when ''RMB'' then 原始金额 else 0 end) as RMBAMT'); sql.Add('From t_ch_fee_do'); sql.Add('where 工作编号=:bsno'); Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; open; if (t_ch_balance.FieldByName('人民币金额').Value<> FieldByName('RMBAMT').Value) or (t_ch_balance.FieldByName('美元金额').Value<> FieldByName('USDAMT').Value) then begin s_error:=t_ch_balance.FieldByName('帐单编号').Value+':USD'+FormatFloat('0;0;0',FieldByName('USDAMT').AsFloat)+' RMB:'+FormatFloat('0;0;0',FieldByName('RMBAMT').AsFloat); end; if Trim(s_error)<>'' then begin ShowMessage(s_error+#13#10+'帐单总数不等于帐单明细请核对帐单'); Exit; end; finally free; end; try s_error:=''; bQuery:=CreateAdoQuery; with bQuery do begin Close;sql.Clear; sql.Add('select do.ch_id,v.主提单号,count(*)'); sql.Add('from t_ch_fee_do do'); sql.Add('left join V_op_bscard_All v on do.业务编号=v.编号'); sql.Add('where do.工作编号=:bsno'); sql.Add('group by do.ch_id,v.主提单号'); sql.Add('having count(*)>1'); Parameters.ParamByName('bsno').Value:=t_ch_balance.FieldByName('帐单编号').Value; open; end; if not bQuery.IsEmpty then begin if s_error='' then s_error:=t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bQuery.FieldByName('主提单号').AsString else s_error:=s_error+#13#10+t_ch_balance.FieldByName('帐单编号').Value+' 主提单号:' +bQuery.FieldByName('主提单号').AsString; ShowMessage(s_error+#13#10+'帐单总数不等于帐单明细请核对帐单'); Exit; end; finally bQuery.Free; end; try t_cw_design:=CreateAdoQuery; with t_cw_design do begin Close;Sql.Clear; SQL.Add('select * from t_cw_design'); Open; end; aQuery:=CreateAdoQuery; aQuery.Close; aQuery.SQL.Clear; aQuery.SQL.add('update t_ch_balance set 财务=1,财务凭证=:财务凭证,凭证日期=:凭证日期 where 帐单编号=:帐单编号'); dmacc:=TdmAcc.Create(self); t_ch_balance.DisableControls; NewDCVou(t_ch_balance,dmacc.AdotblVou,dmacc.AdotblVouItems,t_cw_design,employee ,Logininfo.bsDate,6.25,6.3,false); if frm_data_share.t_sys_company.FieldByName('发票抬头').AsString='' then begin if not assigned(frm_cw_pingzheng_jku8) then frm_cw_pingzheng_jku8:=tfrm_cw_pingzheng_jku8.Create (self); frm_cw_pingzheng_jku8.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng_jku8',frm_cw_pingzheng_jku8.caption),nil,alClient); frm_cw_pingzheng_jku8.EditOrdNoFrm.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng_jku8.EditOrdNoTo.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng_jku8.show; aQuery.Parameters.ParamByName('财务凭证').Value:=dmacc.ADOTblVou.fieldbyname('ordno').AsString; aQuery.Parameters.ParamByName('帐单编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; aQuery.Parameters.ParamByName('凭证日期').Value:=Logininfo.bsDate; end else begin if not assigned(frm_cw_pingzheng_u8) then frm_cw_pingzheng_u8:=tfrm_cw_pingzheng_u8.Create (self); frm_cw_pingzheng_u8.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng_u8',frm_cw_pingzheng_u8.caption),nil,alClient); frm_cw_pingzheng_u8.EditOrdNoFrm.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng_u8.EditOrdNoTo.Text:=dmacc.AdotblVou.FieldByName('ORDNO').AsString; frm_cw_pingzheng_u8.show; aQuery.Parameters.ParamByName('财务凭证').Value:=dmacc.ADOTblVou.fieldbyname('ordno').AsString; aQuery.Parameters.ParamByName('帐单编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; aQuery.Parameters.ParamByName('凭证日期').Value:=Logininfo.bsDate; end; // aQuery.Parameters.ParamByName('凭证日期').Value:=FormatDateTime('YYYY-MM-DD',t_ch_balance.fieldbyname('结算日期').Value); aQuery.ExecSQL; // bsSkinButton1.OnClick(bsSkinButton1); finally t_ch_balance.EnableControls; t_ch_balance.Requery(); t_cw_design.Free; aQuery.Free; freeAndNil(dmacc); end; end; procedure Tfrm_ch_balance_pay.dxDBGrid1CustomDraw(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 uppercase(ANode.Strings[dxDBGrid1Column40.Index])='TRUE' then begin AFont.Color:=clMoneyGreen; end; end; procedure Tfrm_ch_balance_pay.bsSkinButton37Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then SelectAddVouchers else AddVouchers; end; end.