{$INCLUDE t_main.inc} unit u_ch_balance_accept; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DB, ADODB, dxDBTLCl, dxGrClms, u_ch_delete_do, u_ch_add_do, bsdbctrls, RxLookup, StdCtrls, Mask, DBCtrls, wwdbedit, Wwdotdot, Wwdbcomb, Menus, XPMenu, ComCtrls, bsSkinTabs, ExtCtrls, wwdbdatetimepicker, sncCurrency, sncDBCurrency, ToolEdit, CurrEdit, RXDBCtrl, DBCtrlsEh, AAFont, AACtrls, RxMemDS; type Tfrm_ch_balance_accept = class(TForm) t_ch_balance: TADOQuery; t_ch_balance1: TDataSource; t_ch_fee_do_detail: TADOQuery; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu1: TXPMenu; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinPanel2: TbsSkinPanel; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinNotebook1: TbsSkinNotebook; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridDateColumn; dxDBGrid1Column15: TdxDBGridColumn; dxDBGrid1Column16: TdxDBGridColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridDateColumn; DBEdit2: TDBEdit; 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; bsSkinPanel4: TbsSkinPanel; bsSkinPanel5: TbsSkinPanel; Label11: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label18: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; DBEdit3: TDBEdit; DBEdit7: TDBEdit; RxDBLookupCombo4: TRxDBLookupCombo; wwDBComboBox2: TwwDBComboBox; RxDBLookupCombo5: TRxDBLookupCombo; DBEdit11: TDBEdit; DBEdit12: TDBEdit; DBEdit13: TDBEdit; RxDBLookupCombo6: TRxDBLookupCombo; DBEdit15: TDBEdit; DBEdit16: TDBEdit; DBEdit17: TDBEdit; DBMemo2: TDBMemo; RxDBLookupCombo7: TRxDBLookupCombo; DBEdit18: TDBEdit; bsSkinPageControl2: TbsSkinPageControl; bsSkinTabSheet3: TbsSkinTabSheet; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; bsSkinTabSheet5: TbsSkinTabSheet; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; bsSkinTabSheet6: TbsSkinTabSheet; dxDBGrid5: TdxDBGrid; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; fra_ch_delete_do1: Tfra_ch_delete_do; fra_ch_add_do1: Tfra_ch_add_do; t_ch_invoice_shen: TADOQuery; t_ch_invoice_shen1: TDataSource; 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_aire1: TDataSource; v_fee_do_airi: TADOQuery; v_fee_do_airi1: TDataSource; bsSkinPanel6: TbsSkinPanel; bsSkinPageControl3: TbsSkinPageControl; bsSkinTabSheet7: TbsSkinTabSheet; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGridMaskColumn58: TdxDBGridMaskColumn; dxDBGridMaskColumn59: TdxDBGridMaskColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridMaskColumn60: TdxDBGridMaskColumn; dxDBGridDateColumn9: TdxDBGridDateColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridMaskColumn61: TdxDBGridMaskColumn; dxDBGridMaskColumn62: TdxDBGridMaskColumn; dxDBGridMaskColumn63: TdxDBGridMaskColumn; dxDBGridMaskColumn64: TdxDBGridMaskColumn; dxDBGridMaskColumn65: TdxDBGridMaskColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridMaskColumn66: TdxDBGridMaskColumn; dxDBGridMaskColumn67: TdxDBGridMaskColumn; dxDBGridMaskColumn68: TdxDBGridMaskColumn; dxDBGridMaskColumn69: TdxDBGridMaskColumn; bsSkinTabSheet8: TbsSkinTabSheet; dxDBGrid7: TdxDBGrid; dxDBGridMaskColumn70: TdxDBGridMaskColumn; dxDBGridMaskColumn71: TdxDBGridMaskColumn; dxDBGridMaskColumn72: TdxDBGridMaskColumn; dxDBGridMaskColumn73: TdxDBGridMaskColumn; dxDBGridMaskColumn74: TdxDBGridMaskColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridMaskColumn75: TdxDBGridMaskColumn; dxDBGridDateColumn11: TdxDBGridDateColumn; dxDBGridDateColumn12: TdxDBGridDateColumn; dxDBGridMaskColumn76: TdxDBGridMaskColumn; dxDBGridMaskColumn77: TdxDBGridMaskColumn; dxDBGridMaskColumn78: TdxDBGridMaskColumn; dxDBGridMaskColumn79: TdxDBGridMaskColumn; dxDBGridMaskColumn80: TdxDBGridMaskColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridMaskColumn81: TdxDBGridMaskColumn; dxDBGridMaskColumn82: TdxDBGridMaskColumn; dxDBGridMaskColumn83: TdxDBGridMaskColumn; dxDBGridMaskColumn84: TdxDBGridMaskColumn; bsSkinTabSheet9: TbsSkinTabSheet; dxDBGrid8: TdxDBGrid; dxDBGridMaskColumn85: TdxDBGridMaskColumn; dxDBGridMaskColumn86: TdxDBGridMaskColumn; dxDBGridMaskColumn87: TdxDBGridMaskColumn; dxDBGridMaskColumn88: TdxDBGridMaskColumn; dxDBGridMaskColumn89: TdxDBGridMaskColumn; dxDBGridColumn25: TdxDBGridColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridMaskColumn90: TdxDBGridMaskColumn; dxDBGridDateColumn13: TdxDBGridDateColumn; dxDBGridDateColumn14: TdxDBGridDateColumn; dxDBGridMaskColumn91: TdxDBGridMaskColumn; dxDBGridMaskColumn92: TdxDBGridMaskColumn; dxDBGridMaskColumn93: TdxDBGridMaskColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridMaskColumn94: TdxDBGridMaskColumn; dxDBGridMaskColumn95: TdxDBGridMaskColumn; dxDBGridMaskColumn96: TdxDBGridMaskColumn; bsSkinTabSheet10: TbsSkinTabSheet; dxDBGrid9: TdxDBGrid; dxDBGridMaskColumn97: TdxDBGridMaskColumn; dxDBGridMaskColumn98: TdxDBGridMaskColumn; dxDBGridMaskColumn99: TdxDBGridMaskColumn; dxDBGridMaskColumn100: TdxDBGridMaskColumn; dxDBGridMaskColumn101: TdxDBGridMaskColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGridMaskColumn102: TdxDBGridMaskColumn; dxDBGridDateColumn15: TdxDBGridDateColumn; dxDBGridDateColumn16: TdxDBGridDateColumn; dxDBGridMaskColumn103: TdxDBGridMaskColumn; dxDBGridMaskColumn104: TdxDBGridMaskColumn; dxDBGridMaskColumn105: TdxDBGridMaskColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridMaskColumn106: TdxDBGridMaskColumn; dxDBGridMaskColumn107: TdxDBGridMaskColumn; dxDBGridMaskColumn108: TdxDBGridMaskColumn; dxDBGrid10: TdxDBGrid; dxDBGridMaskColumn109: TdxDBGridMaskColumn; dxDBGridMaskColumn110: TdxDBGridMaskColumn; dxDBGridMaskColumn111: TdxDBGridMaskColumn; dxDBGridMaskColumn112: TdxDBGridMaskColumn; dxDBGridColumn33: TdxDBGridColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridColumn35: TdxDBGridColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridMaskColumn; dxDBGrid1Column20: TdxDBGridDateColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridDateColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridDateColumn; bsSkinPanel7: TbsSkinPanel; bsSkinPanel8: TbsSkinPanel; bsSkinButton21: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; bsSkinButton7: TbsSkinButton; Label29: TLabel; DBEdit19: TDBEdit; Label30: TLabel; DBEdit20: TDBEdit; Label31: TLabel; DBEdit21: TDBEdit; Label32: TLabel; DBEdit22: TDBEdit; Label33: TLabel; DBEdit23: TDBEdit; Label34: TLabel; DBEdit24: TDBEdit; DBEdit25: TDBEdit; Label35: TLabel; DBEdit26: TDBEdit; Label36: TLabel; DBEdit27: TDBEdit; Label37: TLabel; Label38: TLabel; DBEdit28: TDBEdit; Label39: TLabel; DBEdit29: TDBEdit; Label41: TLabel; DBEdit31: TDBEdit; Label42: TLabel; DBMemo3: TDBMemo; Label43: TLabel; DBMemo4: TDBMemo; t_ch_fee_do_invoice: TADOQuery; v_fee_do_seae_sum: TADOQuery; v_fee_do_seae_sum1: TDataSource; v_fee_do_seai_sum1: TDataSource; v_fee_do_seai_sum: TADOQuery; v_fee_do_aire_sum: TADOQuery; v_fee_do_aire_sum1: TDataSource; v_fee_do_airi_sum: TADOQuery; v_fee_do_airi_sum1: TDataSource; bsSkinButton12: TbsSkinButton; dxDBGrid2Column22: TdxDBGridColumn; dxDBGrid3Column22: TdxDBGridColumn; dxDBGrid4Column19: TdxDBGridColumn; dxDBGrid5Column19: TdxDBGridColumn; dxDBGrid6Column22: TdxDBGridColumn; dxDBGrid7Column22: TdxDBGridColumn; dxDBGrid8Column19: TdxDBGridColumn; dxDBGrid9Column19: TdxDBGridColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGrid3Column23: TdxDBGridColumn; dxDBGrid4Column20: TdxDBGridColumn; dxDBGrid5Column20: TdxDBGridColumn; dxDBGrid11: TdxDBGrid; dxDBGrid5Column4: TdxDBGridColumn; dxDBGrid5Column1: TdxDBGridMaskColumn; dxDBGrid5Column2: TdxDBGridColumn; dxDBGrid5Column5: TdxDBGridColumn; dxDBGrid5Column6: TdxDBGridColumn; dxDBGrid5Column3: TdxDBGridColumn; dxDBGrid12: TdxDBGrid; dxDBGrid6Column4: TdxDBGridColumn; dxDBGridMaskColumn113: TdxDBGridMaskColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGrid6Column5: TdxDBGridColumn; dxDBGrid6Column6: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; dxDBGrid13: TdxDBGrid; dxDBGrid7Column4: TdxDBGridColumn; dxDBGridMaskColumn114: TdxDBGridMaskColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGrid7Column5: TdxDBGridColumn; dxDBGrid7Column6: TdxDBGridColumn; dxDBGridColumn44: TdxDBGridColumn; dxDBGrid14: TdxDBGrid; dxDBGrid8Column4: TdxDBGridColumn; dxDBGridMaskColumn115: TdxDBGridMaskColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGrid8Column5: TdxDBGridColumn; dxDBGrid8Column6: TdxDBGridColumn; dxDBGridColumn45: TdxDBGridColumn; dxDBGrid15: TdxDBGrid; dxDBGridColumn39: TdxDBGridColumn; dxDBGridMaskColumn116: TdxDBGridMaskColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; dxDBGrid16: TdxDBGrid; dxDBGridColumn40: TdxDBGridColumn; dxDBGridMaskColumn117: TdxDBGridMaskColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGridColumn53: TdxDBGridColumn; dxDBGrid17: TdxDBGrid; dxDBGridColumn41: TdxDBGridColumn; dxDBGridMaskColumn118: TdxDBGridMaskColumn; dxDBGridColumn54: TdxDBGridColumn; dxDBGridColumn55: TdxDBGridColumn; dxDBGridColumn56: TdxDBGridColumn; dxDBGridColumn57: TdxDBGridColumn; dxDBGrid18: TdxDBGrid; dxDBGridColumn42: TdxDBGridColumn; dxDBGridMaskColumn119: TdxDBGridMaskColumn; dxDBGridColumn58: TdxDBGridColumn; dxDBGridColumn59: TdxDBGridColumn; dxDBGridColumn60: TdxDBGridColumn; dxDBGridColumn61: TdxDBGridColumn; bsSkinTabSheet111: TbsSkinTabSheet; Panel1: TPanel; dxDBGrid19: TdxDBGrid; dxDBGridMaskColumn120: TdxDBGridMaskColumn; dxDBGridMaskColumn121: TdxDBGridMaskColumn; dxDBGrid2Column12: TdxDBGridColumn; dxDBGridMaskColumn122: TdxDBGridMaskColumn; dxDBGridMaskColumn123: TdxDBGridMaskColumn; dxDBGridColumn62: TdxDBGridColumn; dxDBGridColumn63: TdxDBGridColumn; dxDBGridColumn64: TdxDBGridColumn; dxDBGridMaskColumn124: TdxDBGridMaskColumn; dxDBGridDateColumn17: TdxDBGridDateColumn; dxDBGridMaskColumn125: TdxDBGridMaskColumn; dxDBGridDateColumn18: TdxDBGridDateColumn; bsSkinPanel9: TbsSkinPanel; Label44: TLabel; Label45: TLabel; Label46: TLabel; Label47: TLabel; Label48: TLabel; Label49: TLabel; Label50: TLabel; Label51: TLabel; Label52: TLabel; Label53: TLabel; Label54: TLabel; Label55: TLabel; Label56: TLabel; Label58: TLabel; DBEdit32: TDBEdit; DBEdit33: TDBEdit; DBEdit34: TDBEdit; DBEdit35: TDBEdit; DBEdit36: TDBEdit; DBMemo5: TDBMemo; DBEdit37: TDBEdit; DBEdit38: TDBEdit; DBEdit39: TDBEdit; DBEdit40: TDBEdit; bsSkinPanel10: TbsSkinPanel; bsSkinButton13: TbsSkinButton; bsSkinButton14: TbsSkinButton; bsSkinButton15: TbsSkinButton; DBEdit41: TDBEdit; DBEdit43: TDBEdit; DBEdit44: TDBEdit; DBEdit46: TDBEdit; bsSkinPageControl4: TbsSkinPageControl; bsSkinTabSheet11: TbsSkinTabSheet; dxDBGrid20: TdxDBGrid; dxDBGridMaskColumn126: TdxDBGridMaskColumn; dxDBGridMaskColumn127: TdxDBGridMaskColumn; dxDBGridMaskColumn128: TdxDBGridMaskColumn; dxDBGridMaskColumn129: TdxDBGridMaskColumn; dxDBGridMaskColumn130: TdxDBGridMaskColumn; dxDBGridColumn65: TdxDBGridColumn; dxDBGridColumn66: TdxDBGridColumn; dxDBGridMaskColumn131: TdxDBGridMaskColumn; dxDBGridColumn67: TdxDBGridColumn; dxDBGridDateColumn19: TdxDBGridDateColumn; dxDBGridDateColumn20: TdxDBGridDateColumn; dxDBGridMaskColumn132: TdxDBGridMaskColumn; dxDBGridMaskColumn133: TdxDBGridMaskColumn; dxDBGridMaskColumn134: TdxDBGridMaskColumn; dxDBGridMaskColumn135: TdxDBGridMaskColumn; dxDBGridMaskColumn136: TdxDBGridMaskColumn; dxDBGridColumn68: TdxDBGridColumn; dxDBGridColumn69: TdxDBGridColumn; dxDBGridMaskColumn137: TdxDBGridMaskColumn; dxDBGridMaskColumn138: TdxDBGridMaskColumn; dxDBGridMaskColumn139: TdxDBGridMaskColumn; dxDBGridMaskColumn140: TdxDBGridMaskColumn; dxDBGrid21: TdxDBGrid; dxDBGridColumn70: TdxDBGridColumn; dxDBGridMaskColumn141: TdxDBGridMaskColumn; dxDBGridColumn71: TdxDBGridColumn; dxDBGridColumn72: TdxDBGridColumn; dxDBGridColumn73: TdxDBGridColumn; dxDBGridColumn74: TdxDBGridColumn; bsSkinTabSheet12: TbsSkinTabSheet; dxDBGrid22: TdxDBGrid; dxDBGridMaskColumn142: TdxDBGridMaskColumn; dxDBGridMaskColumn143: TdxDBGridMaskColumn; dxDBGridMaskColumn144: TdxDBGridMaskColumn; dxDBGridMaskColumn145: TdxDBGridMaskColumn; dxDBGridMaskColumn146: TdxDBGridMaskColumn; dxDBGridColumn75: TdxDBGridColumn; dxDBGridColumn76: TdxDBGridColumn; dxDBGridMaskColumn147: TdxDBGridMaskColumn; dxDBGridColumn77: TdxDBGridColumn; dxDBGridDateColumn21: TdxDBGridDateColumn; dxDBGridDateColumn22: TdxDBGridDateColumn; dxDBGridMaskColumn148: TdxDBGridMaskColumn; dxDBGridMaskColumn149: TdxDBGridMaskColumn; dxDBGridMaskColumn150: TdxDBGridMaskColumn; dxDBGridMaskColumn151: TdxDBGridMaskColumn; dxDBGridMaskColumn152: TdxDBGridMaskColumn; dxDBGridColumn78: TdxDBGridColumn; dxDBGridColumn79: TdxDBGridColumn; dxDBGridMaskColumn153: TdxDBGridMaskColumn; dxDBGridMaskColumn154: TdxDBGridMaskColumn; dxDBGridMaskColumn155: TdxDBGridMaskColumn; dxDBGridMaskColumn156: TdxDBGridMaskColumn; dxDBGrid23: TdxDBGrid; dxDBGridColumn80: TdxDBGridColumn; dxDBGridMaskColumn157: TdxDBGridMaskColumn; dxDBGridColumn81: TdxDBGridColumn; dxDBGridColumn82: TdxDBGridColumn; dxDBGridColumn83: TdxDBGridColumn; dxDBGridColumn84: TdxDBGridColumn; bsSkinTabSheet13: TbsSkinTabSheet; dxDBGrid24: TdxDBGrid; dxDBGridMaskColumn158: TdxDBGridMaskColumn; dxDBGridMaskColumn159: TdxDBGridMaskColumn; dxDBGridMaskColumn160: TdxDBGridMaskColumn; dxDBGridMaskColumn161: TdxDBGridMaskColumn; dxDBGridMaskColumn162: TdxDBGridMaskColumn; dxDBGridColumn85: TdxDBGridColumn; dxDBGridColumn86: TdxDBGridColumn; dxDBGridMaskColumn163: TdxDBGridMaskColumn; dxDBGridColumn87: TdxDBGridColumn; dxDBGridDateColumn23: TdxDBGridDateColumn; dxDBGridDateColumn24: TdxDBGridDateColumn; dxDBGridMaskColumn164: TdxDBGridMaskColumn; dxDBGridMaskColumn165: TdxDBGridMaskColumn; dxDBGridMaskColumn166: TdxDBGridMaskColumn; dxDBGridColumn88: TdxDBGridColumn; dxDBGridColumn89: TdxDBGridColumn; dxDBGridMaskColumn167: TdxDBGridMaskColumn; dxDBGridMaskColumn168: TdxDBGridMaskColumn; dxDBGridMaskColumn169: TdxDBGridMaskColumn; dxDBGrid25: TdxDBGrid; dxDBGridColumn90: TdxDBGridColumn; dxDBGridMaskColumn170: TdxDBGridMaskColumn; dxDBGridColumn91: TdxDBGridColumn; dxDBGridColumn92: TdxDBGridColumn; dxDBGridColumn93: TdxDBGridColumn; dxDBGridColumn94: TdxDBGridColumn; bsSkinTabSheet14: TbsSkinTabSheet; dxDBGrid26: TdxDBGrid; dxDBGridMaskColumn171: TdxDBGridMaskColumn; dxDBGridMaskColumn172: TdxDBGridMaskColumn; dxDBGridMaskColumn173: TdxDBGridMaskColumn; dxDBGridMaskColumn174: TdxDBGridMaskColumn; dxDBGridMaskColumn175: TdxDBGridMaskColumn; dxDBGridColumn95: TdxDBGridColumn; dxDBGridColumn96: TdxDBGridColumn; dxDBGridMaskColumn176: TdxDBGridMaskColumn; dxDBGridColumn97: TdxDBGridColumn; dxDBGridDateColumn25: TdxDBGridDateColumn; dxDBGridDateColumn26: TdxDBGridDateColumn; dxDBGridMaskColumn177: TdxDBGridMaskColumn; dxDBGridMaskColumn178: TdxDBGridMaskColumn; dxDBGridMaskColumn179: TdxDBGridMaskColumn; dxDBGridColumn98: TdxDBGridColumn; dxDBGridColumn99: TdxDBGridColumn; dxDBGridMaskColumn180: TdxDBGridMaskColumn; dxDBGridMaskColumn181: TdxDBGridMaskColumn; dxDBGridMaskColumn182: TdxDBGridMaskColumn; dxDBGrid27: TdxDBGrid; dxDBGridColumn100: TdxDBGridColumn; dxDBGridMaskColumn183: TdxDBGridMaskColumn; dxDBGridColumn101: TdxDBGridColumn; dxDBGridColumn102: TdxDBGridColumn; dxDBGridColumn103: TdxDBGridColumn; dxDBGridColumn104: TdxDBGridColumn; t_ch_accept_shen: TADOQuery; acceptv_fee_do_airi_sum1: TDataSource; acceptv_fee_do_airi_sum: TADOQuery; Acceptv_fee_do_airi1: TDataSource; Acceptv_fee_do_airi: TADOQuery; t_ch_accept_shen1: TDataSource; acceptv_fee_do_aire: TADOQuery; acceptv_fee_do_aire1: TDataSource; acceptv_fee_do_aire_sum: TADOQuery; acceptv_fee_do_aire_sum1: TDataSource; acceptv_fee_do_seai: TADOQuery; acceptv_fee_do_seai1: TDataSource; acceptv_fee_do_seai_sum: TADOQuery; acceptv_fee_do_seai_sum1: TDataSource; acceptv_fee_do_seae: TADOQuery; acceptv_fee_do_seae1: TDataSource; acceptv_fee_do_seae_sum: TADOQuery; acceptv_fee_do_seae_sum1: TDataSource; t_ch_fee_do_accept: TADOQuery; bsSkinButton16: TbsSkinButton; dxDBGrid19Column13: TdxDBGridColumn; dxDBGrid1Column25: TdxDBGridColumn; dxDBGrid1Column26: TdxDBGridColumn; bsSkinPanel11: TbsSkinPanel; Label57: TLabel; Label59: TLabel; Label60: TLabel; Label61: TLabel; Label62: TLabel; Label63: TLabel; Label64: TLabel; Label65: TLabel; Label66: TLabel; Label67: TLabel; Label68: TLabel; Label69: TLabel; Label70: TLabel; Label71: TLabel; DBEdit42: TDBEdit; DBEdit45: TDBEdit; DBEdit47: TDBEdit; DBEdit48: TDBEdit; DBEdit49: TDBEdit; DBMemo6: TDBMemo; DBEdit50: TDBEdit; DBEdit51: TDBEdit; DBEdit52: TDBEdit; DBEdit53: TDBEdit; DBEdit54: TDBEdit; DBEdit55: TDBEdit; DBEdit56: TDBEdit; DBEdit57: TDBEdit; dxDBGrid19Column14: TdxDBGridColumn; dxDBGrid19Column15: TdxDBGridColumn; bsSkinPanel12: TbsSkinPanel; Label72: TLabel; Label73: TLabel; Label74: TLabel; Label75: TLabel; Label77: TLabel; Label78: TLabel; Label79: TLabel; Label80: TLabel; Label81: TLabel; Label82: TLabel; Label83: TLabel; Label84: TLabel; Label85: TLabel; Label86: TLabel; DBEdit58: TDBEdit; DBEdit59: TDBEdit; RxDBLookupCombo8: TRxDBLookupCombo; wwDBComboBox3: TwwDBComboBox; RxDBLookupCombo9: TRxDBLookupCombo; DBEdit60: TDBEdit; DBEdit61: TDBEdit; DBEdit62: TDBEdit; RxDBLookupCombo10: TRxDBLookupCombo; DBEdit63: TDBEdit; DBEdit64: TDBEdit; DBEdit65: TDBEdit; DBMemo7: TDBMemo; RxDBLookupCombo11: TRxDBLookupCombo; DBEdit66: TDBEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; DBEdit67: TDBEdit; Label87: TLabel; dxDBGrid1Column27: TdxDBGridColumn; dxDBGrid1Column28: TdxDBGridColumn; dxDBGrid6Column23: TdxDBGridColumn; dxDBGrid7Column23: TdxDBGridColumn; dxDBGrid8Column20: TdxDBGridColumn; dxDBGrid9Column20: TdxDBGridColumn; bsSkinButton38: TbsSkinButton; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo17: TRxDBLookupCombo; bsSkinPanel13: TbsSkinPanel; Label88: TLabel; Label89: TLabel; Label90: TLabel; Label91: TLabel; Label92: TLabel; Label93: TLabel; Label95: TLabel; Label96: TLabel; Label97: TLabel; Label98: TLabel; Label99: TLabel; Label94: TLabel; Label100: TLabel; DBEdit68: TDBEdit; DBEdit69: TDBEdit; RxDBLookupCombo12: TRxDBLookupCombo; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; DBEdit70: TDBEdit; DBEdit71: TDBEdit; DBEdit72: TDBEdit; DBEdit73: TDBEdit; DBEdit74: TDBEdit; DBMemo8: TDBMemo; wwDBComboBox4: TwwDBComboBox; RxDBLookupCombo14: TRxDBLookupCombo; wwDBDateTimePicker2: TwwDBDateTimePicker; DBEdit75: TDBEdit; RxDBLookupCombo13: TRxDBLookupCombo; RxDBLookupCombo15: TRxDBLookupCombo; RxDBLookupCombo16: TRxDBLookupCombo; p_update: TADOStoredProc; tab5: TbsSkinTabSheet; dxDBGrid28: TdxDBGrid; dxDBGridColumn105: TdxDBGridColumn; dxDBGridMaskColumn184: TdxDBGridMaskColumn; dxDBGridColumn106: TdxDBGridColumn; dxDBGridColumn107: TdxDBGridColumn; dxDBGridColumn108: TdxDBGridColumn; dxDBGridColumn109: TdxDBGridColumn; dxDBGrid29: TdxDBGrid; dxDBGridColumn110: TdxDBGridColumn; dxDBGridMaskColumn185: TdxDBGridMaskColumn; dxDBGridMaskColumn186: TdxDBGridMaskColumn; dxDBGridMaskColumn187: TdxDBGridMaskColumn; dxDBGridMaskColumn188: TdxDBGridMaskColumn; dxDBGridMaskColumn189: TdxDBGridMaskColumn; dxDBGridColumn111: TdxDBGridColumn; dxDBGridColumn112: TdxDBGridColumn; dxDBGridMaskColumn190: TdxDBGridMaskColumn; dxDBGridColumn113: TdxDBGridColumn; dxDBGrid9Column24: TdxDBGridColumn; dxDBGridDateColumn27: TdxDBGridDateColumn; dxDBGridDateColumn28: TdxDBGridDateColumn; dxDBGridMaskColumn191: TdxDBGridMaskColumn; dxDBGridMaskColumn192: TdxDBGridMaskColumn; dxDBGridMaskColumn193: TdxDBGridMaskColumn; dxDBGridMaskColumn194: TdxDBGridMaskColumn; dxDBGridMaskColumn195: TdxDBGridMaskColumn; dxDBGridColumn114: TdxDBGridColumn; dxDBGridColumn115: TdxDBGridColumn; dxDBGridMaskColumn196: TdxDBGridMaskColumn; dxDBGridMaskColumn197: TdxDBGridMaskColumn; dxDBGridMaskColumn198: TdxDBGridMaskColumn; dxDBGridMaskColumn199: TdxDBGridMaskColumn; Label101: TLabel; DBEdit76: TDBEdit; bskntbshtTbs3: TbsSkinTabSheet; t_ch_jinzhang: TADOQuery; t_ch_jinzhangDSDesigner: TStringField; t_ch_jinzhangDSDesigner13: TStringField; t_ch_jinzhangDSDesigner14: TStringField; t_ch_jinzhangDSDesigner2: TDateTimeField; t_ch_jinzhangDSDesigner3: TStringField; t_ch_jinzhangDSDesigner4: TStringField; t_ch_jinzhangDSDesigner5: TStringField; t_ch_jinzhangDSDesigner6: TStringField; t_ch_jinzhangDSDesigner7: TStringField; t_ch_jinzhangDSDesigner8: TStringField; t_ch_jinzhangDSDesigner9: TStringField; t_ch_jinzhangDSDesigner10: TBCDField; t_ch_jinzhangDSDesigner11: TStringField; t_ch_jinzhangDSDesigner12: TStringField; t_ch_jinzhangDSDesigner15: TStringField; t_ch_jinzhangDSDesigner16: TBooleanField; t_ch_jinzhangDSDesigner17: TStringField; t_ch_jinzhangDSDesigner18: TDateTimeField; t_ch_jinzhangDSDesigner19: TStringField; t_ch_jinzhangDSDesigner20: TBooleanField; t_ch_jinzhangDSDesigner21: TStringField; t_ch_jinzhangDSDesigner22: TBooleanField; t_ch_jinzhangDSDesigner23: TStringField; t_ch_jinzhangDSDesigner24: TDateTimeField; t_ch_jinzhangDSDesigner25: TStringField; t_ch_jinzhangDSDesigner26: TDateTimeField; t_ch_jinzhangDSDesigner27: TStringField; t_ch_jinzhangDSDesigner28: TStringField; t_ch_jinzhangDSDesigner29: TStringField; t_ch_jinzhangDSDesigner30: TStringField; t_ch_jinzhangDSDesigner31: TStringField; t_ch_jinzhangDSDesigner32: TStringField; t_ch_jinzhangDSDesigner33: TStringField; t_ch_jinzhangDSDesigner34: TStringField; t_ch_jinzhangDSDesigner35: TStringField; t_ch_jinzhangDSDesigner36: TStringField; t_ch_jinzhangDSDesigner37: TStringField; t_ch_jinzhangDSDesigner38: TStringField; t_ch_jinzhangDSDesigner39: TStringField; t_ch_jinzhangDSDesigner40: TStringField; t_ch_jinzhangDSDesigner41: TStringField; t_ch_jinzhangDSDesigner42: TStringField; t_ch_jinzhangDSDesigner43: TStringField; t_ch_jinzhangJZ_ID: TAutoIncField; t_ch_jinzhangDSDesigner44: TStringField; t_ch_jinzhangDSDesigner45: TStringField; t_ch_jinzhangDSDesigner46: TStringField; t_ch_jinzhang1: TDataSource; bsSkinPageControl5: TbsSkinPageControl; bsSkinTabSheet15: TbsSkinTabSheet; bsSkinPanel14: TbsSkinPanel; bsSkinButton17: TbsSkinButton; bsSkinButton18: TbsSkinButton; bsSkinButton19: TbsSkinButton; bsSkinButton20: TbsSkinButton; bsSkinButton22: TbsSkinButton; bsSkinButton23: TbsSkinButton; bsSkinButton26: TbsSkinButton; bsSkinButton27: TbsSkinButton; dxDBGrid30: TdxDBGrid; dxDBGridMaskColumn200: TdxDBGridMaskColumn; dxDBGridMaskColumn201: TdxDBGridMaskColumn; dxDBGridMaskColumn202: TdxDBGridMaskColumn; dxDBGridColumn116: TdxDBGridColumn; dxDBGridDateColumn29: TdxDBGridDateColumn; dxDBGridMaskColumn203: TdxDBGridMaskColumn; dxDBGridCheckColumn1: TdxDBGridCheckColumn; dxDBGridMaskColumn204: TdxDBGridMaskColumn; dxDBGridDateColumn30: TdxDBGridDateColumn; dxDBGridMaskColumn205: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridCheckColumn; dxDBGrid1Column29: TdxDBGridCheckColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGrid1Column36: TdxDBGridDateColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridMaskColumn; dxDBGrid1Column34: TdxDBGridDateColumn; bsSkinTabSheet16: TbsSkinTabSheet; bsSkinPanel15: TbsSkinPanel; bsSkinButton28: TbsSkinButton; bsSkinButton29: TbsSkinButton; bsSkinButton30: TbsSkinButton; bsSkinButton31: TbsSkinButton; bsSkinButton32: TbsSkinButton; bsSkinButton33: TbsSkinButton; bsSkinButton34: TbsSkinButton; bsSkinButton35: TbsSkinButton; bsSkinButton36: TbsSkinButton; ScrollBox1: TScrollBox; Label40: TLabel; Label102: TLabel; Label103: TLabel; Label104: TLabel; Shape3: TShape; AALabel2: TAALabel; Label105: TLabel; Label106: TLabel; Label107: TLabel; Label108: TLabel; Label109: TLabel; Label110: TLabel; Label111: TLabel; Label112: TLabel; Shape4: TShape; Label113: TLabel; sncCurrencyLabel2: TsncCurrencyLabel; Label114: TLabel; Label115: TLabel; DBText5: TDBText; DBText6: TDBText; DBText7: TDBText; DBText8: TDBText; Label116: TLabel; Label117: TLabel; Label118: TLabel; Label119: TLabel; Label120: TLabel; Label121: TLabel; bsSkinPanel16: TbsSkinPanel; Label122: TLabel; Label123: TLabel; DBEdit30: TDBEdit; DBEdit77: TDBEdit; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox; DBDateTimeEditEh1: TDBDateTimeEditEh; RxDBCalcEdit1: TRxDBCalcEdit; sncDBCurrencyEdit1: TsncDBCurrencyEdit; DBEdit78: TDBEdit; DBComboBox1: TDBComboBox; DBEdit79: TDBEdit; DBEdit80: TDBEdit; DBEdit81: TDBEdit; DBEdit82: TDBEdit; PopupMenu1: TPopupMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N20: TMenuItem; Label124: TLabel; RxDBLookupCombo20: TRxDBLookupCombo; dxDBGrid1Column37: TdxDBGridColumn; dxDBGrid1Column38: TdxDBGridColumn; dxDBGrid1Column39: TdxDBGridColumn; Label125: TLabel; RxDBLookupCombo21: TRxDBLookupCombo; DBEdit83: TDBEdit; DBEdit84: TDBEdit; t_ch_jinzhangDSDesigner47: TStringField; RxDBLookupCombo18: TRxDBLookupCombo; PopupMenu3: TPopupMenu; MenuItem1: TMenuItem; MenuItem2: TMenuItem; MenuItem3: TMenuItem; Label126: TLabel; tab6: TbsSkinTabSheet; bsSkinGroupBox2: TbsSkinGroupBox; dxDBGrid31: TdxDBGrid; dxDBGridMaskColumn206: TdxDBGridMaskColumn; dxDBGridMaskColumn207: TdxDBGridMaskColumn; dxDBGridMaskColumn208: TdxDBGridMaskColumn; dxDBGridMaskColumn209: TdxDBGridMaskColumn; dxDBGridColumn117: TdxDBGridColumn; dxDBGrid12Column6: TdxDBGridColumn; dxDBGrid12Column7: TdxDBGridColumn; bs_text: TEdit; bsSkinGroupBox1: TbsSkinGroupBox; dxDBGrid32: TdxDBGrid; dxDBGrid11Column1: TdxDBGridColumn; dxDBGrid11Column4: TdxDBGridColumn; dxDBGrid11Column2: TdxDBGridColumn; dxDBGrid11Column3: TdxDBGridColumn; t_ch_cust_befbal: TADOQuery; t_ch_cust_befbal1: TDataSource; t_ch_cust_befbalnew: TADOQuery; t_ch_cust_befbal_sum1: TDataSource; t_ch_cust_befbal_sum: TADOQuery; t_rate: TRxMemoryData; PopupMenu4: TPopupMenu; MenuItem4: TMenuItem; PopupMenu5: TPopupMenu; N7: TMenuItem; MenuItem5: TMenuItem; MenuItem6: TMenuItem; bsSkinPageControl6: TbsSkinPageControl; tab1: TbsSkinTabSheet; tab2: TbsSkinTabSheet; 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; Label127: TLabel; DBEdit86: TDBEdit; dxDBGrid1Column40: TdxDBGridColumn; DBEdit85: TDBEdit; PopupMenu6: TPopupMenu; N5: TMenuItem; N6: TMenuItem; N8: TMenuItem; bsSkinButton37: TbsSkinButton; dxDBGrid34Column5: TdxDBGridColumn; dxDBGrid33Column8: TdxDBGridColumn; dxDBGrid19Column16: TdxDBGridColumn; dbedt1: TDBEdit; lbl1: TLabel; dxdbgrdclmnDBGrid30Column19: TdxDBGridColumn; bsSkinTabSheet17: TbsSkinTabSheet; v_fee_do_bsCard: TADOQuery; v_fee_do_bsCard1: TDataSource; v_fee_do_bsCard_sum: TADOQuery; v_fee_do_bsCard_sum1: TDataSource; dxDBGrid35: TdxDBGrid; dxDBGridColumn125: TdxDBGridColumn; dxDBGridMaskColumn214: TdxDBGridMaskColumn; dxDBGridColumn126: TdxDBGridColumn; dxDBGridColumn127: TdxDBGridColumn; dxDBGridColumn128: TdxDBGridColumn; dxDBGridColumn129: TdxDBGridColumn; dxDBGrid36: TdxDBGrid; dxDBGridMaskColumn215: TdxDBGridMaskColumn; dxDBGridMaskColumn216: TdxDBGridMaskColumn; dxDBGridMaskColumn217: TdxDBGridMaskColumn; dxDBGridMaskColumn218: TdxDBGridMaskColumn; dxDBGridMaskColumn219: TdxDBGridMaskColumn; dxDBGridColumn130: TdxDBGridColumn; dxDBGridColumn131: TdxDBGridColumn; dxDBGridMaskColumn220: TdxDBGridMaskColumn; dxDBGridColumn132: TdxDBGridColumn; dxDBGridDateColumn31: TdxDBGridDateColumn; dxDBGridDateColumn32: TdxDBGridDateColumn; dxDBGridMaskColumn221: TdxDBGridMaskColumn; dxDBGridMaskColumn222: TdxDBGridMaskColumn; dxDBGridMaskColumn223: TdxDBGridMaskColumn; dxDBGridColumn133: TdxDBGridColumn; dxDBGridColumn134: TdxDBGridColumn; dxDBGridMaskColumn224: TdxDBGridMaskColumn; dxDBGridMaskColumn225: TdxDBGridMaskColumn; dxDBGridMaskColumn226: TdxDBGridMaskColumn; dxDBGridColumn135: TdxDBGridColumn; bsSkinTabSheet18: TbsSkinTabSheet; dxDBGrid37: TdxDBGrid; dxDBGridColumn136: TdxDBGridColumn; dxDBGridMaskColumn227: TdxDBGridMaskColumn; dxDBGridColumn137: TdxDBGridColumn; dxDBGridColumn138: TdxDBGridColumn; dxDBGridColumn139: TdxDBGridColumn; dxDBGridColumn140: TdxDBGridColumn; dxDBGrid38: TdxDBGrid; dxDBGridMaskColumn228: TdxDBGridMaskColumn; dxDBGridMaskColumn229: TdxDBGridMaskColumn; dxDBGridMaskColumn230: TdxDBGridMaskColumn; dxDBGridMaskColumn231: TdxDBGridMaskColumn; dxDBGridMaskColumn232: TdxDBGridMaskColumn; dxDBGridColumn141: TdxDBGridColumn; dxDBGridColumn142: TdxDBGridColumn; dxDBGridMaskColumn233: TdxDBGridMaskColumn; dxDBGridColumn143: TdxDBGridColumn; dxDBGridDateColumn33: TdxDBGridDateColumn; dxDBGridDateColumn34: TdxDBGridDateColumn; dxDBGridMaskColumn234: TdxDBGridMaskColumn; dxDBGridMaskColumn235: TdxDBGridMaskColumn; dxDBGridMaskColumn236: TdxDBGridMaskColumn; dxDBGridMaskColumn237: TdxDBGridMaskColumn; dxDBGridMaskColumn238: TdxDBGridMaskColumn; dxDBGridColumn144: TdxDBGridColumn; dxDBGridColumn145: TdxDBGridColumn; dxDBGridMaskColumn239: TdxDBGridMaskColumn; dxDBGridMaskColumn240: TdxDBGridMaskColumn; dxDBGridMaskColumn241: TdxDBGridMaskColumn; dxDBGridMaskColumn242: TdxDBGridMaskColumn; dxDBGrid36Column21: TdxDBGridColumn; dxDBGrid38Column23: TdxDBGridColumn; dxDBGrid36Column22: TdxDBGridColumn; dxDBGrid38Column24: TdxDBGridColumn; dxDBGrid1Column41: TdxDBGridColumn; Label128: TLabel; DBMemo9: TDBMemo; Panel2: TPanel; Label129: TLabel; Panel3: TPanel; Label130: TLabel; Label131: TLabel; DBEdit87: TDBEdit; Label132: TLabel; DBEdit88: TDBEdit; bsSkinButton39: 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_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; t_ch_balanceField: TFloatField; t_ch_balanceField2: TFloatField; dxDBGrid36Column23: TdxDBGridColumn; dxDBGrid36Column24: TdxDBGridColumn; bsSkinButton40: TbsSkinButton; t_ch_balanceDSDesigner18: TStringField; bsSkinButton41: TbsSkinButton; dxDBGrid1Column42: TdxDBGridColumn; t_ch_balanceDSDesigner34: TStringField; v_fee_do_bsCard_sum_ttl: TADOQuery; v_fee_do_bsCard_sum_ttl1: TDataSource; bsotherfee: TbsSkinTabSheet; Label133: TLabel; RxDBLookupCombo19: TRxDBLookupCombo; Label134: TLabel; DBEdit89: TDBEdit; Label135: TLabel; DBEdit90: TDBEdit; Label136: TLabel; DBEdit91: TDBEdit; t_ch_balanceDSDesigner35: TStringField; t_ch_balanceDSDesigner36: TBCDField; t_ch_balanceDSDesigner37: TBCDField; t_ch_balanceDSDesigner38: TBCDField; dxDBGrid1Column43: TdxDBGridColumn; dxDBGrid1Column44: TdxDBGridColumn; dxDBGrid1Column45: TdxDBGridColumn; Label137: TLabel; DBEdit92: TDBEdit; Label138: TLabel; DBEdit93: TDBEdit; RxDBLookupCombo22: TRxDBLookupCombo; Label139: TLabel; Label140: TLabel; Label141: TLabel; Label142: TLabel; RxDBLookupCombo24: TRxDBLookupCombo; Label143: TLabel; Label144: TLabel; DBEdit96: TDBEdit; t_ch_balanceDSDesigner39: TStringField; Label145: TLabel; DBMemo10: TDBMemo; dxDBGrid1Column46: TdxDBGridColumn; DBMemo11: TDBMemo; Label146: TLabel; pm1: TPopupMenu; MenuItem7: TMenuItem; MenuItem8: TMenuItem; MenuItem9: TMenuItem; t_ch_balanceSel: TADOQuery; t_ch_balanceSel1: TDataSource; lbl2: TLabel; dbmmo1: TDBMemo; lbl3: TLabel; t_ch_balanceDSDesigner40: TStringField; dxdbgrdclmnDBGrid1Column47: 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 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 DBEdit2Change(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton21Click(Sender: TObject); procedure bsSkinButton25Click(Sender: TObject); procedure bsSkinButton24Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure t_ch_balanceCalcFields(DataSet: TDataSet); procedure bsSkinButton38Click(Sender: TObject); procedure RxDBLookupCombo15Change(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure RxDBLookupCombo15Exit(Sender: TObject); procedure RxDBLookupCombo15Enter(Sender: TObject); procedure t_ch_balanceBeforeDelete(DataSet: TDataSet); procedure dxDBGrid6DblClick(Sender: TObject); procedure dxDBGrid7DblClick(Sender: TObject); procedure dxDBGrid8DblClick(Sender: TObject); procedure dxDBGrid9DblClick(Sender: TObject); procedure t_ch_jinzhangAfterInsert(DataSet: TDataSet); procedure t_ch_jinzhangBeforePost(DataSet: TDataSet); procedure N1Click(Sender: TObject); procedure bsSkinButton33Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); procedure bsSkinButton22Click(Sender: TObject); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton27Click(Sender: TObject); procedure bsSkinButton20Click(Sender: TObject); procedure dxDBGrid30DblClick(Sender: TObject); procedure bsSkinButton29Click(Sender: TObject); procedure bsSkinButton31Click(Sender: TObject); procedure bsSkinButton34Click(Sender: TObject); procedure bsSkinButton35Click(Sender: TObject); procedure bsSkinButton36Click(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure t_ch_jinzhangAfterOpen(DataSet: TDataSet); procedure bsSkinButton30Click(Sender: TObject); procedure bsSkinButton19Click(Sender: TObject); procedure RxDBLookupCombo3Change(Sender: TObject); procedure RxDBLookupCombo10Change(Sender: TObject); procedure RxDBLookupCombo6Change(Sender: TObject); procedure bsSkinButton28Click(Sender: TObject); procedure MenuItem1Click(Sender: TObject); procedure MenuItem3Click(Sender: TObject); procedure t_ch_jinzhangAfterScroll(DataSet: TDataSet); procedure MenuItem4Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure MenuItem6Click(Sender: TObject); procedure t_ch_cust_befbal_sumAfterOpen(DataSet: TDataSet); procedure N5Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure bsSkinButton37Click(Sender: TObject); procedure bsSkinNotebook1PageChanged(Sender: TObject); procedure fra_ch_add_do1MenuItem1Click(Sender: TObject); procedure dxDBGrid10SelectedCountChange(Sender: TObject); procedure dxDBGrid19SelectedCountChange(Sender: TObject); procedure bsSkinButton39Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton40Click(Sender: TObject); procedure dxDBGrid29DblClick(Sender: TObject); procedure dxDBGrid36DblClick(Sender: TObject); procedure dxDBGrid38DblClick(Sender: TObject); procedure RxDBLookupCombo19Change(Sender: TObject); procedure DBEdit89Exit(Sender: TObject); procedure MenuItem7Click(Sender: TObject); procedure MenuItem9Click(Sender: TObject); procedure RxDBLookupCombo24Change(Sender: TObject); private shench,isjinzhang,ischangecur:boolean; procedure jinzhangnumchange(sender:TField); procedure jinzhangdatechange(sender:TField); procedure jinzhangbankchange(sender:TField); procedure jinzhangcustchange(sender:TField); procedure jinzhangcurrchange(sender:TField); procedure getdetail(balno:string); procedure closedetail; { Private declarations } public { Public declarations } end; var ch_balance_accept_open,notdetail:boolean; frm_ch_balance_accept: Tfrm_ch_balance_accept; implementation uses u_main, my_sys_function, u_ch_balance_query, u_data_share, u_ch_invoice_do, u_ch_shen_query{$IFDEF SFLIUCHENG},u_ch_accept_do, u_ch_invoice_query, u_select_curr, u_ch_zhipiao_query, u_fee_do_fen, u_sys_progress, u_cw_pingzheng, dmAccu{$ENDIF}; {$R *.dfm} procedure Tfrm_ch_balance_accept.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_balance_accept.FormClose(Sender: TObject; var Action: TCloseAction); begin ch_balance_accept_open:=false; savereggrid(dxdbgrid1,caption+'1'); savereggrid(dxdbgrid10,caption+'10'); savereggrid(dxdbgrid6,caption+'6'); savereggrid(dxdbgrid7,caption+'7'); savereggrid(dxdbgrid8,caption+'8'); savereggrid(dxdbgrid9,caption+'9'); savereggrid(dxdbgrid30,caption+'30'); savereggrid(dxdbgrid35,caption+'35'); savereggrid(dxdbgrid36,caption+'36'); savereggrid(fra_ch_delete_do1.dxDBGrid9,caption+'9'); savereggrid(fra_ch_add_do1.dxDBGrid19,caption+'19'); savereggrid(fra_ch_add_do1.dxDBGrid17,caption+'17'); frm_ch_balance_accept.Hide; frm_ch_balance_accept.ManualFloat(frm_ch_balance_accept.BoundsRect ); frm_main.freeTabs('frm_ch_balance_accept'); action:=cafree; frm_ch_balance_accept:=nil; end; procedure Tfrm_ch_balance_accept.FormResize(Sender: TObject); var i:integer; begin if not isjinzhang then begin bsSkinButton12.Visible:=false; 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; bsSkinButton37.Width:=i; bsSkinButton39.Width:=i; end else begin bsSkinButton12.Visible:=true; i:=round(bsSkinPanel2.Width/14); 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; bsSkinButton37.Width:=i; bsSkinButton12.Width:=i; bsSkinButton39.Width:=i; end; end; procedure Tfrm_ch_balance_accept.FormShow(Sender: TObject); var i:integer; aQuery:TAdoQuery; rangstr:string; begin bsSkinNotebook1.PageIndex:=0; if if_reg(449) and (not vold) then isjinzhang:=true else isjinzhang:=false; ischangecur:=true; if not isjinzhang then bskntbshtTBS3.TabVisible:=false; shench:=false; if not isjinzhang then begin bsSkinButton12.Visible:=false; i:=round(bsSkinPanel2.Width/14); 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; bsSkinButton37.Width:=i; bsSkinButton1.Width:=i; end else begin bsSkinButton12.Visible:=true; i:=round(bsSkinPanel2.Width/15); 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; bsSkinButton12.Width:=i; bsSkinButton37.Width:=i; bsSkinButton1.Width:=i; end; ch_balance_accept_open:=true; notdetail:=true; t_ch_balance.Close; t_ch_balance.SQL.clear; t_ch_balance.SQL.Add('select top 100 * from t_ch_balance where 帐单状态<>'+''''+'审核通过'+'''' +' and 类型='+''''+'收'+'''' +' and '+open_data('1003','结算人','no','no','no','no') +' order by 帐单编号 desc'); t_ch_balance.open; t_ch_invoice_shen.close; t_ch_invoice_shen.sql.Clear; t_ch_invoice_shen.sql.Add('SELECT * FROM t_ch_invoice where 1=1 '); t_ch_invoice_shen.sql.Add(' and (是否收费=0 or 是否收费 is null) and 申请编号<>'''' '); rangstr:=open_data('1001','申请人','制单人','no','no','no'); if (rangstr<>'') then t_ch_invoice_shen.sql.Add(' and '+rangstr ); t_ch_invoice_shen.sql.Add(' and not EXISTS (select 1 from t_ch_fee_do left JOIN t_ch_fee ON t_ch_fee.CH_ID = t_ch_fee_do.CH_ID '); t_ch_invoice_shen.sql.Add(' where t_ch_fee_do.工作编号=t_ch_invoice.申请编号'); t_ch_invoice_shen.sql.Add(' and t_ch_fee_do.原始金额>(t_ch_fee.金额 - t_ch_fee.结算金额)'); t_ch_invoice_shen.sql.Add('AND t_ch_fee_do.类型 in (''1'', ''7''))'); t_ch_invoice_shen.sql.Add(' and EXISTS (select 1 from t_ch_fee_do '); t_ch_invoice_shen.sql.Add(' where t_ch_fee_do.工作编号=t_ch_invoice.申请编号'); t_ch_invoice_shen.sql.Add('AND t_ch_fee_do.类型 in (''1'', ''7''))'); t_ch_invoice_shen.sql.Add('order by 申请编号'); { t_ch_invoice_shen.close; t_ch_invoice_shen.sql.Clear; t_ch_invoice_shen.sql.Add('SELECT DISTINCT COL1 = T_CH_FEE_DO1.工作编号 INTO #TEMP1'); t_ch_invoice_shen.sql.Add(' FROM t_ch_fee_do T_CH_FEE_DO1'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO1.类型 in (''1'', ''7'') '); t_ch_invoice_shen.sql.Add('GROUP BY T_CH_FEE_DO1.工作编号'); t_ch_invoice_shen.sql.Add('SELECT t_ch_invoice.* '); t_ch_invoice_shen.sql.Add('FROM #TEMP1'); t_ch_invoice_shen.sql.Add('left join t_ch_invoice on (是否收费=0 or 是否收费 is null) and 申请编号 = #TEMP1.COL1'); t_ch_invoice_shen.sql.Add('where 1 = 1'); rangstr:=open_data('1001','申请人','制单人','no','no','no'); if (rangstr<>'') then t_ch_invoice_shen.sql.Add(' and '+rangstr ); t_ch_invoice_shen.sql.Add('and 申请编号 NOT IN (SELECT DISTINCT T_CH_FEE_DO2.工作编号'); t_ch_invoice_shen.sql.Add('FROM t_ch_fee_do T_CH_FEE_DO2'); t_ch_invoice_shen.sql.Add('left JOIN t_ch_fee ON t_ch_fee.CH_ID = T_CH_FEE_DO2.CH_ID'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO2.原始金额 > (t_ch_fee.金额 - t_ch_fee.结算金额)'); t_ch_invoice_shen.sql.Add('AND T_CH_FEE_DO2.类型 in (''1'', ''7''))'); t_ch_invoice_shen.sql.Add('order by 申请编号'); t_ch_invoice_shen.sql.Add('DROP TABLE #TEMP1'); } { t_ch_invoice_shen.close; t_ch_invoice_shen.sql.Clear; t_ch_invoice_shen.sql.Add('SELECT DISTINCT COL1 = T_CH_FEE_DO1.工作编号 INTO #TEMP1'); t_ch_invoice_shen.sql.Add(' FROM t_ch_fee_do T_CH_FEE_DO1'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO1.类型 in (''1'', ''7'') '); t_ch_invoice_shen.sql.Add('GROUP BY T_CH_FEE_DO1.工作编号'); t_ch_invoice_shen.sql.Add('SELECT t_ch_invoice.* FROM #TEMP1,t_ch_invoice'); t_ch_invoice_shen.sql.Add('where 1 = 1 and (是否收费=0 or 是否收费 is null) and 申请编号 = #TEMP1.COL1'); t_ch_invoice_shen.sql.Add('and 申请编号 NOT IN (SELECT DISTINCT T_CH_FEE_DO2.工作编号'); t_ch_invoice_shen.sql.Add('FROM t_ch_fee_do T_CH_FEE_DO2'); t_ch_invoice_shen.sql.Add('left JOIN t_ch_fee ON t_ch_fee.CH_ID = T_CH_FEE_DO2.CH_ID'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO2.原始金额 > (t_ch_fee.金额 - t_ch_fee.结算金额)'); t_ch_invoice_shen.sql.Add('AND T_CH_FEE_DO2.类型 in (''1'', ''7''))'); t_ch_invoice_shen.sql.Add('order by 申请编号'); t_ch_invoice_shen.sql.Add('DROP TABLE #TEMP1'); } // t_ch_invoice_shen.open; { t_ch_fee_do_invoice.open; v_fee_do_seae.Open; v_fee_do_seai.open; v_fee_do_aire.open; v_fee_do_airi.open; v_fee_do_seae_sum.Open; v_fee_do_seai_sum.open; v_fee_do_aire_sum.open; v_fee_do_airi_sum.open; } t_ch_accept_shen.close; t_ch_accept_shen.sql.Clear; t_ch_accept_shen.sql.Add('SELECT * FROM t_ch_accept where '); t_ch_accept_shen.sql.Add(open_data('1003','申请人','no','no','no','no')); t_ch_accept_shen.sql.Add(' and (申请编号 NOT IN (SELECT DISTINCT t_ch_fee_do.工作编号 FROM t_ch_fee_do INNER JOIN '); t_ch_accept_shen.sql.Add('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_accept_shen.sql.Add('t_ch_fee_do.类型 = ''6'')) AND (申请状态 = ''提交申请'') '); t_ch_accept_shen.sql.Add('order by 申请编号 '); // t_ch_accept_shen.open; { t_ch_fee_do_accept.open; acceptv_fee_do_seae.Open; acceptv_fee_do_seai.open; acceptv_fee_do_aire.open; acceptv_fee_do_airi.open; acceptv_fee_do_seae_sum.Open; acceptv_fee_do_seai_sum.open; acceptv_fee_do_aire_sum.open; acceptv_fee_do_airi_sum.open; } { fra_ch_add_do1.bsSkinTabSheet1.Visible:=false; fra_ch_add_do1.bsSkinTabSheet2.Visible:=false; fra_ch_add_do1.bsSkinTabSheet3.Visible:=false; fra_ch_add_do1.bsSkinTabSheet4.Visible:=false; } 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_add_do1.do_ban_fee1.DataSet:=fra_ch_delete_do1.v_fee_do_bscard; 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; 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_add_do1.bsSkinCheckRadioBox7.Visible:=True; 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; fra_ch_add_do1.do_ban_fee1.DataSet:=fra_ch_delete_do1.v_fee_do_seae; end; fra_ch_add_do1.do_ban1.DataSet:=t_ch_balance; fra_ch_add_do1.bs_text.text:='3'; fra_ch_add_do1.wwDBComboBox31.text:='收'; fra_ch_add_do1.t_ch_fee_do.open; if StrToBool(get_parameters_value(85,'false')) then begin bsSkinTabSheet6.TabVisible:=false; bsSkinTabSheet5.TabVisible:=false; bsSkinTabSheet4.TabVisible:=false; bsSkinTabSheet3.TabVisible:=false; bsSkinPageControl2.ActivePage:=Tab5; Tab5.TabVisible:=true; end else begin bsSkinPageControl2.ActivePage:=bsSkinTabSheet3; bsSkinTabSheet3.TabVisible:=true; bsSkinTabSheet4.TabVisible:=true; bsSkinTabSheet5.TabVisible:=true; bsSkinTabSheet6.TabVisible:=true; Tab5.TabVisible:=false; end; { if StrToBool(get_parameters_value(85,'false')) then begin 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 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_bscard.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_bscard.Open; 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 工作编号=:帐单编号 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.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_bscard_sum.Open; end else begin fra_ch_delete_do1.v_fee_do_seae.SQL.clear; fra_ch_delete_do1.v_fee_do_seae.sql.add('select * from v_fee_do_seae ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seae.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seae.Open; fra_ch_delete_do1.v_fee_do_seai.SQL.clear; fra_ch_delete_do1.v_fee_do_seai.sql.add('select * from v_fee_do_seai ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_seai.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seai.Open; fra_ch_delete_do1.v_fee_do_aire.SQL.clear; fra_ch_delete_do1.v_fee_do_aire.sql.add('select * from v_fee_do_aire ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_aire.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_aire.Open; fra_ch_delete_do1.v_fee_do_airi.SQL.clear; fra_ch_delete_do1.v_fee_do_airi.sql.add('select * from v_fee_do_airi ' +'where 工作编号=:帐单编号 order by 类型,编号,费用名称'); fra_ch_delete_do1.v_fee_do_airi.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_airi.Open; fra_ch_delete_do1.v_fee_do_seae_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_seae_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_seae ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),开船日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),开船日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_seae_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seae_sum.Open; fra_ch_delete_do1.v_fee_do_seai_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_seai_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_seai ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_seai_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_seai_sum.Open; fra_ch_delete_do1.v_fee_do_aire_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_aire_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),开航日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_aire ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),开航日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),开航日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_aire_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_aire_sum.Open; fra_ch_delete_do1.v_fee_do_airi_sum.SQL.clear; fra_ch_delete_do1.v_fee_do_airi_sum.sql.add('select 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7) AS 月份,揽货人,原始币别,sum(原始金额) as 原始金额,sum(金额) as 金额 from v_fee_do_airi ' +'where 工作编号=:帐单编号 group by 类型,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),揽货人,原始币别 ' +'order by 类型,揽货人,SUBSTRING(CONVERT(char(15),进口日期,111),1,7),原始币别'); fra_ch_delete_do1.v_fee_do_airi_sum.DataSource:=t_ch_balance1; fra_ch_delete_do1.v_fee_do_airi_sum.Open; end; } fra_ch_delete_do1.bs_text.Text:='3'; fra_ch_delete_do1.do_ban1.DataSet:=t_ch_balance; frm_data_share.t_crm_client_all.requery; frm_data_share.t_code_currency.requery; frm_data_share.t_sys_bank.requery; loadreggrid(dxdbgrid1,false,caption+'1'); loadreggrid(dxdbgrid10,false,caption+'10'); loadreggrid(dxdbgrid6,false,caption+'6'); loadreggrid(dxdbgrid7,false,caption+'7'); loadreggrid(dxdbgrid8,false,caption+'8'); loadreggrid(dxdbgrid9,false,caption+'9'); loadreggrid(dxdbgrid30,false,caption+'30'); loadreggrid(dxDBGrid35,false,caption+'35'); loadreggrid(dxDBGrid36,false,caption+'36'); loadreggrid(fra_ch_delete_do1.dxDBGrid9,false,caption+'9'); loadreggrid(fra_ch_add_do1.dxDBGrid19,false,caption+'19'); loadreggrid(fra_ch_add_do1.dxDBGrid17,false,caption+'17'); if StrToBool(get_parameters_value(83,'false')) 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; dxdbgrid19.ColumnByFieldName('申请金额').Visible:=False; dxdbgrid19.ColumnByFieldName('实际金额').Visible:=false; dxdbgrid19.ColumnByFieldName('虚开金额').Visible:=False; dxdbgrid19.ColumnByFieldName('美元金额').Visible:=True; dxdbgrid19.ColumnByFieldName('人民币金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元结算金额').Visible:=false; dxdbgrid1.ColumnByFieldName('人民币结算金额').Visible:=false; fra_ch_add_do1.bsSkinPanel12.Visible:=true; bsSkinPanel11.Visible:=True; bsSkinPanel12.Visible:=TRUE; bsSkinPanel13.Visible:=TRUE; bsotherfee.TabVisible:=False; end else begin dxdbgrid1.ColumnByFieldName('币别').Visible:=True; dxdbgrid1.ColumnByFieldName('结算金额').Visible:=True; dxdbgrid1.ColumnByFieldName('实结金额').Visible:=True; dxdbgrid1.ColumnByFieldName('虚结金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元金额').Visible:=False; dxdbgrid1.ColumnByFieldName('人民币金额').Visible:=False; dxdbgrid19.ColumnByFieldName('申请金额').Visible:=True; dxdbgrid19.ColumnByFieldName('实际金额').Visible:=True; dxdbgrid19.ColumnByFieldName('虚开金额').Visible:=True; dxdbgrid19.ColumnByFieldName('美元金额').Visible:=false; dxdbgrid19.ColumnByFieldName('人民币金额').Visible:=False; dxdbgrid1.ColumnByFieldName('美元结算金额').Visible:=true; dxdbgrid1.ColumnByFieldName('人民币结算金额').Visible:=true; fra_ch_add_do1.bsSkinPanel12.Visible:=false; bsSkinPanel11.Visible:=False; bsSkinPanel12.Visible:=False; bsSkinPanel13.Visible:=False; bsotherfee.TabVisible:=true; end; wwDBDateTimePicker1.MinDate:=Logininfo.endday+1; wwDBDateTimePicker2.MinDate:=Logininfo.endday+1; with frm_data_share.t_code_stlmode do begin wwDBComboBox1.Items.Clear; wwDBComboBox2.Items.Clear; wwDBComboBox3.Items.Clear; wwDBComboBox4.Items.Clear; first; while not eof do begin wwDBComboBox1.Items.Add(fieldbyname('结算方式').AsString); wwDBComboBox2.Items.Add(fieldbyname('结算方式').AsString); wwDBComboBox3.Items.Add(fieldbyname('结算方式').AsString); wwDBComboBox4.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; // tab2.TabVisible:=true; // tab6.TabVisible:=true; // bsSkinButton1.Enabled:=not t_ch_balance.FieldByName('凭证').AsBoolean; {$IFDEF SFLIUCHENG} {$ELSE} bsSkinTabSheet111.TabVisible:=false; {$ENDIF} { // 结算权限 if not if_open('215') then begin bsSkinButton1.Enabled:=false; bsSkinButton12.Enabled:=false; bsSkinButton2.Enabled:=false; bsSkinButton4.Enabled:=false; bsSkinButton3.Enabled:=false; bsSkinButton11.Enabled:=false; bsSkinButton6.Enabled:=false; bsSkinButton8.Enabled:=false; bsSkinButton25.Enabled:=false; end; } // v_fee_do_bsCard_sum_ttl.Close; //v_fee_do_bsCard_sum_ttl.Open; if bsSkinNotebook1.PageIndex<>0 then getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); end; procedure Tfrm_ch_balance_accept.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin if t_ch_balance.IsEmpty then exit; if DBEdit2.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_accept.t_ch_balanceAfterInsert( DataSet: TDataSet); var sdate:tdate; balno:string; begin t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算人']:=employee; sdate:=EncodeDate(Logininfo.offyear,Logininfo.offmonth,1); if sdate>now then t_ch_balance['结算日期']:=sdate else t_ch_balance['结算日期']:=date; 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['人民币金额']:=0; t_ch_balance['类型']:='收'; t_ch_balance['结算类别']:='自由'; t_ch_balance['财务']:=0; t_ch_balance['结算方式']:='支票'; { balno:=get_no(date,'BA'); t_ch_balance['帐单编号']:=balno; getdetail(balno); } end; procedure Tfrm_ch_balance_accept.bsSkinButton2Click(Sender: TObject); begin table_post(t_ch_balance); end; procedure Tfrm_ch_balance_accept.bsSkinButton4Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if (t_ch_balance.FieldByName('结算类别').asstring='流程')then begin showmessage('当前帐单为流程帐单不允许删除!!'); exit; end; if (t_ch_balance.FieldByName('帐单状态').asstring='审核通过')then begin showmessage('当前业务操作的状态不允许删除!!'); exit; end; if t_ch_balance.FieldByName('财务').AsBoolean 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 if (t_ch_balance.FieldByName('结算类别').asstring='申请')then begin p_update.Parameters.ParamByName('SQLStr').value:='update t_ch_accept set 申请状态=' +''''+'提交申请'+''''+',帐单编号='+''''+'''' +' where 帐单编号='+'''' +t_ch_balance.FieldByName('帐单编号').asstring+''''; p_update.ExecProc; end; if (t_ch_balance.FieldByName('结算类别').asstring='发票')then begin p_update.Parameters.ParamByName('SQLStr').value:='update t_ch_invoice set 是否收费=0' +',帐单编号='+''''+'''' +' where 帐单编号='+'''' +t_ch_balance.FieldByName('帐单编号').asstring+''''; p_update.ExecProc; end; if trim(t_ch_balance.fieldbyname('发票号码').asstring)<>'' then UpdateInvoiceStatus(trim(t_ch_balance.fieldbyname('发票号码').asstring),0); delete_ch(3,t_ch_balance); t_ch_fee_do_detail.close; t_ch_fee_do_detail.sql.text:='select * from t_ch_fee_do where 工作编号='''+t_ch_balance.fieldbyname('帐单编号').AsString+''''; t_ch_fee_do_detail.open; frm_sys_progress.bsSkinGauge1.MaxValue:=t_ch_fee_do_detail.RecordCount+2; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; while not t_ch_fee_do_detail.eof do begin Setfee(1,t_ch_fee_do_detail.fieldbyname('CH_ID').AsInteger,t_ch_fee_do_detail.fieldbyname('原始金额').AsCurrency); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_ch_fee_do_detail.delete; end; 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; t_ch_fee_do_detail.close; t_ch_balance.Delete; if bsSkinNotebook1.PageIndex<>0 then getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); if t_ch_invoice_shen.active then begin t_ch_invoice_shen.close; t_ch_invoice_shen.open; end; if t_ch_accept_shen.Active then t_ch_accept_shen.requery; 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_accept.bsSkinButton3Click(Sender: TObject); begin table_cancel(t_ch_balance); end; procedure Tfrm_ch_balance_accept.t_ch_balanceBeforePost(DataSet: TDataSet); var aAdoQuery:TAdoQuery; s,swt:string; begin table_before_post(t_ch_balance,'客户名称'); if not StrToBool(get_parameters_value(83,'false')) 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['美元金额']); 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 end; if (t_ch_balance.state=dsinsert) and (trim(t_ch_balance.FieldByName('帐单编号').AsString)='') then begin t_ch_balance['帐单编号']:=get_no(date,'BA'); getdetail(t_ch_balance['帐单编号']); end; t_ch_balance['帐单状态']:=t_ch_balance['帐单状态']; t_ch_balance['虚结金额']:=t_ch_balance['结算金额']+t_ch_balance['预结金额']-t_ch_balance['实结金额']; aAdoQuery:=CreateAdoQuery; with aAdoQuery do try close; SQL.clear; sql.add('select top 2 委托编号,主提单号'); sql.Add('from v_fee_do_bscard '); sql.Add('where 工作编号=:工作编号 '); Parameters.ParamByName('工作编号').Value:=t_ch_balance.FieldByName('帐单编号').asstring; Open;First; while not Eof do begin s:=FieldByName('委托编号').AsString+' '+FieldByName('主提单号').AsString; swt:=swt+FieldByName('委托编号').AsString+' '; next; end; t_ch_balance.FieldByName('业务参考号').value:=s; t_ch_balance.FieldByName('委托编号').value:=swt; finally Free; end; end; procedure Tfrm_ch_balance_accept.DBEdit4Enter(Sender: TObject); begin if bsSkinDBCheckRadioBox1.Checked then DBEdit4.ReadOnly:=true else DBEdit4.ReadOnly:=false; end; procedure Tfrm_ch_balance_accept.t_ch_balanceBeforeEdit(DataSet: TDataSet); var sdate:tdate; begin if not modify_all then begin if (t_ch_balance.FieldByName('帐单状态').asstring='审核通过')then begin showmessage('当前业务操作的状态不允许更改'); abort; end; end; sdate:=Logininfo.endday+1; if not t_ch_balance.FieldByName('结算日期').IsNull then begin if (sdate>t_ch_balance['结算日期']) and (not shench) then begin MessageDlg('此票结算单已月末结账,如果删除请先反结账!',mtError,[mbok],0); abort; end; end; end; procedure Tfrm_ch_balance_accept.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; RxDBLookupCombo12.ReadOnly:=false; end else begin RxDBLookupCombo1.ReadOnly:=true; RxDBLookupCombo2.ReadOnly:=true; RxDBLookupCombo12.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; RxDBLookupCombo12.ReadOnly:=false; end else begin RxDBLookupCombo1.ReadOnly:=true; RxDBLookupCombo2.ReadOnly:=true; RxDBLookupCombo12.ReadOnly:=true; end; end; end; procedure Tfrm_ch_balance_accept.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_accept.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_accept.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose:=frm_close_query(t_ch_balance); end; procedure Tfrm_ch_balance_accept.bsSkinButton9Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height)); pm1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept.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_accept.bsSkinButton8Click(Sender: TObject); begin if t_ch_balance.IsEmpty then exit; if (t_ch_balance.FieldByName('结算类别').asstring='流程')then begin showmessage('当前帐单为流程帐单不允许操作!!'); exit; end; if not if_open('255') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_ch_balance.FieldByName('帐单状态').asstring='录入状态'then begin showmessage('帐单没有必要取消审核!!'); end else begin try if t_ch_balance.State in [dsedit,dsinsert] then t_ch_balance.post; t_ch_balance.Refresh; modify_all:=true; shench:=true; t_ch_balance.edit; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance.post; modify_all:=false; except shench:=false; modify_all:=false; showmessage('审核失败!!'); end; t_ch_balance.Refresh; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton10Click(Sender: TObject); begin try frm_ch_balance_query:=tfrm_ch_balance_query.Create (self); balance_query_type:=3; frm_ch_balance_query.ShowModal; bsSkinNotebook1.PageIndex:=0; finally frm_ch_balance_query.Free; end; end; procedure Tfrm_ch_balance_accept.t_ch_balanceAfterPost(DataSet: TDataSet); begin t_ch_balance.Refresh; if StrToBool(get_parameters_value(85,'false')) then begin if fra_ch_delete_do1.v_fee_do_bscard.Active 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; end; // fra_ch_add_do1.t_ch_fee.Requery(); // fra_ch_add_do1.t_ch_fee_sum.Requery(); delete_do_type_num:=0; if_ch_delete_do:=false; // t_ch_balance.Refresh; end; procedure Tfrm_ch_balance_accept.t_ch_balanceAfterDelete( DataSet: TDataSet); begin if StrToBool(get_parameters_value(85,'false')) then begin if fra_ch_add_do1.v_op_bscard.Active then fra_ch_add_do1.v_op_bscard.Requery(); end else begin 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; end; procedure Tfrm_ch_balance_accept.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit1); end; procedure Tfrm_ch_balance_accept.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox1); end; procedure Tfrm_ch_balance_accept.wwDBComboBox1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_ch_balance_accept.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit5); end; procedure Tfrm_ch_balance_accept.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit6); end; procedure Tfrm_ch_balance_accept.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox1); end; procedure Tfrm_ch_balance_accept.bsSkinDBCheckRadioBox1KeyPress( Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo3); end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit8); end; procedure Tfrm_ch_balance_accept.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit9); end; procedure Tfrm_ch_balance_accept.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit10); end; procedure Tfrm_ch_balance_accept.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo1); end; procedure Tfrm_ch_balance_accept.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_ch_balance_accept.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_ch_balance_accept.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,2); end; procedure Tfrm_ch_balance_accept.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_ch_balance_accept.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_ch_balance,'帐单编号'); end; procedure Tfrm_ch_balance_accept.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; t_ch_balance['银行代码']:=frm_data_share.t_sys_bank.fieldbyname('代码').asstring; end; end; end; end; procedure Tfrm_ch_balance_accept.DBEdit2Change(Sender: TObject); begin if bsSkinNotebook1.PageIndex<>0 then begin if DBEdit2.text='自由'then begin bsSkinNotebook1.PageIndex:=1; end else begin bsSkinNotebook1.PageIndex:=2; end; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton7Click(Sender: TObject); begin t_ch_invoice_shen.close; t_ch_invoice_shen.sql.Clear; t_ch_invoice_shen.sql.Add('SELECT DISTINCT COL1 = T_CH_FEE_DO1.工作编号 INTO #TEMP1'); t_ch_invoice_shen.sql.Add(' FROM t_ch_fee_do T_CH_FEE_DO1'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO1.类型 in (''1'', ''7'') '); t_ch_invoice_shen.sql.Add('GROUP BY T_CH_FEE_DO1.工作编号'); t_ch_invoice_shen.sql.Add('SELECT t_ch_invoice.* FROM #TEMP1,t_ch_invoice'); t_ch_invoice_shen.sql.Add('where 1 = 1 and (是否收费=0 or 是否收费 is null) and 申请编号 = #TEMP1.COL1'); t_ch_invoice_shen.sql.Add('and 申请编号 NOT IN (SELECT DISTINCT T_CH_FEE_DO2.工作编号'); t_ch_invoice_shen.sql.Add('FROM t_ch_fee_do T_CH_FEE_DO2'); t_ch_invoice_shen.sql.Add('left JOIN t_ch_fee ON t_ch_fee.CH_ID = T_CH_FEE_DO2.CH_ID'); t_ch_invoice_shen.sql.Add('where T_CH_FEE_DO2.原始金额 > (t_ch_fee.金额 - t_ch_fee.结算金额)'); t_ch_invoice_shen.sql.Add('AND T_CH_FEE_DO2.类型 in (''1'', ''7''))'); t_ch_invoice_shen.sql.Add('order by 申请编号'); t_ch_invoice_shen.sql.Add('DROP TABLE #TEMP1'); t_ch_invoice_shen.open; end; procedure Tfrm_ch_balance_accept.bsSkinButton21Click(Sender: TObject); begin close; end; procedure Tfrm_ch_balance_accept.bsSkinButton25Click(Sender: TObject); var sdate:tdate; aList:TStringList; i:integer; Invnos,billnos:string; begin if t_ch_invoice_shen.IsEmpty then exit; { if (t_ch_invoice_shen.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; aList.Clear; Invnos:=''; billnos:=''; try t_ch_invoice_shen.DisableControls; t_ch_fee_do_invoice.DisableControls; if dxDBGrid10.SelectedCount>0 then begin for i:=0 to dxDBGrid10.SelectedCount-1 do begin t_ch_invoice_shen.GotoBookmark(pointer(dxDBGrid10.selectedrows[i])); if aList.IndexOf(t_ch_invoice_shen['客户名称'])<0 then aList.Add(t_ch_invoice_shen['客户名称']); if Invnos='' then Invnos:=t_ch_invoice_shen.fieldbyname('发票号码').asstring else Invnos:=Invnos+','+t_ch_invoice_shen.fieldbyname('发票号码').asstring; if billnos='' then billnos:=t_ch_invoice_shen.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_invoice_shen.fieldbyname('申请编号').asstring; end; if aList.Count>1 then begin showmessage('不相同的客户不能同时结算:'+#13#10+aList.Text); exit; end; end else begin aList.Add(t_ch_invoice_shen['客户名称']); if Invnos='' then Invnos:=t_ch_invoice_shen.fieldbyname('发票号码').asstring else Invnos:=Invnos+','+t_ch_invoice_shen.fieldbyname('发票号码').asstring; if billnos='' then billnos:=t_ch_invoice_shen.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_invoice_shen.fieldbyname('申请编号').asstring; if aList.Count>1 then begin showmessage('没有需要结算的信息:'+#13#10+aList.Text); exit; end; end; finally aList.free; t_ch_invoice_shen.EnableControls; t_ch_fee_do_invoice.EnableControls; end; try frm_ch_invoice_do:=tfrm_ch_invoice_do.Create (self); frm_ch_invoice_do.Memo1.text:='发票号码:'+Invnos+',申请编号:'+billnos+' '+t_ch_invoice_shen.fieldbyname('备注').asstring; frm_ch_invoice_do.ShowModal; finally frm_ch_invoice_do.Free; frm_ch_invoice_do:=nil; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton24Click(Sender: TObject); begin try frm_ch_invoice_query:=tfrm_ch_invoice_query.Create (self); inv_query_type:=7; inv_query_limited:='1003'; inv_query_op_limited:='no'; frm_ch_invoice_query.ShowModal; frm_ch_invoice_query.shen_query_limited:='1001'; finally frm_ch_invoice_query.Free; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton12Click(Sender: TObject); var afield : variant; i: Integer; begin t_ch_jinzhang.close; t_ch_jinzhang.sql.clear; t_ch_jinzhang.sql.add('select top 50 * from t_ch_jinzhang order by 开票日期 desc'); t_ch_jinzhang.open; if StrToBool(get_parameters_value(83,'false')) 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_jinzhang.Insert; t_ch_jinzhang['票据金额']:=t_ch_balance['人民币金额']; t_ch_jinzhang['币别']:='RMB'; t_ch_jinzhang['客户名称']:=t_ch_balance['客户名称'] ; t_ch_jinzhang['银行代码']:=t_ch_balance['银行代码'] ; t_ch_jinzhang.Post; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; end else begin t_ch_jinzhang.Insert; t_ch_jinzhang['票据金额']:=t_ch_balance['美元金额']; t_ch_jinzhang['币别']:='USD'; t_ch_jinzhang['客户名称']:=t_ch_balance['客户名称'] ; t_ch_jinzhang['银行代码']:=t_ch_balance['美元银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl5.ActivePage:=bsSkinTabSheet15; t_ch_jinzhang.Post; end; end; finally freeandnil(frm_select_curr); end; end else if (t_ch_balance.FieldByName('美元金额').AsFloat<>0) then begin t_ch_jinzhang.Insert; t_ch_jinzhang['票据金额']:=t_ch_balance['美元金额']; t_ch_jinzhang['币别']:='USD'; t_ch_jinzhang['客户名称']:=t_ch_balance['客户名称'] ; t_ch_jinzhang['银行代码']:=t_ch_balance['美元银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; t_ch_jinzhang.Post; end else if (t_ch_balance.FieldByName('人民币金额').AsFloat<>0) then begin t_ch_jinzhang.Insert; t_ch_jinzhang['票据金额']:=t_ch_balance['人民币金额']; t_ch_jinzhang['币别']:='RMB'; t_ch_jinzhang['客户名称']:=t_ch_balance['客户名称'] ; t_ch_jinzhang['银行代码']:=t_ch_balance['银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; t_ch_jinzhang.Post; end; end else begin t_ch_jinzhang.Insert; t_ch_jinzhang['票据金额']:=t_ch_balance['结算金额']; t_ch_jinzhang['币别']:=t_ch_balance['币别']; t_ch_jinzhang['客户名称']:=t_ch_balance['客户名称'] ; t_ch_jinzhang['银行代码']:=t_ch_balance['银行代码'] ; bsSkinPageControl1.ActivePage:=bskntbshtTBS3; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; t_ch_jinzhang.Post; end; { if t_ch_balance.IsEmpty then exit; try afield := vararraycreate([0,t_ch_balance.fieldcount-1],varvariant); for i := 0 to (t_ch_balance.fieldcount-1) do begin afield[i] :=t_ch_balance.fields[i].value ; end; t_ch_balance.insert; for i := 0 to (t_ch_balance.fieldcount-1) do begin if t_ch_balance.fields[i].FieldName<>'帐单编号'then t_ch_balance.fields[i].value := afield[i] ; end; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算人']:=employee; t_ch_balance['结算日期']:=now; t_ch_balance['核销人']:=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['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance['备注']:=''; t_ch_balance['相关号码']:=''; t_ch_balance['财务']:=0; t_ch_balance['财务凭证']:=''; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; except if t_ch_balance.state=dsinsert then t_ch_balance.cancel; showmessage('复制添加失败!!'); end; } end; procedure Tfrm_ch_balance_accept.bsSkinButton14Click(Sender: TObject); begin try frm_ch_shen_query:=tfrm_ch_shen_query.Create (self); shen_query_type:=9; 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_accept.bsSkinButton15Click(Sender: TObject); var sdate:tdate; aList:TStringList; i:integer; billnos:string; begin {$IFDEF SFLIUCHENG} if t_ch_accept_shen.IsEmpty then exit; if (t_ch_accept_shen.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; billnos:=''; try t_ch_accept_shen.DisableControls; t_ch_fee_do_accept.DisableControls; aList.Clear; if dxDBGrid19.SelectedCount>0 then begin for i:=0 to dxDBGrid19.SelectedCount-1 do begin t_ch_accept_shen.GotoBookmark(pointer(dxDBGrid19.selectedrows[i])); if aList.IndexOf(t_ch_accept_shen['客户名称'])<0 then aList.Add(t_ch_accept_shen['客户名称']); if billnos='' then billnos:=t_ch_accept_shen.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_accept_shen.fieldbyname('申请编号').asstring; end; if aList.Count>1 then begin showmessage('不相同的客户不能同时结算:'+#13#10+aList.Text); exit; end; end else begin aList.Add(t_ch_accept_shen['客户名称']); if billnos='' then billnos:=t_ch_accept_shen.fieldbyname('申请编号').asstring else billnos:=billnos+','+t_ch_accept_shen.fieldbyname('申请编号').asstring; if aList.Count>1 then begin showmessage('没有需要结算的信息'); exit; end; end; finally t_ch_accept_shen.EnableControls; t_ch_fee_do_accept.EnableControls; aList.free; end; try frm_ch_accept_do:=tfrm_ch_accept_do.Create (self); frm_ch_accept_do.Memo1.text:='申请号码:'+billnos; frm_ch_accept_do.ShowModal; finally frm_ch_accept_do.Free; frm_ch_accept_do:=nil; end; {$ENDIF} end; procedure Tfrm_ch_balance_accept.bsSkinButton17Click(Sender: TObject); begin t_ch_invoice_shen.close; t_ch_invoice_shen.sql.clear; t_ch_invoice_shen.sql.add('SELECT * FROM t_ch_invoice_shen ' +'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.类型 = '+''''+'1'+''''+')) AND (申请状态 = '+'''' +'开出发票'+''''+')' +' order by 申请编号'); t_ch_invoice_shen.open; end; procedure Tfrm_ch_balance_accept.bsSkinButton16Click(Sender: TObject); var aQuery:TADOQuery; begin if t_ch_accept_shen.IsEmpty then exit; if (t_ch_accept_shen.FieldByName('申请状态').asstring<>'提交申请') then begin showmessage('当前申请状态不能撤消申请!!'); exit; end; t_ch_accept_shen.edit; t_ch_accept_shen['申请状态']:='申请收款'; t_ch_accept_shen.Post; aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; SQL.Add('select 编号,费用状态 from t_op_seae where 费用状态=''提交收款'' and 编号 in (select DISTINCT 业务编号 from t_ch_fee_do where 工作编号='''+t_ch_accept_shen['申请编号']+''')'); Open; if not IsEmpty then begin First; while not eof do begin Edit; FieldByName('费用状态').AsString:='费用录入'; Post; Next; end; end; end; finally FreeAndNil(aQuery); end; t_ch_accept_shen.Requery; end; procedure Tfrm_ch_balance_accept.t_ch_balanceCalcFields(DataSet: TDataSet); begin if not StrToBool(get_parameters_value(83,'false')) then 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; end; end; procedure Tfrm_ch_balance_accept.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; end; procedure Tfrm_ch_balance_accept.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_accept.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_accept.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_accept.RxDBLookupCombo16Exit(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo15Exit(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo15Enter(Sender: TObject); begin frm_data_share.t_sys_bank.Filtered:=false; if StrToBool(get_parameters_value(83,'false')) then begin frm_data_share.t_sys_bank.Filter:='币别=''RMB'''; frm_data_share.t_sys_bank.Filtered:=true; end; end; procedure Tfrm_ch_balance_accept.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_accept.dxDBGrid6DblClick(Sender: TObject); begin fee_view(v_fee_do_seae.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.dxDBGrid7DblClick(Sender: TObject); begin fee_view(v_fee_do_seai.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.dxDBGrid8DblClick(Sender: TObject); begin fee_view(v_fee_do_aire.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.dxDBGrid9DblClick(Sender: TObject); begin fee_view(v_fee_do_airi.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.t_ch_jinzhangAfterInsert( DataSet: TDataSet); begin t_ch_jinzhang['制单人']:=employee; t_ch_jinzhang['开票日期']:=date; t_ch_jinzhang['票据金额']:=0; t_ch_jinzhang['票据类型']:='支票'; t_ch_jinzhang['币别']:='RMB'; t_ch_jinzhang['复核状态']:=0; t_ch_jinzhang['是否打印']:=0; t_ch_jinzhang['是否废除']:=0; sncDBCurrencyEdit1.CurrencySymbol:='¥'; end; procedure Tfrm_ch_balance_accept.t_ch_jinzhangBeforePost( DataSet: TDataSet); begin table_before_post(t_ch_jinzhang,'票据金额'); table_before_post(t_ch_jinzhang,'币别'); end; procedure Tfrm_ch_balance_accept.N1Click(Sender: TObject); begin if t_ch_jinzhang.IsEmpty then exit; if t_ch_jinzhang.FieldByName('是否废除').asboolean then begin showmessage('支票已经废除,不能打印!!'); exit; end; if not t_ch_jinzhang.FieldByName('是否打印').asboolean then begin t_ch_jinzhang.Edit; t_ch_jinzhang['是否打印']:=1; t_ch_jinzhang.post; end; sys_print('进帐单打印',TMenuItem(sender).tag,t_ch_jinzhang1,nil,nil,nil,nil,nil,nil,nil,t_ch_jinzhang1,nil,nil); end; procedure Tfrm_ch_balance_accept.bsSkinButton33Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton33.ClientToScreen(Point(0,bsSkinButton33.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept.bsSkinButton18Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton18.ClientToScreen(Point(0,bsSkinButton18.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept.bsSkinButton22Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton22.ClientToScreen(Point(0,bsSkinButton22.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept.bsSkinButton23Click(Sender: TObject); begin table_post(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.bsSkinButton27Click(Sender: TObject); begin table_cancel(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.bsSkinButton20Click(Sender: TObject); begin bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; end; procedure Tfrm_ch_balance_accept.dxDBGrid30DblClick(Sender: TObject); begin bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; end; procedure Tfrm_ch_balance_accept.bsSkinButton29Click(Sender: TObject); begin table_post(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.bsSkinButton31Click(Sender: TObject); begin table_cancel(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.bsSkinButton34Click(Sender: TObject); begin bsSkinPageControl5.ActivePage:=bsSkinTabSheet15; end; procedure Tfrm_ch_balance_accept.bsSkinButton35Click(Sender: TObject); begin table_Prior(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.bsSkinButton36Click(Sender: TObject); begin table_next(t_ch_jinzhang); end; procedure Tfrm_ch_balance_accept.jinzhangbankchange(sender: TField); begin try if (t_ch_jinzhang.state=dsinsert) or (t_ch_jinzhang.state=dsedit) then begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',t_ch_jinzhang['银行代码'],[])then begin t_ch_jinzhang['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_jinzhang['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; t_ch_jinzhang['币别']:=frm_data_share.t_sys_bank.fieldbyname('币别').asstring; if frm_data_share.t_crm_client.Locate('客户简称',t_ch_jinzhang['客户名称'],[])then if t_ch_jinzhang['币别']='RMB' then begin if frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行RMB').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号RMB').asstring; end else begin if frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行USD').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号USD').asstring; end; ischangecur:=false; try finally ischangecur:=true; end; end; end; except ; end; end; procedure Tfrm_ch_balance_accept.jinzhangcustchange(sender: TField); begin if (t_ch_jinzhang.state=dsinsert) or (t_ch_jinzhang.state=dsedit) then begin if frm_data_share.t_crm_client.Locate('客户简称',t_ch_jinzhang['客户名称'],[])then if t_ch_jinzhang['币别']='RMB' then begin if frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行RMB').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号RMB').asstring; end else begin if frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行USD').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号USD').asstring; end; end; end; procedure Tfrm_ch_balance_accept.jinzhangdatechange(sender: TField); begin t_ch_jinzhang['年']:=my_strtoyear(t_ch_jinzhang['开票日期']); t_ch_jinzhang['月']:=my_strtomonth(t_ch_jinzhang['开票日期']); t_ch_jinzhang['日']:=my_strtodday(t_ch_jinzhang['开票日期']); t_ch_jinzhang['年小']:=formatdatetime('yyyy',t_ch_jinzhang['开票日期']); t_ch_jinzhang['月小']:=formatdatetime('m',t_ch_jinzhang['开票日期']); t_ch_jinzhang['日小']:=formatdatetime('d',t_ch_jinzhang['开票日期']); end; procedure Tfrm_ch_balance_accept.jinzhangnumchange(sender: TField); var lowamont:String; lenlowamont,i,J:Integer; upword:array[0..12] of string[4]; begin if Sender.DataSet['币别']='' then exit; 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]]:='¥'; Label80.Visible:=false; Label85.Visible:=True; sncDBCurrencyEdit1.CurrencySymbol:='¥'; // 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'; sncDBCurrencyEdit1.CurrencySymbol:='$'; Sender.DataSet['金额大写']:=DXZHUSD(FloatToStr(Sender.DataSet['票据金额'])); Label80.Visible:=True; Label85.Visible:=false; end; end; procedure Tfrm_ch_balance_accept.jinzhangcurrchange(sender: TField); begin if ischangecur then begin if frm_data_share.t_sys_bank.Locate('代码',t_ch_jinzhang.fieldbyname('银行代码').AsString,[]) then begin if frm_data_share.t_sys_bank['币别']<>t_ch_jinzhang['币别'] then begin if frm_data_share.t_sys_bank.Locate('币别',t_ch_jinzhang['币别'],[]) then begin t_ch_jinzhang['银行代码']:=frm_data_share.t_sys_bank.fieldbyname('代码').asstring; t_ch_jinzhang['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_jinzhang['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; end else begin if frm_data_share.t_sys_bank.Locate('币别',t_ch_jinzhang['币别'],[]) then begin t_ch_jinzhang['银行代码']:=frm_data_share.t_sys_bank.fieldbyname('代码').asstring; t_ch_jinzhang['银行账号']:=frm_data_share.t_sys_bank.fieldbyname('银行账号').asstring; t_ch_jinzhang['开户银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end; end; /// if frm_data_share.t_crm_client.Locate('客户简称',t_ch_jinzhang['客户名称'],[])then if t_ch_jinzhang['币别']='RMB' then begin if frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('人民币支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行RMB').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号RMB').asstring; end else begin if frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring='' then t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('客户全称').asstring else t_ch_jinzhang['出票单位']:=frm_data_share.t_crm_client.fieldbyname('美元支票抬头').asstring; t_ch_jinzhang['出票银行']:=frm_data_share.t_crm_client.fieldbyname('开户行USD').asstring; t_ch_jinzhang['出票帐号']:=frm_data_share.t_crm_client.fieldbyname('帐号USD').asstring; end; end; if not t_ch_jinzhang.FieldByName('票据金额').IsNull then jinzhangnumchange(sender) else begin if t_ch_jinzhang['币别']='RMB' then begin sncDBCurrencyEdit1.CurrencySymbol:='¥'; Label113.Visible:=false; Label118.Visible:=True; end else begin sncDBCurrencyEdit1.CurrencySymbol:='$'; Label113.Visible:=true; Label118.Visible:=false; end; end; end; procedure Tfrm_ch_balance_accept.bsSkinPageControl1Change(Sender: TObject); begin if not ch_balance_accept_open then exit; if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then begin t_ch_invoice_shen.Close; if not t_ch_invoice_shen.active then begin if StrToBool(get_parameters_value(85,'false')) then begin t_ch_invoice_shen.open; t_ch_fee_do_invoice.open; v_fee_do_seae.Close; v_fee_do_seai.Close; v_fee_do_aire.Close; v_fee_do_airi.Close; v_fee_do_bsCard.Close; v_fee_do_bsCard.DataSource:=t_ch_invoice_shen1; v_fee_do_bsCard.open; v_fee_do_seae_sum.Close; v_fee_do_seai_sum.Close; v_fee_do_aire_sum.Close; v_fee_do_airi_sum.Close; v_fee_do_bsCard_sum.Close; v_fee_do_bsCard_sum.DataSource:=t_ch_invoice_shen1; v_fee_do_bsCard_sum.open; bsSkinTabSheet7.TabVisible:=false; bsSkinTabSheet8.TabVisible:=false; bsSkinTabSheet9.TabVisible:=false; bsSkinTabSheet10.TabVisible:=false; bsSkinTabSheet17.TabVisible:=true; end else begin t_ch_invoice_shen.open; t_ch_fee_do_invoice.open; v_fee_do_seae.Open; v_fee_do_seai.open; v_fee_do_aire.open; v_fee_do_airi.open; v_fee_do_bsCard.Close; v_fee_do_seae_sum.Open; v_fee_do_seai_sum.open; v_fee_do_aire_sum.open; v_fee_do_airi_sum.open; v_fee_do_bsCard_sum.Close; bsSkinTabSheet7.TabVisible:=true; bsSkinTabSheet8.TabVisible:=true; bsSkinTabSheet9.TabVisible:=true; bsSkinTabSheet10.TabVisible:=true; bsSkinTabSheet17.TabVisible:=false; end; end; end else if bsSkinPageControl1.ActivePage=bsSkinTabSheet111 then begin t_ch_accept_shen.Close; if not t_ch_accept_shen.active then begin if StrToBool(get_parameters_value(85,'false')) then begin t_ch_accept_shen.open; t_ch_fee_do_accept.open; v_fee_do_bsCard.DataSource:=t_ch_accept_shen1; v_fee_do_bsCard.Close; v_fee_do_bsCard.open; acceptv_fee_do_seae.close; acceptv_fee_do_seai.close; acceptv_fee_do_aire.close; acceptv_fee_do_airi.close; acceptv_fee_do_seae_sum.close; acceptv_fee_do_seai_sum.close; acceptv_fee_do_aire_sum.close; acceptv_fee_do_airi_sum.close; v_fee_do_bsCard_sum.Close; v_fee_do_bsCard_sum.DataSource:=t_ch_accept_shen1; v_fee_do_bsCard_sum.open; bsSkinTabSheet11.TabVisible:=false; bsSkinTabSheet12.TabVisible:=false; bsSkinTabSheet13.TabVisible:=false; bsSkinTabSheet14.TabVisible:=false; bsSkinTabSheet18.TabVisible:=true; end else begin t_ch_accept_shen.open; t_ch_fee_do_accept.open; acceptv_fee_do_seae.Open; acceptv_fee_do_seai.open; acceptv_fee_do_aire.open; acceptv_fee_do_airi.open; v_fee_do_bsCard.Close; acceptv_fee_do_seae_sum.Open; acceptv_fee_do_seai_sum.open; acceptv_fee_do_aire_sum.open; acceptv_fee_do_airi_sum.open; v_fee_do_bsCard_sum.Close; bsSkinTabSheet11.TabVisible:=true; bsSkinTabSheet12.TabVisible:=true; bsSkinTabSheet13.TabVisible:=true; bsSkinTabSheet14.TabVisible:=true; bsSkinTabSheet18.TabVisible:=false; end; end; end; if bsSkinPageControl1.ActivePage=bskntbshtTBS3 then begin if t_ch_jinzhang.Active then exit; t_ch_jinzhang.close; t_ch_jinzhang.sql.clear; t_ch_jinzhang.sql.add('select top 50 * from t_ch_jinzhang order by 开票日期 desc'); t_ch_jinzhang.open; end else begin t_ch_jinzhang.close; end; end; procedure Tfrm_ch_balance_accept.t_ch_jinzhangAfterOpen(DataSet: TDataSet); begin t_ch_jinzhang.fieldbyname('客户名称').OnChange:=jinzhangcustchange; t_ch_jinzhang.fieldbyname('开票日期').OnChange:=jinzhangdatechange; t_ch_jinzhang.fieldbyname('票据金额').OnChange:=jinzhangnumchange; t_ch_jinzhang.fieldbyname('币别').OnChange:=jinzhangCurrchange; t_ch_jinzhang.fieldbyname('银行代码').OnChange:=jinzhangbankchange; end; procedure Tfrm_ch_balance_accept.bsSkinButton30Click(Sender: TObject); var str:widestring; if_shen:string; in_id:integer; begin if t_ch_jinzhang.IsEmpty then exit; if t_ch_jinzhang.FieldByName('是否废除').asboolean then begin showmessage('支票已经废除,不能删除!!'); exit; end; if t_ch_jinzhang.FieldByName('是否打印').asboolean then begin str:=trim(InputBox('请输入废除原因', '废除原因:', '')); if str=''then begin showmessage('废除原因不能为空,废除失败!!'); exit; end else if str=''then begin exit; end; in_id:=t_ch_jinzhang.FieldByName('JZ_ID').asinteger; t_ch_jinzhang.Refresh; if not t_ch_jinzhang.locate('JZ_ID',in_id,[]) then exit; try modify_all:=true; t_ch_jinzhang.Edit; t_ch_jinzhang['是否废除']:=1; t_ch_jinzhang['废除原因']:=str; t_ch_jinzhang['废除人']:=employee; t_ch_jinzhang['废除日期']:=now; t_ch_jinzhang['申请编号']:=''; t_ch_jinzhang.post; modify_all:=false; except modify_all:=false; showmessage('废除失败!!'); exit; end; end else begin if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then t_ch_jinzhang.delete else exit; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton19Click(Sender: TObject); begin try frm_ch_zhipiao_query:=tfrm_ch_zhipiao_query.Create (self); zhipiao_query_type:=2; frm_ch_zhipiao_query.ShowModal; finally frm_ch_zhipiao_query.Free; end; end; procedure Tfrm_ch_balance_accept.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_accept.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_accept.RxDBLookupCombo6Change(Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo6.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_accept.bsSkinButton28Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton28.ClientToScreen(Point(0,bsSkinButton28.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_balance_accept.MenuItem1Click(Sender: TObject); begin t_ch_jinzhang.Insert; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; end; procedure Tfrm_ch_balance_accept.MenuItem3Click(Sender: TObject); var afield,afieldfee : variant; i:integer; begin if t_ch_jinzhang.IsEmpty then begin exit; MessageDlg('没有复制的信息,不能复制添加!',mtWarning,[mbok],0); end; afield := vararraycreate([0,t_ch_jinzhang.fieldcount-1],varvariant); for i := 0 to (t_ch_jinzhang.fieldcount-1) do begin afield[i] :=t_ch_jinzhang.fields[i].value ; end; t_ch_jinzhang.append; for i := 0 to (t_ch_jinzhang.fieldcount-1) do begin if t_ch_jinzhang.fields[i].FieldName<>'JZ_ID' then t_ch_jinzhang.fields[i].value := afield[i] ; end; t_ch_jinzhang['票据号码']:=''; t_ch_jinzhang['制单人']:=employee; t_ch_jinzhang['开票日期']:=date; t_ch_jinzhang['复核状态']:=0; t_ch_jinzhang['是否打印']:=0; t_ch_jinzhang['是否废除']:=0; t_ch_jinzhang.Post; bsSkinPageControl5.ActivePage:=bsSkinTabSheet16; end; procedure Tfrm_ch_balance_accept.t_ch_jinzhangAfterScroll( DataSet: TDataSet); begin if t_ch_jinzhang['币别']='RMB' then begin sncDBCurrencyEdit1.CurrencySymbol:='¥'; Label113.Visible:=false; Label118.Visible:=True; end else begin sncDBCurrencyEdit1.CurrencySymbol:='$'; Label113.Visible:=true; Label118.Visible:=false; end; end; procedure Tfrm_ch_balance_accept.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_accept.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; // t_ch_balance.edit; 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 Trim(t_ch_balance.FieldByName('币别').asstring)=Trim(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.edit; 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.edit; t_ch_balance['预结金额']:=t_ch_balance['预结金额']+jia_num; // 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_accept.MenuItem6Click(Sender: TObject); var can_do_num,do_num:real; rate_num,jia_num:real; if_hexiao:boolean; str1,str2:Tstringlist; bk:TBookmark; begin 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; end; if t_ch_cust_befbal_sum.IsEmpty then exit; 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; t_ch_balance.post; modify_all:=false; shench:=false; except modify_all:=false; showmessage('审核失败!!'); shench:=false; end; t_ch_balance.Refresh; end; end; procedure Tfrm_ch_balance_accept.N8Click(Sender: TObject); var str_feeValid:string; begin if t_ch_balance.IsEmpty then exit; if not if_open('033') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; t_ch_balance.first; while not t_ch_balance.eof do begin if (t_ch_balance.FieldByName('结算类别').asstring='流程')then begin end else begin if t_ch_balance.FieldByName('帐单状态').asstring='审核通过'then begin // showmessage('帐单已经审核!!'); end else begin try t_ch_balance.Refresh; modify_all:=true; shench:=true; t_ch_balance.edit; t_ch_balance['帐单状态']:='审核通过'; t_ch_balance['审核人']:=employee; t_ch_balance['审核日期']:=now; t_ch_balance.post; str_feeValid:=SetfeeValid(t_ch_balance.fieldbyname('帐单编号').asstring); if trim(str_feeValid) <>'' then begin ShowMessage('请检查以下费用'+#13#10+str_feeValid); end; modify_all:=false; shench:=false; except on e: Exception do begin modify_all:=false; shench:=false; // showmessage('审核失败!!'+e.Message); end; end; t_ch_balance.Refresh; end; end; t_ch_balance.Next; end; end; procedure Tfrm_ch_balance_accept.bsSkinButton37Click(Sender: TObject); var afield : variant; i: Integer; begin if t_ch_balance.IsEmpty then exit; try afield := vararraycreate([0,t_ch_balance.fieldcount-1],varvariant); for i := 0 to (t_ch_balance.fieldcount-1) do begin afield[i] :=t_ch_balance.fields[i].value ; end; t_ch_balance.insert; for i := 0 to (t_ch_balance.fieldcount-1) do begin if t_ch_balance.fields[i].FieldName<>'帐单编号'then t_ch_balance.fields[i].value := afield[i] ; end; t_ch_balance['帐单状态']:='录入状态'; t_ch_balance['结算人']:=employee; t_ch_balance['结算日期']:=date; 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['审核人']:=''; t_ch_balance['审核日期']:=null; t_ch_balance['备注']:=''; t_ch_balance['相关号码']:=''; t_ch_balance['财务']:=0; t_ch_balance['财务凭证']:=''; // t_ch_balance['帐单编号']:=get_no(date,'BA'); { 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_accept.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 工作编号='''+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_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_accept.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; procedure Tfrm_ch_balance_accept.bsSkinNotebook1PageChanged( Sender: TObject); begin if not notdetail then exit; getdetail(t_ch_balance.fieldbyname('帐单编号').AsString); end; procedure Tfrm_ch_balance_accept.fra_ch_add_do1MenuItem1Click( Sender: TObject); begin fra_ch_add_do1.MenuItem1Click(Sender); end; procedure Tfrm_ch_balance_accept.dxDBGrid10SelectedCountChange( Sender: TObject); var i:integer; amt,usdAmt:Double; begin if t_ch_invoice_shen.IsEmpty then exit; if dxDBGrid10.SelectedCount>=1 then begin amt:=0; usdAmt:=0; for i:=0 to dxDBGrid10.SelectedCount-1 do begin t_ch_invoice_shen.GotoBookmark(pointer(dxDBGrid10.selectedrows[i])); if t_ch_invoice_shen.fieldByName('币别').AsString='RMB' then amt:=amt+t_ch_invoice_shen.fieldByName('合计金额').AsFloat else usdAmt:=usdAmt+t_ch_invoice_shen.fieldByName('合计金额').AsFloat; end; end else begin amt:=0; usdAmt:=0; if t_ch_invoice_shen.fieldByName('币别').AsString='RMB' then amt:=amt+t_ch_invoice_shen.fieldByName('合计金额').AsFloat else usdAmt:=usdAmt+t_ch_invoice_shen.fieldByName('合计金额').AsFloat; end; Label129.Caption:='你选择了'+inttostr(dxDBGrid10.SelectedCount)+'票业务,'+'RMB金额:'+FormatFloat('#,##,0.00;-0.00',amt)+' 外币金额:'+FormatFloat('#,##,0.00;-0.00',usdAmt); end; procedure Tfrm_ch_balance_accept.dxDBGrid19SelectedCountChange( Sender: TObject); var i:integer; amt:Double; begin if t_ch_accept_shen.IsEmpty then exit; if dxDBGrid19.SelectedCount>=1 then begin for i:=0 to dxDBGrid19.SelectedCount-1 do begin t_ch_accept_shen.GotoBookmark(pointer(dxDBGrid19.selectedrows[i])); amt:=amt+t_ch_accept_shen.fieldByName('申请金额').AsFloat; end; end else begin amt:=t_ch_accept_shen.fieldByName('申请金额').AsFloat; end; Label130.Caption:='你选择了'+inttostr(dxDBGrid19.SelectedCount)+'票业务,'+'金额:'+FormatFloat('#,##,0.00;-0.00',amt); end; procedure Tfrm_ch_balance_accept.bsSkinButton39Click(Sender: TObject); begin t_ch_balance.insert; getdetail(t_ch_balance.FieldByName('帐单编号').asstring); notdetail:=false; bsSkinNotebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; notdetail:=true; bsSkinPageControl6.ActivePage:=tab1; end; procedure Tfrm_ch_balance_accept.bsSkinButton1Click(Sender: TObject); var t_cw_design,aQuery:TAdoQuery; begin if not if_open('185') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if Trim(t_ch_balance.fieldbyname('财务凭证').AsString)<>'' then begin ShowMessage('已经生成凭证'); Exit; 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); NewDCVou(t_ch_balance,dmacc.AdotblVou,dmacc.AdotblVouItems,t_cw_design,employee ,StrToDate(formatDateTime('YYYY-MM-DD',t_ch_balance.FieldByName('结算日期').AsDateTime)),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.ExecSQL; finally t_ch_balance.Requery(); t_cw_design.Free; aQuery.Free; freeAndNil(dmacc); end; end; procedure Tfrm_ch_balance_accept.bsSkinButton40Click(Sender: TObject); var aAdoQuery:TAdoQuery; mblnos,PONos,feenames,Empls:string; begin // mblnos:=''; feenames:=''; Empls:=''; PONos:=''; aAdoQuery:=CreateAdoQuery; with aAdoQuery do try close;SQL.Clear; sql.Add('select distinct 主提单号 from v_fee_do_bscard'); sql.Add('where 工作编号=:工作编号 and 主提单号<>'''''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not eof do begin if mblnos='' then mblnos:=mblnos+FieldByName('主提单号').AsString else mblnos:=mblnos+','+FieldByName('主提单号').AsString; next; end; close;SQL.Clear; sql.Add('select distinct 委托编号 from v_fee_do_bscard'); sql.Add('where 工作编号=:工作编号 and 委托编号<>'''''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not eof do begin if PONos='' then PONos:=PONos+FieldByName('委托编号').AsString else PONos:=PONos+','+FieldByName('委托编号').AsString; next; end; close;SQL.Clear; sql.Add('select distinct 费用名称 from v_fee_do_bscard'); sql.Add('where 工作编号=:工作编号 and 主提单号<>'''''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not eof do begin if feenames='' then feenames:=feenames+FieldByName('费用名称').AsString else feenames:=feenames+','+FieldByName('费用名称').AsString; next; end; close;SQL.Clear; sql.Add('select distinct 费用录入人 录入人 from v_fee_do_bscard'); sql.Add('where 工作编号=:工作编号 and 主提单号<>'''''); Parameters.ParamByName('工作编号').Value:=t_ch_balance.fieldbyname('帐单编号').AsString; Open;First; while not eof do begin if Empls='' then Empls:=Empls+FieldByName('录入人').AsString else Empls:=Empls+','+FieldByName('录入人').AsString; next; end; t_ch_balance.Edit; if Trim(t_ch_balance.FieldByName('备注').AsString)='' then begin t_ch_balance.FieldByName('备注').AsString:=Empls+','+t_ch_balance.fieldbyname('客户名称').AsString+#13#10+mblnos+','+feenames+' '+PONos; end; t_ch_balance.Post; finally end; end; procedure Tfrm_ch_balance_accept.dxDBGrid29DblClick(Sender: TObject); begin fee_view(fra_ch_delete_do1.v_fee_do_bscard1.DataSet.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.dxDBGrid36DblClick(Sender: TObject); begin fee_view(v_fee_do_bsCard1.dataset.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.dxDBGrid38DblClick(Sender: TObject); begin fee_view(v_fee_do_bsCard1.dataset.fieldbyname('编号').AsString); end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo19Change(Sender: TObject); begin t_ch_balance.FieldByName('汇率').AsFloat:=getUsdExRate(FormatDateTime('YYYY-MM-DD',t_ch_balance.FieldByName('结算日期').AsDateTime),t_ch_balance.FieldByName('折算币别').AsString); /// end; procedure Tfrm_ch_balance_accept.DBEdit89Exit(Sender: TObject); begin if t_ch_balance.FieldByName('折算币别').AsString=t_ch_balance.FieldByName('币别').AsString then begin if t_ch_balance.FieldByName('折算币别').AsString='RMB' then begin if t_ch_balance.FieldByName('到帐金额').AsFloat=0 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_ch_balance.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if i=0 then str:='('+''''+t_ch_balance.fieldbyname('帐单编号').asstring+'''' else str:=str+','+''''+t_ch_balance.fieldbyname('帐单编号').asstring+''''; end; end else begin str:='('+''''+t_ch_balance.fieldbyname('帐单编号').asstring+''''; end; str:=str+')'; t_ch_balanceSel.close; t_ch_balanceSel.sql.clear; t_ch_balanceSel.sql.add('select * from t_ch_balance ' +'where 帐单编号 in '+str); t_ch_balanceSel.open; sys_print('应收费用结算选择打印',2,t_ch_balanceSel1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_ch_balance_accept.RxDBLookupCombo24Change(Sender: TObject); begin if not frm_data_share.t_sys_bank.IsEmpty then if frm_data_share.t_sys_bank.Locate('代码',RxDBLookupCombo24.DisplayValues[0],[])then begin t_ch_balance['美元银行']:=frm_data_share.t_sys_bank.fieldbyname('银行名称').asstring; end else begin t_ch_balance['美元银行']:=''; end; end; end.