$PBExportHeader$w_credence_edit_popup.srw $PBExportComments$凭证录入 forward global type w_credence_edit_popup from w_publ_pageretr end type type cb_print from uo_imflatbutton within w_credence_edit_popup end type type cb_retrieve from uo_imflatbutton within w_credence_edit_popup end type type cb_addzy from uo_imflatbutton within w_credence_edit_popup end type type cb_delet from uo_imflatbutton within w_credence_edit_popup end type type cb_edit from uo_imflatbutton within w_credence_edit_popup end type type cb_add from uo_imflatbutton within w_credence_edit_popup end type type cb_add_xm from uo_imflatbutton within w_credence_edit_popup end type type cb_dele_xm from uo_imflatbutton within w_credence_edit_popup end type type cb_showall from uo_imflatbutton within w_credence_edit_popup end type type cb_auditing from uo_imflatbutton within w_credence_edit_popup end type type dw_child from u_dw_rbtnfilter within w_credence_edit_popup end type type cb_money from uo_imflatbutton within w_credence_edit_popup end type type dw_child_share from datawindow within w_credence_edit_popup end type type st_3 from statictext within w_credence_edit_popup end type type cb_cauditing from uo_imflatbutton within w_credence_edit_popup end type type cb_print_1 from uo_imflatbutton within w_credence_edit_popup end type type ddlb_credtype from dropdownlistbox within w_credence_edit_popup end type type st_dft_cmonth from statictext within w_credence_edit_popup end type type cbx_1 from checkbox within w_credence_edit_popup end type type ddlb_status from dropdownlistbox within w_credence_edit_popup end type type st_2 from statictext within w_credence_edit_popup end type type st_4 from statictext within w_credence_edit_popup end type type cb_other from uo_imflatbutton within w_credence_edit_popup end type type em_cmonth from editmask within w_credence_edit_popup end type type mle_msg from statictext within w_credence_edit_popup end type type dw_uc from datawindow within w_credence_edit_popup end type type cb_auto_create from uo_imflatbutton within w_credence_edit_popup end type type ln_5 from line within w_credence_edit_popup end type type ln_6 from line within w_credence_edit_popup end type type st_mxdscrp from statictext within w_credence_edit_popup end type type cb_dft from commandbutton within w_credence_edit_popup end type type st_dft_reldate from statictext within w_credence_edit_popup end type type ln_1 from line within w_credence_edit_popup end type type ln_2 from line within w_credence_edit_popup end type type ln_3 from line within w_credence_edit_popup end type type ln_4 from line within w_credence_edit_popup end type type r_bar from rectangle within w_credence_edit_popup end type end forward global type w_credence_edit_popup from w_publ_pageretr integer width = 3611 integer height = 2380 string title = "记帐凭证" boolean maxbox = true windowstate windowstate = maximized! event retrieve_childdw ( ) event retrieve_uc ( ) event refresh_interface ( ) event ue_f7 ( ) event ue_f8 ( ) event ue_f9 ( ) event ue_f10 ( ) event ue_f6 ( ) event ue_f11 ( ) event ue_f12 ( ) event ue_print ( ) event ue_print_wb ( ) event ue_print_view ( ) event ue_print_wb_view ( ) event ue_cmpl_tax ( ) event ue_computer ( ) event ue_cash ( ) event ue_cred_mode ( ) event ue_print_list ( ) event ue_balance ( ) event ue_cred_savetomode ( ) event ue_bill_find ( ) event ue_xls ( ) event ue_print_list2 ( ) cb_print cb_print cb_retrieve cb_retrieve cb_addzy cb_addzy cb_delet cb_delet cb_edit cb_edit cb_add cb_add cb_add_xm cb_add_xm cb_dele_xm cb_dele_xm cb_showall cb_showall cb_auditing cb_auditing dw_child dw_child cb_money cb_money dw_child_share dw_child_share st_3 st_3 cb_cauditing cb_cauditing cb_print_1 cb_print_1 ddlb_credtype ddlb_credtype st_dft_cmonth st_dft_cmonth cbx_1 cbx_1 ddlb_status ddlb_status st_2 st_2 st_4 st_4 cb_other cb_other em_cmonth em_cmonth mle_msg mle_msg dw_uc dw_uc cb_auto_create cb_auto_create ln_5 ln_5 ln_6 ln_6 st_mxdscrp st_mxdscrp cb_dft cb_dft st_dft_reldate st_dft_reldate ln_1 ln_1 ln_2 ln_2 ln_3 ln_3 ln_4 ln_4 r_bar r_bar end type global w_credence_edit_popup w_credence_edit_popup type variables Int child_column_int = 1,uc_column_int = 1 uo_credence uo_credence_ins Long cur_id = 0 Boolean if_fcurrency = FALSE //是否核算外币 Long cur_checkflag = -1 Long cur_postflag = -1 String cur_credtype = '-1' Int cur_editfoucs = 0 Boolean if_changedw Long i_cmonth Long ll_xls_billid,ll_xls_Templatesid String ls_xls_DefaultDataWindow Long il_dft_cmonth Int ii_if_dft_reldate DateTime idt_dft_reldate end variables forward prototypes public function integer wf_refresh_interface () public function integer wf_lock_child () public function integer wf_no_edit () public function integer wf_lock_uc () public function integer wf_refresh_curuc (long arg_subaccsetid, long arg_credid) public function integer wf_change_childdw_face () public function integer wf_setrow (long arg_credno) public subroutine wf_reshare_subid () public function integer wf_rtr_balc () public function integer wf_flagstatus_rf () public function integer wf_check_cash (ref string arg_msg) public subroutine wf_text () end prototypes event retrieve_childdw;Long row,uc_credid,uc_subaccsetid,i,li_row,cnt row = dw_uc.GetRow() //1.会计科目 wf_reshare_subid() IF row > 0 THEN uc_subaccsetid = dw_uc.Object.subaccsetid[row] uc_credid = dw_uc.Object.credid[row] dw_child.SetRedraw (FALSE) dw_child.Retrieve(sys_accsetid,uc_subaccsetid,uc_credid) dw_child.ShareData(dw_child_share) cnt = dw_child.RowCount() FOR i = 1 TO sys_credence_insertrow - cnt dw_child.InsertRow(0) NEXT dw_child.SetRedraw (TRUE) ELSE dw_child.Reset() dw_child.ShareData(dw_child_share) END IF end event event refresh_interface();//被 wf_refresh_interface() 调用,用于界面刷新 cb_addzy.Enabled = dw_edit_mode ddlb_status.Enabled = NOT dw_edit_mode cb_dft.Enabled = NOT dw_edit_mode em_cmonth.Enabled = NOT dw_edit_mode ddlb_credtype.Enabled = NOT dw_edit_mode cbx_1.Enabled = dw_edit_mode //mle_msg.Visible = dw_edit_mode IF dw_edit_mode AND cur_editfoucs = 1 THEN IF sys_option_credno_save = 1 THEN dw_uc.SetTabOrder('credno',0) END IF END IF IF dw_edit_mode AND sys_system_mode = -1 THEN dw_child_share.SetTabOrder('cw_credencemx_cusid',0) dw_child_share.SetTabOrder('cw_credencemx_sptid',0) END IF IF NOT dw_edit_mode THEN if_changedw = FALSE end event event ue_print();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF //--直接打印 uo_print_preview uo_print IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN S_print_MSG LS_PRMSG Long LS_ROW LS_ROW = dw_uc.GetRow() IF LS_ROW <= 0 THEN MessageBox('NO','没有打印目标单据!') RETURN END IF String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = 'dw_pr_credence' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF LS_PRMSG.obj_dwNAME = ls_new_dwname LS_PRMSG.TAG_TEXT = '记帐凭证' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW] LS_PRMSG.printrow = sys_emptyrowcount LS_PRMSG.retr_scid = sys_accsetid Long ll_rowcount = 0 SELECT count(*) INTO :ll_rowcount FROM cw_credencemx WHERE accsetid = :sys_accsetid AND credid = :LS_PRMSG.retr_pramnmb; IF sqlca.SQLCode <> 0 THEN RETURN END IF LS_PRMSG.rowcnt = ll_rowcount uo_print.FACT_PRINT_MSG = LS_PRMSG String arg_msg IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("系统提示",arg_msg) RETURN END IF uo_print.ds_print() end event event ue_print_wb();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF //--直接打印 uo_print_preview uo_print IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN S_print_MSG LS_PRMSG Long LS_ROW LS_ROW = dw_uc.GetRow() IF LS_ROW <= 0 THEN MessageBox('NO','没有打印目标单据!') RETURN END IF String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = 'dw_pr_credence_wb' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF LS_PRMSG.obj_dwNAME = ls_new_dwname LS_PRMSG.TAG_TEXT = '记帐凭证' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW] LS_PRMSG.printrow = sys_emptyrowcount LS_PRMSG.retr_scid = sys_accsetid Long ll_rowcount = 0 SELECT count(*) INTO :ll_rowcount FROM cw_credencemx WHERE accsetid = :sys_accsetid AND credid = :LS_PRMSG.retr_pramnmb; IF sqlca.SQLCode <> 0 THEN RETURN END IF LS_PRMSG.rowcnt = ll_rowcount uo_print.FACT_PRINT_MSG = LS_PRMSG String arg_msg IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("系统提示",arg_msg) RETURN END IF uo_print.ds_print() end event event ue_print_view();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF Long LS_ROW LS_ROW = dw_uc.GetRow() IF LS_ROW <= 0 THEN MessageBox('NO','没有打印目标单据!') RETURN END IF String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = 'dw_pr_credence' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME = ls_new_dwname LS_PRMSG.TAG_TEXT = '记帐凭证' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW] LS_PRMSG.printrow = sys_emptyrowcount LS_PRMSG.retr_scid = sys_accsetid Long ll_rowcount = 0 SELECT count(*) INTO :ll_rowcount FROM cw_credencemx WHERE accsetid = :sys_accsetid AND credid = :LS_PRMSG.retr_pramnmb; IF sqlca.SQLCode <> 0 THEN RETURN END IF LS_PRMSG.rowcnt = ll_rowcount //==================================================================== OpenWithParm(w_publ_preview,LS_PRMSG) end event event ue_print_wb_view();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF Long LS_ROW LS_ROW = dw_uc.GetRow() IF LS_ROW <= 0 THEN MessageBox('NO','没有打印目标单据!') RETURN END IF String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = 'dw_pr_credence_wb' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME = ls_new_dwname LS_PRMSG.TAG_TEXT = '记帐凭证' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW] LS_PRMSG.printrow = sys_emptyrowcount LS_PRMSG.retr_scid = sys_accsetid Long ll_rowcount = 0 SELECT count(*) INTO :ll_rowcount FROM cw_credencemx WHERE accsetid = :sys_accsetid AND credid = :LS_PRMSG.retr_pramnmb; IF sqlca.SQLCode <> 0 THEN RETURN END IF LS_PRMSG.rowcnt = ll_rowcount //==================================================================== OpenWithParm(w_publ_preview,LS_PRMSG) end event event ue_cmpl_tax;if not dw_edit_mode then messagebox('提示','非编辑状态下不可用') return end if long childrow decimal ld_debit,ld_credit,ld_tax_debit,ld_tax_credit dw_child.accepttext() childrow = dw_child.getrow() if childrow <= 0 then return ld_debit = dw_child.object.debit[childrow] ld_credit = dw_child.object.credit[childrow] if ld_debit <> 0 then ld_tax_debit = round(ld_debit/sys_bank_taxrate,2) if ld_credit <> 0 then ld_tax_credit = round(ld_credit/sys_bank_taxrate,2) dw_child.object.debit[childrow] = ld_tax_debit dw_child.object.credit[childrow] = ld_tax_credit end event event ue_computer;run('calc.exe') end event event ue_cash;IF dw_edit_mode THEN RETURN IF dw_uc.GetRow() <= 0 THEN RETURN Long i,cash_cnt s_flow_cred s_flowcred dw_uc.AcceptText() s_flowcred.accsetid = dw_uc.Object.accsetid[dw_uc.GetRow()] s_flowcred.credid = dw_uc.Object.credid[dw_uc.GetRow()] string ls_brief,ls_brief_arr[] DECLARE cur_brief CURSOR FOR SELECT cw_credencemx.brief FROM cw_subject,cw_credencemx WHERE cw_subject.accsetid = cw_credencemx.accsetid AND cw_subject.subid = cw_credencemx.subid AND cw_credencemx.accsetid = :s_flowcred.accsetid AND cw_credencemx.credid = :s_flowcred.credid AND cw_subject.hsemp = 1; open cur_brief; fetch cur_brief into :ls_brief; do while sqlca.sqlcode = 0 cash_cnt++ ls_brief_arr[cash_cnt] = ls_brief fetch cur_brief into :ls_brief; loop close cur_brief; IF cash_cnt = 0 THEN MessageBox('系统提示','凭证明细没有科目核算现金流量') RETURN END IF SELECT sum(debit),sum(credit) INTO :s_flowcred.debit,:s_flowcred.credit FROM cw_subject,cw_credencemx WHERE cw_subject.accsetid = cw_credencemx.accsetid AND cw_subject.subid = cw_credencemx.subid AND cw_credencemx.accsetid = :s_flowcred.accsetid AND cw_credencemx.credid = :s_flowcred.credid AND cw_subject.hsemp = 1; IF sqlca.SQLCode <> 0 THEN MessageBox('系统提示','查询凭证明细科目核算现金流量金额失败') RETURN END IF s_flowcred.brief = ls_brief_arr OpenWithParm(w_flow_cred,s_flowcred) end event event ue_cred_mode;IF NOT dw_edit_mode THEN MessageBox('提示','非编辑状态下不可用') RETURN END IF Long uc_row uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN RETURN Open(w_credence_mode_choice) Long ls_credid String ls_credtype Int ls_billnumber ls_credid = Message.DoubleParm IF ls_credid <= 0 THEN RETURN SELECT credtype,billnumber INTO :ls_credtype,:ls_billnumber FROM cw_credence_auto WHERE accsetid = :sys_accsetid AND credid = :ls_credid; IF sqlca.SQLCode <> 0 THEN RETURN dw_uc.Object.credtype[uc_row] = ls_credtype dw_uc.Object.billnumber[uc_row] = ls_billnumber Long child_row String ls_subid,ls_brief,ls_billno Decimal ls_debit,ls_credit,ls_amount,ls_price Long ls_deptid,ls_itemid,ls_billid Int li_hsqty,li_hsdept,li_hsemp,li_hsitem,li_dcflag DECLARE modecred_cur CURSOR FOR SELECT cw_credencemx_auto.subid, cw_credencemx_auto.brief, cw_credencemx_auto.debit, cw_credencemx_auto.credit, cw_credencemx_auto.amount, cw_credencemx_auto.price, cw_credencemx_auto.deptid, cw_credencemx_auto.itemid, cw_credencemx_auto.billid, cw_credencemx_auto.billno, cw_subject.hsqty, cw_subject.hsdept, cw_subject.hsemp, cw_subject.hsitem, cw_subject.dcflag FROM cw_credencemx_auto,cw_subject WHERE cw_credencemx_auto.accsetid = :sys_accsetid AND cw_credencemx_auto.credid = :ls_credid AND cw_credencemx_auto.accsetid = cw_subject.accsetid AND cw_credencemx_auto.subid = cw_subject.subid Order By cw_credencemx_auto.printid; OPEN modecred_cur; FETCH modecred_cur INTO :ls_subid,:ls_brief,:ls_debit,:ls_credit, :ls_amount,:ls_price,:ls_deptid,:ls_itemid, :ls_billid,:ls_billno,:li_hsqty,:li_hsdept, :li_hsemp,:li_hsitem,:li_dcflag; DO WHILE sqlca.SQLCode = 0 dw_child.AcceptText() Long ll_i Boolean if_f FOR ll_i = 1 TO dw_child.RowCount() IF Len(Trim(dw_child.Object.subid[ll_i])) > 0 THEN CONTINUE if_f = TRUE child_row = ll_i EXIT NEXT IF NOT if_f THEN child_row = dw_child.InsertRow(0) END IF dw_child.Object.brief[child_row] = ls_brief dw_child.Object.subid[child_row] = ls_subid dw_child.Object.debit[child_row] = ls_debit dw_child.Object.credit[child_row] = ls_credit dw_child.Object.cw_credencemx_billid[child_row] = ls_billid dw_child.Object.cw_credencemx_billno[child_row] = ls_billno dw_child.Object.cw_credencemx_amount[child_row] = ls_amount dw_child.Object.cw_credencemx_price[child_row] = ls_price dw_child.Object.cw_credencemx_deptid[child_row] = ls_deptid dw_child.Object.cw_credencemx_itemid[child_row] = ls_itemid dw_child.Object.cw_subject_hsqty[child_row] = li_hsqty dw_child.Object.cw_subject_hsdept[child_row] = li_hsdept dw_child.Object.cw_subject_hsemp[child_row] = li_hsemp dw_child.Object.cw_subject_hsitem[child_row] = li_hsitem dw_child.Object.cw_subject_dcflag[child_row] = li_dcflag FETCH modecred_cur INTO :ls_subid,:ls_brief,:ls_debit,:ls_credit, :ls_amount,:ls_price,:ls_deptid,:ls_itemid, :ls_billid,:ls_billno,:li_hsqty,:li_hsdept, :li_hsemp,:li_hsitem,:li_dcflag; LOOP CLOSE modecred_cur; // brief // subid // debit // credit // cw_credencemx_billid // cw_credencemx_billno // cw_credencemx_amount // cw_credencemx_price // cw_credencemx_deptid // cw_credencemx_itemid // end event event ue_print_list();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF //--直接打印 uo_print_preview uo_print IF MessageBox ("if","是否确定要打印列表中凭证吗?",question!,yesno! ) = 2 THEN RETURN s_print_msg ls_prmsg Long ls_i IF dw_pageretr.RowCount() <= 0 THEN MessageBox('no','没有打印目标凭证!') RETURN END IF String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' String ls_old_dwname_wb,ls_new_dwname_wb = '' ls_old_dwname = 'dw_pr_credence' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF //wb ls_old_dwname_wb = 'dw_pr_credence_wb' ls_new_dwname_wb = f_get_dwprint_dynamic_chname(ls_old_dwname_wb,ls_windowname) IF ls_new_dwname_wb = '' THEN ls_new_dwname_wb = ls_old_dwname_wb END IF ls_prmsg.retr_pram_falg = 15 ls_prmsg.tag_text = '记帐凭证' ls_prmsg.filter_string = '' ls_prmsg.pagech_flag = 0 ls_prmsg.pagech_flag = 0 ls_prmsg.printrow = sys_emptyrowcount ls_prmsg.retr_scid = sys_accsetid OPEN(w_sys_wait_jdt) //初始化进度条 w_sys_wait_jdt.Show() w_sys_wait_jdt.wf_accepttol(dw_pageretr.RowCount()) FOR ls_i = 1 TO dw_pageretr.RowCount() w_sys_wait_jdt.st_msg.Text = "打印凭证:"+dw_pageretr.Object.credtype[ls_i]+' '+String(dw_pageretr.Object.credno[ls_i]) //进度信息 ls_prmsg.retr_pramnmb = dw_pageretr.Object.credid[ls_i] Long ll_rowcount = 0 SELECT count(*) INTO :ll_rowcount FROM cw_credencemx WHERE accsetid = :sys_accsetid AND credid = :ls_prmsg.retr_pramnmb; IF sqlca.SQLCode <> 0 THEN RETURN END IF ls_prmsg.rowcnt = ll_rowcount //格式 Long mx_raw_cnt SELECT count(*) INTO :mx_raw_cnt FROM cw_credencemx,cw_subject WHERE cw_credencemx.accsetid = :sys_accsetid AND cw_credencemx.credid = :ls_prmsg.retr_pramnmb AND cw_credencemx.accsetid = cw_subject.accsetid AND cw_credencemx.subid = cw_subject.subid AND cw_subject.hswb = 1; IF sqlca.SQLCode <> 0 THEN RETURN END IF IF mx_raw_cnt = 0 THEN ls_prmsg.obj_dwname = ls_new_dwname ELSE ls_prmsg.obj_dwname = ls_new_dwname_wb END IF // // messagebox('',ls_prmsg.obj_dwname) uo_print.fact_print_msg = ls_prmsg String arg_msg IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("系统提示",arg_msg) RETURN END IF uo_print.ds_print() w_sys_wait_jdt.wf_inc(ls_i) //进度 NEXT CLOSE(w_sys_wait_jdt) end event event ue_balance;if not dw_edit_mode then messagebox('提示','非编辑状态下不可用') return end if long childrow decimal ld_sum_debit,ld_sum_credit,ld_amt dw_child.accepttext() childrow = dw_child.getrow() if childrow <= 0 then return if dw_child.object.debit[childrow] <> 0 or dw_child.object.debit[childrow] <> 0 then return ld_sum_debit = dw_child.object.sum_debit[childrow] ld_sum_credit = dw_child.object.sum_credit[childrow] ld_amt = abs(ld_sum_debit - ld_sum_credit) if dw_child.GetColumnName() = 'debit' then dw_child.object.debit[childrow] = ld_amt dw_child.object.credit[childrow] = 0 elseif dw_child.GetColumnName() = 'credit' then dw_child.object.credit[childrow] = ld_amt dw_child.object.debit[childrow] = 0 end if end event event ue_cred_savetomode;IF dw_edit_mode THEN MessageBox('提示','编辑状态下不可用') RETURN END IF Int rslt = 1 Long ll_ucrow,i String arg_msg,ls_str uo_credence_mode uo_cred_mode uo_cred_mode = CREATE uo_credence_mode ll_ucrow = dw_uc.GetRow() IF ll_ucrow <= 0 THEN arg_msg = '请选择凭证' rslt = 0 GOTO ext END IF s_inputbox s_sreu s_sreu.Title = '请输入模式凭证的名称' OpenWithParm(w_inputbox,s_sreu) ls_str = Message.StringParm IF Trim(ls_str) = '' OR IsNull(ls_str) THEN RETURN IF uo_cred_mode.newbegin(0,arg_msg) = 0 THEN rslt = 0 GOTO ext END IF uo_cred_mode.Credname = ls_str uo_cred_mode.credtype = dw_uc.Object.credtype[ll_ucrow] uo_cred_mode.billnumber = 0 uo_cred_mode.ifalways = 1 FOR i = 1 TO dw_child.RowCount() IF dw_child.Object.subid[i] = '' THEN CONTINUE IF uo_cred_mode.acceptmx(dw_child.Object.subid[i],& dw_child.Object.brief[i],& 0,& 0,& 0,& 0,& '',& 0,& 0,& 0,& 0,& 0,& 0,& 0,& '',& arg_msg,i) = 0 THEN MessageBox('error!',arg_msg) RETURN END IF NEXT IF uo_cred_mode.Save(arg_msg,TRUE) = 0 THEN MessageBox('error!',arg_msg) GOTO ext END IF ext: IF rslt = 0 THEN MessageBox('提示','失败,'+arg_msg) ELSE MessageBox('提示','成功') END IF DESTROY uo_cred_mode end event event ue_bill_find();IF dw_edit_mode THEN RETURN IF dw_pageretr.GetRow() <= 0 THEN RETURN String ls_code ls_code = dw_pageretr.Object.reldcode[dw_pageretr.GetRow()] f_open_win(0,ls_code) end event event ue_print_list2();IF NOT f_power_ind(1975,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF Long ls_i,ll_credid_array[] IF dw_pageretr.RowCount() <= 0 THEN MessageBox('no','没有打印目标凭证!') RETURN END IF FOR ls_i = 1 TO dw_pageretr.RowCount() ll_credid_array[ls_i] = dw_pageretr.Object.credid[ls_i] NEXT String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = 'dw_pr_credence_list' ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME = ls_new_dwname LS_PRMSG.TAG_TEXT = '记帐凭证' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg = 25 LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.retr_pramnmb = sys_accsetid LS_PRMSG.a_long_arr = ll_credid_array OpenWithParm(w_publ_preview,LS_PRMSG) end event public function integer wf_refresh_interface ();//wf_refresh_interface IF dw_edit_mode THEN cb_add_xm.Enabled = TRUE cb_dele_xm.Enabled = TRUE cb_retrieve.Enabled = FALSE cb_delet.Enabled = FALSE cb_print.Enabled = FALSE cb_showall.Enabled = FALSE cb_auditing.Enabled = FALSE dw_pageretr.RBUTTON_FILTER_USE = FALSE //右键查询功能开关 dw_pageretr.titleclick_sort_use = FALSE //单击标题排序功能开关 cb_edit.Enabled = TRUE cb_add.Enabled = TRUE cb_edit.Text = "放弃&E" cb_add.Text = "保存&S" cb_edit.normalpicname = 'Undo.bmp' cb_add.normalpicname = 'Save.bmp' ELSE cb_add_xm.Enabled = FALSE cb_dele_xm.Enabled = FALSE cb_retrieve.Enabled = TRUE cb_delet.Enabled = TRUE cb_print.Enabled = TRUE cb_showall.Enabled = TRUE cb_auditing.Enabled = TRUE cb_add.Enabled = TRUE cb_edit.Enabled = TRUE dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关 dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关 cb_edit.Text = "修改&E" cb_add.Text = "新建&S" cb_edit.normalpicname = 'OPEN.bmp' cb_add.normalpicname = 'new.bmp' IF dw_pageretr.GetRow() <= 0 THEN cb_edit.Enabled = FALSE cb_delet.Enabled = FALSE cb_auditing.Enabled = FALSE END IF END IF IF dw_edit_mode THEN cb_nextpage.Enabled = FALSE cb_retrieveall.Enabled = FALSE em_pagerowno.Enabled = FALSE sle_usual_query.Enabled = FALSE ELSE cb_nextpage.Enabled = TRUE cb_retrieveall.Enabled = TRUE em_pagerowno.Enabled = TRUE sle_usual_query.Enabled = TRUE END IF wf_lock_child() wf_lock_uc() cb_edit.of_init_draw() cb_add.of_init_draw() cb_edit.of_paint() cb_add.of_paint() cb_add.TriggerEvent('ue_textchange') cb_edit.TriggerEvent('ue_textchange') THIS.TriggerEvent('refresh_interface') RETURN 1 end function public function integer wf_lock_child ();//wf_lock_child INT LS_INT IF dw_edit_mode THEN FOR LS_INT=1 TO child_column_int dw_child.SetTabOrder (LS_INT,LS_INT*10 ) NEXT //child_share FOR LS_INT=1 TO child_column_int dw_child_share.SetTabOrder (LS_INT,LS_INT*10 ) NEXT ELSE FOR LS_INT=1 TO child_column_int dw_child.SetTabOrder (LS_INT, 0) NEXT //child_share FOR LS_INT=1 TO child_column_int dw_child_share.SetTabOrder (LS_INT, 0) NEXT END IF RETURN 1 end function public function integer wf_no_edit ();//wf_no_edit if dw_edit_mode then cb_edit.enabled=true else cb_edit.enabled=false end if return 1 end function public function integer wf_lock_uc ();//wf_lock_uc Int LS_INT Long ls_row ls_row = dw_uc.GetRow() IF dw_edit_mode THEN FOR LS_INT = 1 TO uc_column_int dw_uc.SetTabOrder (LS_INT,LS_INT*10 ) NEXT ELSE FOR LS_INT = 1 TO uc_column_int dw_uc.SetTabOrder (LS_INT, 0) NEXT END IF IF ls_row > 0 THEN dw_uc.SetRow(ls_row) RETURN 1 end function public function integer wf_refresh_curuc (long arg_subaccsetid, long arg_credid);//wf_refresh_curuc IF arg_subaccsetid < 0 THEN RETURN 0 IF arg_credid <= 0 OR IsNull(arg_credid) THEN RETURN 0 Long uc_row uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN RETURN 0 dw_uc.SetRedraw(FALSE) Long credno DateTime creddate Long billnumber String credtype Long cmonth String billmaker DateTime billmakerdate String billcheck DateTime billcheckdate String billpost DateTime billpostdate Int checkflag Int postflag DateTime moddate String modemp Int ifauto SELECT cw_credence.credno, cw_credence.creddate , cw_credence.billnumber , cw_credence.credtype , cw_credence.cmonth , cw_credence.billmaker, cw_credence.billmakerdate , cw_credence.billcheck , cw_credence.billcheckdate , cw_credence.billpost , cw_credence.billpostdate , cw_credence.checkflag , cw_credence.postflag , cw_credence.moddate , cw_credence.modemp , cw_credence.ifauto INTO :credno , :creddate , :billnumber, :credtype , :cmonth , :billmaker, :billmakerdate , :billcheck , :billcheckdate , :billpost , :billpostdate , :checkflag , :postflag , :moddate , :modemp, :ifauto FROM cw_credence WHERE ( cw_credence.accsetid = :sys_accsetid ) AND ( cw_credence.subaccsetid = :arg_subaccsetid ) AND ( cw_credence.credid = :arg_credid) ; IF sqlca.SQLCode <> 0 THEN MessageBox('系统提示',"查询操作失败(错误凭证唯一码)") RETURN 0 END IF dw_uc.Object.accsetid[uc_row] = sys_accsetid dw_uc.Object.subaccsetid[uc_row] = arg_subaccsetid dw_uc.Object.credid[uc_row] = arg_credid dw_uc.Object.credno[uc_row] = credno dw_uc.Object.creddate[uc_row] = creddate dw_uc.Object.billnumber[uc_row] = billnumber dw_uc.Object.credtype[uc_row] = credtype dw_uc.Object.cmonth[uc_row] = cmonth dw_uc.Object.billmaker[uc_row] = billmaker dw_uc.Object.billmakerdate[uc_row] = billmakerdate dw_uc.Object.billcheck[uc_row] = billcheck dw_uc.Object.billcheckdate[uc_row] = billcheckdate dw_uc.Object.billpost[uc_row] = billpost dw_uc.Object.billpostdate[uc_row] = billpostdate dw_uc.Object.checkflag[uc_row] = checkflag dw_uc.Object.postflag[uc_row] = postflag dw_uc.Object.moddate[uc_row] = moddate dw_uc.Object.modemp[uc_row] = modemp dw_uc.Object.ifauto[uc_row] = ifauto wf_flagstatus_rf() dw_uc.SetRedraw(TRUE) RETURN 1 //credid //accsetid //subaccsetid //credno //creddate //billnumber //credtype //cmonth //billmaker //billmakerdate //billcheck //billcheckdate //billpost //billpostdate //checkflag //postflag end function public function integer wf_change_childdw_face ();Long ls_sit,ls_width IF if_fcurrency THEN IF NOT if_changedw THEN dw_child.Modify('cw_subject_moneyid_t.visible=1 ~n rate_t.visible=1 ~n cw_credencemx_rawmoney_t.visible=1 ~n') dw_child.Modify('cw_subject_moneyid.visible=1 ~n rate.visible=1 ~n cw_credencemx_rawmoney.visible=1 ~n') ls_width = Long(dw_child.Describe('subid.width')) - Long(dw_child.Describe('cw_subject_moneyid.width')) - Long(dw_child.Describe('rate.width')) dw_child.Modify('subid.width='+String(ls_width)) ls_sit = Long(dw_child.Describe('subid.x'))+Long(dw_child.Describe('subid.width')) + 2 dw_child.Modify('cw_subject_moneyid_t.x='+String(ls_sit)) dw_child.Modify('cw_subject_moneyid.x='+String(ls_sit)) ls_sit = Long(dw_child.Describe('cw_subject_moneyid.x'))+Long(dw_child.Describe('cw_subject_moneyid.width')) + 6 dw_child.Modify('rate_t.x='+String(ls_sit)) dw_child.Modify('rate.x='+String(ls_sit)) dw_child.Modify('cw_credencemx_rawmoney_t.x='+String(ls_sit)) dw_child.Modify('cw_credencemx_rawmoney.x='+String(ls_sit)) ls_sit = Long(dw_child.Describe('rate.x'))+Long(dw_child.Describe('rate.width')) + 6 dw_child.Modify('debit.x='+String(ls_sit)) dw_child.Modify('debit_t.x='+String(ls_sit)) dw_child.Modify('sum_debit.x='+String(ls_sit)) dw_child.Modify('sum_rawmoney.x='+String(ls_sit)) ls_sit = Long(dw_child.Describe('debit.x'))+Long(dw_child.Describe('debit.width')) + 6 dw_child.Modify('credit.x='+String(ls_sit)) dw_child.Modify('credit_t.x='+String(ls_sit)) dw_child.Modify('sum_credit.x='+String(ls_sit)) END IF IF NOT if_changedw THEN if_changedw = TRUE ELSE ls_width = Long(dw_child.Describe('subid.width')) + Long(dw_child.Describe('cw_subject_moneyid.width')) + Long(dw_child.Describe('rate.width')) dw_child.Modify('cw_subject_moneyid_t.visible=0 ~n rate_t.visible=0 ~n cw_credencemx_rawmoney_t.visible=0 ~n') dw_child.Modify('cw_subject_moneyid.visible=0 ~n rate.visible=0 ~n cw_credencemx_rawmoney.visible=0 ~n') dw_child.Modify('subid.width='+String(ls_width)) ls_sit = Long(dw_child.Describe('subid.x'))+Long(dw_child.Describe('subid.width')) + 4 dw_child.Modify('debit.x='+String(ls_sit)) dw_child.Modify('debit_t.x='+String(ls_sit)) dw_child.Modify('sum_debit.x='+String(ls_sit)) dw_child.Modify('sum_rawmoney.x='+String(ls_sit)) ls_sit = Long(dw_child.Describe('debit.x'))+Long(dw_child.Describe('debit.width')) + 6 dw_child.Modify('credit.x='+String(ls_sit)) dw_child.Modify('credit_t.x='+String(ls_sit)) dw_child.Modify('sum_credit.x='+String(ls_sit)) if_changedw = FALSE END IF RETURN 1 // cw_credencemx_rawmoney // cw_subject_moneyid // rate // debit // credit // cw_subject_moneyid // cw_credencemx_rawmoney end function public function integer wf_setrow (long arg_credno);long ll_found ll_found = dw_pageretr.Find("credno = "+ string(arg_credno),1, dw_pageretr.RowCount()) if ll_found > 0 then dw_pageretr.setredraw(false) dw_pageretr.selectrow(0,false) dw_pageretr.scrolltorow(ll_found) dw_pageretr.selectrow(ll_found,true) dw_pageretr.setredraw(true) end if return 1 end function public subroutine wf_reshare_subid ();//1.会计科目 datawindowchild childdw_subid dw_child.getchild("subid",childdw_subid) childdw_subid.SetTransObject (sqlca) ddd_subid_display_detail.sharedata(childdw_subid) end subroutine public function integer wf_rtr_balc ();int rslt = 1 string ls_msg,ls_subid long ll_childrow,ll_ucrow,ll_credid int li_dcflag decimal ld_debit,ld_credit,ld_BDebit,ld_BCredit,ld_bgamt,ld_balcamt,ld_debit_i,ld_credit_i if dw_edit_mode then ll_ucrow = dw_uc.getrow() if ll_ucrow <= 0 then ls_msg = '没有凭证' rslt = 0 goto ext end if ll_credid = dw_uc.object.credid[ll_ucrow] ll_childrow = dw_child.getrow() if ll_childrow <= 0 then ls_msg = '没有明细科目' rslt = 0 goto ext end if ls_subid = dw_child.object.subid[ll_childrow] ld_debit_i = dw_child.object.debit[ll_childrow] ld_credit_i = dw_child.object.credit[ll_childrow] if ls_subid = '' then ls_msg = '' rslt = 0 goto ext end if select cw_subject.dcflag into :li_dcflag from cw_subject where subid = :ls_subid and accsetid = :sys_accsetid; if sqlca.sqlcode <> 0 then ls_msg = '查询:'+ls_subid+'余额方向失败' rslt = 0 goto ext end if select isnull(cw_Balance.BDebit,0), isnull(cw_Balance.BCredit,0) into :ld_BDebit,:ld_BCredit from cw_Balance where cw_Balance.accsetid = :sys_accsetid and cw_Balance.YearMon = :sys_curyearmon and cw_Balance.subid = :ls_subid; if sqlca.sqlcode = -1 then ls_msg = '查询:'+ls_subid+'期初余额失败' rslt = 0 goto ext end if select isnull(sum(cw_credencemx.debit),0), isnull(sum(cw_credencemx.credit),0) into :ld_debit,:ld_credit from cw_credencemx,cw_credence where ( cw_credence.accsetid = cw_credencemx.accsetid ) and ( cw_credence.credid = cw_credencemx.credid ) and ( cw_credence.cmonth = :sys_curyearmon ) and ( cw_credencemx.subid = :ls_subid ) and ( cw_credence.credid <> :ll_credid ) and ( cw_credence.accsetid = :sys_accsetid ); if sqlca.sqlcode <> 0 then ls_msg = '查询:'+ls_subid+'本月发生金额失败' rslt = 0 goto ext end if if li_dcflag = 1 then ld_bgamt = ld_bdebit - ld_bcredit ld_balcamt = ld_bdebit - ld_bcredit + ld_debit - ld_credit + ld_debit_i - ld_credit_i else ld_bgamt = ld_bcredit - ld_bdebit ld_balcamt = ld_bcredit - ld_bdebit + ld_credit - ld_debit + ld_credit_i - ld_debit_i end if ls_msg = ls_msg + '~n 科目:'+ls_subid ls_msg = ls_msg + '~n' ls_msg = ls_msg + '~n 期初余额:'+string(ld_bgamt,'#,##0.00') ls_msg = ls_msg + '~n本月发生借方:'+string(ld_debit + ld_debit_i,'#,##0.00') ls_msg = ls_msg + '~n本月发生借方:'+string(ld_credit + ld_credit_i,'#,##0.00') ls_msg = ls_msg + '~n 期末余额:'+string(ld_balcamt,'#,##0.00') end if ext: mle_msg.text = ls_msg return rslt end function public function integer wf_flagstatus_rf ();//wf_flagstatus_rf Long pagerert_row pagerert_row = dw_pageretr.GetRow() IF pagerert_row <= 0 THEN cb_auditing.Enabled = FALSE cb_cauditing.Enabled = FALSE GOTO ext END IF IF dw_edit_mode THEN cb_auditing.Enabled = FALSE cb_cauditing.Enabled = FALSE ELSE IF dw_pageretr.Object.checkflag[pagerert_row] = 0 THEN cb_auditing.Enabled = TRUE cb_cauditing.Enabled = FALSE ELSEIF dw_pageretr.Object.checkflag[pagerert_row] = 1 and dw_pageretr.Object.postflag[pagerert_row] = 0 THEN cb_auditing.Enabled = FALSE cb_cauditing.Enabled = TRUE ELSEIF dw_pageretr.Object.checkflag[pagerert_row] = 1 and dw_pageretr.Object.postflag[pagerert_row] = 1 THEN cb_auditing.Enabled = FALSE cb_cauditing.Enabled = FALSE END IF END IF ext: RETURN 0 end function public function integer wf_check_cash (ref string arg_msg);Int rslt = 1 IF sys_option_use_cash = 0 THEN rslt = 1 GOTO ext END IF IF dw_edit_mode THEN rslt = 0 arg_msg = '编辑状态不可用' GOTO ext END IF IF dw_pageretr.GetRow() <= 0 THEN rslt = 0 arg_msg = '请选择凭证' GOTO ext END IF Long i,cnt Long ll_accsetid,ll_credid dw_pageretr.AcceptText() ll_accsetid = dw_pageretr.Object.accsetid[dw_pageretr.GetRow()] ll_credid = dw_pageretr.Object.credid[dw_pageretr.GetRow()] SELECT count(*) INTO :cnt FROM cw_subject,cw_credencemx WHERE cw_subject.accsetid = cw_credencemx.accsetid AND cw_subject.subid = cw_credencemx.subid AND cw_credencemx.accsetid = :ll_accsetid AND cw_credencemx.credid = :ll_credid AND cw_subject.hsemp = 1; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询分录是否有核算现金流量科目失败,'+sqlca.SQLErrText rslt = 0 GOTO ext END IF IF cnt = 0 THEN rslt = 1 GOTO ext END IF Decimal ld_debit,ld_credit SELECT sum(debit),sum(credit) INTO :ld_debit,:ld_credit FROM cw_subject,cw_credencemx WHERE cw_subject.accsetid = cw_credencemx.accsetid AND cw_subject.subid = cw_credencemx.subid AND cw_credencemx.accsetid = :ll_accsetid AND cw_credencemx.credid = :ll_credid AND cw_subject.hsemp = 1; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询分录核算现金流量科目金额失败,'+sqlca.SQLErrText rslt = 0 GOTO ext END IF IF ld_debit = ld_credit THEN rslt = 1 GOTO ext END IF cnt = 0 SELECT count(*) INTO :cnt FROM cw_cashitem WHERE accsetid = :ll_accsetid AND credid = :ll_credid; IF sqlca.SQLCode <> 0 THEN arg_msg = '查询现金流量分配失败,'+sqlca.SQLErrText rslt = 0 GOTO ext END IF IF cnt = 0 THEN arg_msg = '现金流量未分配,请检查' rslt = 0 GOTO ext END IF ext: RETURN rslt end function public subroutine wf_text ();st_dft_cmonth.Text = '默认凭证月份:'+String(il_dft_cmonth) IF ii_if_dft_reldate = 1 THEN st_dft_reldate.Text = '默认相关日期:'+String(idt_dft_reldate,'yyyy-mm-dd') ELSE st_dft_reldate.Text = '默认相关日期:无' END IF end subroutine on w_credence_edit_popup.create int iCurrent call super::create this.cb_print=create cb_print this.cb_retrieve=create cb_retrieve this.cb_addzy=create cb_addzy this.cb_delet=create cb_delet this.cb_edit=create cb_edit this.cb_add=create cb_add this.cb_add_xm=create cb_add_xm this.cb_dele_xm=create cb_dele_xm this.cb_showall=create cb_showall this.cb_auditing=create cb_auditing this.dw_child=create dw_child this.cb_money=create cb_money this.dw_child_share=create dw_child_share this.st_3=create st_3 this.cb_cauditing=create cb_cauditing this.cb_print_1=create cb_print_1 this.ddlb_credtype=create ddlb_credtype this.st_dft_cmonth=create st_dft_cmonth this.cbx_1=create cbx_1 this.ddlb_status=create ddlb_status this.st_2=create st_2 this.st_4=create st_4 this.cb_other=create cb_other this.em_cmonth=create em_cmonth this.mle_msg=create mle_msg this.dw_uc=create dw_uc this.cb_auto_create=create cb_auto_create this.ln_5=create ln_5 this.ln_6=create ln_6 this.st_mxdscrp=create st_mxdscrp this.cb_dft=create cb_dft this.st_dft_reldate=create st_dft_reldate this.ln_1=create ln_1 this.ln_2=create ln_2 this.ln_3=create ln_3 this.ln_4=create ln_4 this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_print this.Control[iCurrent+2]=this.cb_retrieve this.Control[iCurrent+3]=this.cb_addzy this.Control[iCurrent+4]=this.cb_delet this.Control[iCurrent+5]=this.cb_edit this.Control[iCurrent+6]=this.cb_add this.Control[iCurrent+7]=this.cb_add_xm this.Control[iCurrent+8]=this.cb_dele_xm this.Control[iCurrent+9]=this.cb_showall this.Control[iCurrent+10]=this.cb_auditing this.Control[iCurrent+11]=this.dw_child this.Control[iCurrent+12]=this.cb_money this.Control[iCurrent+13]=this.dw_child_share this.Control[iCurrent+14]=this.st_3 this.Control[iCurrent+15]=this.cb_cauditing this.Control[iCurrent+16]=this.cb_print_1 this.Control[iCurrent+17]=this.ddlb_credtype this.Control[iCurrent+18]=this.st_dft_cmonth this.Control[iCurrent+19]=this.cbx_1 this.Control[iCurrent+20]=this.ddlb_status this.Control[iCurrent+21]=this.st_2 this.Control[iCurrent+22]=this.st_4 this.Control[iCurrent+23]=this.cb_other this.Control[iCurrent+24]=this.em_cmonth this.Control[iCurrent+25]=this.mle_msg this.Control[iCurrent+26]=this.dw_uc this.Control[iCurrent+27]=this.cb_auto_create this.Control[iCurrent+28]=this.ln_5 this.Control[iCurrent+29]=this.ln_6 this.Control[iCurrent+30]=this.st_mxdscrp this.Control[iCurrent+31]=this.cb_dft this.Control[iCurrent+32]=this.st_dft_reldate this.Control[iCurrent+33]=this.ln_1 this.Control[iCurrent+34]=this.ln_2 this.Control[iCurrent+35]=this.ln_3 this.Control[iCurrent+36]=this.ln_4 this.Control[iCurrent+37]=this.r_bar end on on w_credence_edit_popup.destroy call super::destroy destroy(this.cb_print) destroy(this.cb_retrieve) destroy(this.cb_addzy) destroy(this.cb_delet) destroy(this.cb_edit) destroy(this.cb_add) destroy(this.cb_add_xm) destroy(this.cb_dele_xm) destroy(this.cb_showall) destroy(this.cb_auditing) destroy(this.dw_child) destroy(this.cb_money) destroy(this.dw_child_share) destroy(this.st_3) destroy(this.cb_cauditing) destroy(this.cb_print_1) destroy(this.ddlb_credtype) destroy(this.st_dft_cmonth) destroy(this.cbx_1) destroy(this.ddlb_status) destroy(this.st_2) destroy(this.st_4) destroy(this.cb_other) destroy(this.em_cmonth) destroy(this.mle_msg) destroy(this.dw_uc) destroy(this.cb_auto_create) destroy(this.ln_5) destroy(this.ln_6) destroy(this.st_mxdscrp) destroy(this.cb_dft) destroy(this.st_dft_reldate) destroy(this.ln_1) destroy(this.ln_2) destroy(this.ln_3) destroy(this.ln_4) destroy(this.r_bar) end on event closequery;IF dw_edit_mode THEN Int ls_row = 0 dw_UC.AcceptText() ls_row = dw_UC.GetNextModified(0, Primary!)+& dw_UC.GetNextModified(0, Filter!)+dw_UC.DeletedCount() IF ls_row > 0 THEN IF MessageBox('是否保存','单据数据已经改变,是否确定要放弃保存?',Question!,YesNo!,2 ) = 2 THEN RETURN 1 END IF ELSE ls_row = dw_child.GetNextModified(0, Primary!)+& dw_child.GetNextModified(0, Filter!)+dw_child.DeletedCount() IF ls_row > 0 THEN IF MessageBox('是否保存','单据明细数据已经改变,是否确定要放弃保存?',Question!,YesNo!,2 ) = 2 THEN RETURN 1 END IF END IF END IF END IF end event event user_key;call super::user_key;IF KeyDown(KeyF6!) THEN this.TRIGGEREVENT('ue_f6') ELSEIF KeyDown(KeyF7!) THEN this.TRIGGEREVENT('ue_f7') ELSEIF KeyDown(KeyF8!) or KeyDown(KeyShift!) and KeyDown(KeyEnter!) THEN this.TRIGGEREVENT('ue_f8') ELSEIF KeyDown(KeyF9!) THEN this.TRIGGEREVENT('ue_f9') ELSEIF KeyDown(KeyF10!) THEN this.TRIGGEREVENT('ue_f10') ELSEIF KeyDown(KeyF11!) THEN this.TRIGGEREVENT('ue_f11') ELSEIF KeyDown(KeyF12!) THEN this.TRIGGEREVENT('ue_f12') ELSEIF KeyDown(KeyF4!) THEN if cb_add.enabled then cb_add.TRIGGEREVENT(CLICKED!) ELSEIF KeyDown(KeyF5!) THEN if cb_edit.enabled then cb_edit.TRIGGEREVENT(CLICKED!) end if end event event open;THIS.TriggerEvent('ue_before_open') wf_movetocenter() OLD_TITLE = THIS.Title s_tran = Message.PowerObjectParm IF NOT IsNull(s_tran) THEN retrieve_all = s_tran.if_retrieve_all mode = s_tran.work_mode arg_pkid = s_tran.arg_pkid arg_string_code = s_tran.arg_string_code if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效 ds_share = s_tran.ds_share i_cmonth = s_tran.e_long END IF dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关 dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关 dw_pageretr.SetTransObject (sqlca) pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字 ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select") ls_newselect = ori_oldselect ds_curquery = CREATE DATASTORE ds_curquery.DataObject = 'd_extr_find' ds_curquery.SetTransObject (sqlca) wf_editindex_lockf() sle_usual_query.Text = Trim(arg_string_code) em_cmonth.text = string(i_cmonth) //wf_refresh_interface() wf_change_childdw_face() IF NOT retrieve_all THEN THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve ELSE IF if_sharedata THEN ds_share.ShareData(dw_pageretr) ELSE wf_retrieveuc(dw_pageretr,ls_newselect,1) THIS.TriggerEvent('retrieve_pageretr') END IF END IF IF retrieve_all THEN THIS.TriggerEvent("ue_usual_query_filt") END IF uc_column_int = 10 //uc dw前7列可以编辑 child_column_int = 21 //子dw前19列可以编辑 uo_credence_ins = CREATE uo_credence end event event ue_before_open;dw_child_share.SetTransObject(sqlca) dw_child.SetTransObject(sqlca) dw_uc.SetTransObject(sqlca) il_dft_cmonth = sys_curyearmon wf_text() //2.凭证字 datawindowchild childdw_credword dw_uc.GetChild("credtype",childdw_credword) childdw_credword.SetTransObject (sqlca) childdw_credword.Retrieve(sys_accsetid) IF childdw_credword.RowCount() <= 0 THEN childdw_credword.InsertRow(0) END IF //3.结算方式 //datawindowchild childdw_banktypeid //dw_child_share.GetChild("cw_credencemx_billid",childdw_banktypeid) //childdw_banktypeid.SetTransObject (sqlca) //childdw_banktypeid.Retrieve(sys_accsetid) //IF childdw_banktypeid.RowCount() <= 0 THEN // childdw_banktypeid.InsertRow(0) //END IF ////5.项目 //datawindowchild childdw_itemid //dw_child_share.GetChild("cw_credencemx_itemid",childdw_itemid) //childdw_itemid.SetTransObject (sqlca) //childdw_itemid.Retrieve(sys_accsetid) //IF childdw_itemid.RowCount() <= 0 THEN // childdw_itemid.InsertRow(0) //END IF //6.外币 //datawindowchild childdw_moneyid //dw_child.GetChild("cw_subject_moneyid",childdw_moneyid) //childdw_moneyid.SetTransObject (sqlca) //childdw_moneyid.Retrieve(sys_accsetid) //IF childdw_moneyid.RowCount() <= 0 THEN // childdw_moneyid.InsertRow(0) //END IF // end event event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled Boolean cb_retrieve_enabled cb_nextpage_enabled = cb_nextpage.Enabled cb_retrieveall_enabled = cb_retrieveall.Enabled cb_nextpage.Enabled = FALSE cb_retrieveall.Enabled = FALSE dw_pageretr.ShareDataOff() dw_pageretr.Retrieve(sys_accsetid,cur_checkflag,cur_postflag,cur_credtype,i_cmonth) IF dw_pageretr.RowCount() > 0 AND dw_pageretr.GetRow() = 0 THEN dw_pageretr.SetRow(1) dw_pageretr.ShareData(dw_uc) wf_flagstatus_rf() THIS.TriggerEvent('retrieve_childdw') cb_nextpage.Enabled = cb_nextpage_enabled cb_retrieveall.Enabled = cb_retrieveall_enabled end event event key;this.triggerevent('user_key') end event event close; DESTROY uo_credence_ins end event event ue_filter;OPENWITHPARM(w_filter_query,dw_uc) STRING LS_EXPR LS_EXPR=Message.StringParm if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return dw_uc.setfilter(LS_EXPR) dw_uc.SetRedraw (false) dw_uc.filter() dw_pageretr.triggerevent('ue_after_filter') dw_uc.SetRedraw (true) end event event ue_sort;OPENwithparm(w_sortrow,dw_uc) STRING LS_EXPR LS_EXPR=Message.StringParm IF ISNULL(LS_EXPR) THEN LS_EXPR=' ' if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return dw_uc.setsort(LS_EXPR) dw_uc.SetRedraw (false) dw_uc.sort() dw_uc.SetRedraw (true) end event event ue_usual_query_filt;call super::ue_usual_query_filt;String obj_expr = '' IF Trim(sle_usual_query.Text) <> '' THEN obj_expr = obj_expr+'( credno = '+Trim(sle_usual_query.Text)+')' END IF dw_pageretr.SetFilter(obj_expr) dw_pageretr.SetRedraw(FALSE) dw_pageretr.Filter() IF dw_pageretr.RowCount() >= 1 THEN dw_pageretr.SelectRow(0,FALSE) dw_pageretr.SelectRow(1,TRUE) END IF dw_pageretr.SetRedraw(TRUE) end event event resize;call super::resize;ln_1.EndX = THIS.Width ln_2.EndX = THIS.Width r_bar.Width = THIS.Width Long w_width,w_height w_width = 3600 w_height = 2300 IF newwidth < w_width THEN THIS.Width = w_width IF newheight < w_height THEN THIS.Height = w_height dw_pageretr.Width = THIS.Width - (w_width - 549) dw_pageretr.Height = THIS.Height - (w_height - 1976) mle_msg.Width = dw_pageretr.Width mle_msg.Height = dw_pageretr.Height dw_uc.Height = THIS.Height - (w_height - 1772) dw_child.Height = THIS.Height - (w_height - 1300) dw_child_share.Y = THIS.Height - (w_height - 1428) ln_5.EndX = dw_pageretr.x - 5 ln_6.EndX = ln_5.EndX ln_3.EndX = ln_5.EndX ln_4.EndX = ln_5.EndX ln_1.EndX = ln_5.EndX ln_2.EndX = ln_5.EndX end event event ue_usual_query_retr;call super::ue_usual_query_retr;this.triggerevent('retrieve_pageretr') end event type cb_func from w_publ_pageretr`cb_func within w_credence_edit_popup integer x = 722 integer y = 28 integer width = 192 end type type cb_exit from w_publ_pageretr`cb_exit within w_credence_edit_popup integer x = 2670 integer y = 0 integer width = 151 integer height = 164 integer taborder = 300 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type sle_usual_query from w_publ_pageretr`sle_usual_query within w_credence_edit_popup integer x = 2866 integer y = 176 integer width = 128 boolean bringtotop = true end type type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_credence_edit_popup boolean visible = false integer x = 3150 integer y = 860 integer width = 151 integer taborder = 260 end type type em_pagerowno from w_publ_pageretr`em_pagerowno within w_credence_edit_popup boolean visible = false integer x = 3141 integer y = 736 integer height = 92 integer taborder = 240 boolean bringtotop = true end type type dw_pageretr from w_publ_pageretr`dw_pageretr within w_credence_edit_popup integer x = 2999 integer y = 176 integer width = 549 integer height = 1964 integer taborder = 50 string title = "凭证摘要内容" string dataobject = "dw_credence_index" end type event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;DW_UC.SetRow(currentrow) DW_UC.ScrollToRow (currentrow) IF NOT dw_edit_mode THEN PARENT.TriggerEvent('retrieve_childdw') wf_flagstatus_rf() end event event dw_pageretr::ue_after_filter;if not dw_edit_mode then parent.triggerevent('retrieve_childdw') end event type st_1 from w_publ_pageretr`st_1 within w_credence_edit_popup integer x = 1829 integer y = 196 integer width = 151 string text = "期间:" alignment alignment = center! end type type cb_nextpage from w_publ_pageretr`cb_nextpage within w_credence_edit_popup boolean visible = false integer x = 3177 integer y = 616 integer width = 151 integer taborder = 290 end type type cb_print from uo_imflatbutton within w_credence_edit_popup integer x = 2286 integer width = 192 integer height = 164 integer taborder = 200 string text = "预览&P" string normalpicname = "preview.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=本位币格式~tEvent=ue_print_view" menustr = menustr + "|" + "Text=外币格式~tEvent=ue_print_wb_view" menustr = menustr + "|" + "Text=-" menustr = menustr + "|" + "Text=预览打印列表凭证~tEvent=ue_print_list2" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = CREATE m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(THIS, menustr) dmPopupMenu.mf_PopMenu() DESTROY dmPopupMenu END IF end event type cb_retrieve from uo_imflatbutton within w_credence_edit_popup integer x = 1984 integer width = 151 integer height = 164 integer taborder = 130 string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;parent.triggerevent('retrieve_pageretr') end event type cb_addzy from uo_imflatbutton within w_credence_edit_popup integer x = 535 integer width = 192 integer height = 164 integer taborder = 220 boolean bringtotop = true boolean enabled = false string text = "获取&A" string normalpicname = "find.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT dw_edit_mode THEN RETURN Long child_row String ls_brief,ls_subid s_subject s_rt_subject dw_child.AcceptText() child_row = dw_child.GetRow() IF child_row <= 0 THEN MessageBox('系统提示','请选定当前目标凭证明细!') RETURN END IF IF dw_child.GetColumnName() = 'brief' THEN OPEN(w_briefdef_edit) ls_brief = Message.StringParm IF ls_brief = '' THEN RETURN dw_child.Object.brief[child_row] = ls_brief ELSEIF dw_child.GetColumnName() = 'subid' THEN IF cbx_1.Checked THEN IF NOT IsValid(w_subjectdef_edit) THEN OpenWithParm(w_subjectdef_edit,0) ELSE IF NOT IsValid(w_subjectdef_ch) THEN OpenWithParm(w_subjectdef_ch,Trim(dw_child.Object.subid[child_row])) END IF s_rt_subject = Message.PowerObjectParm IF s_rt_subject.subid = '' THEN RETURN wf_reshare_subid() dw_child.Object.subid[child_row] = s_rt_subject.subid dw_child.Object.cw_subject_moneyid[child_row] = s_rt_subject.moneyid dw_child.Object.cw_subject_hswb[child_row] = s_rt_subject.hswb dw_child.Object.cw_subject_hsqty[child_row] = s_rt_subject.hsqty dw_child.Object.cw_subject_hsdept[child_row] = s_rt_subject.hsdept dw_child.Object.cw_subject_hsemp[child_row] = s_rt_subject.hsemp dw_child.Object.cw_subject_hsitem[child_row] = s_rt_subject.hsitem dw_child.Object.cw_subject_dcflag[child_row] = s_rt_subject.dcflag dw_child.Object.cw_subject_hscust[child_row] = s_rt_subject.hscust dw_child.Object.cw_subject_hsspt[child_row] = s_rt_subject.hsspt dw_child.Object.cw_subject_hstrader[child_row] = s_rt_subject.hstrader wf_rtr_balc() IF s_rt_subject.hswb <> 0 THEN if_fcurrency = TRUE wf_change_childdw_face() IF s_rt_subject.hswb = 2 THEN Long ll_moneyid_native Decimal ld_rate SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate FROM cw_currency Where accsetid = :sys_accsetid AND native = 1; IF sqlca.SQLCode <> 0 THEN ll_moneyid_native = 0 ld_rate = 0 ELSE dw_child.Object.cw_subject_moneyid[child_row] = ll_moneyid_native dw_child.Object.rate[child_row] = ld_rate END IF END IF END IF END IF //cw_subject_hsdept //cw_subject_hsemp //cw_subject_hsitem //cw_subject_hsqty //cw_subject_hswb //cw_subject_moneyid //cw_subject_specialcode end event type cb_delet from uo_imflatbutton within w_credence_edit_popup integer x = 384 integer width = 151 integer height = 164 integer taborder = 210 string text = "删除" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT f_power_ind(1972,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF IF dw_edit_mode THEN RETURN IF MessageBox ("IF","是否确定要删除当前凭证吗?",Question!,YesNo! ) = 2 THEN RETURN String arg_msg = '' Long uc_row Long ls_subaccsetid,ls_credid uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN MessageBox('系统提示','请选定当前目标凭证!') RETURN END IF ls_subaccsetid = dw_uc.Object.subaccsetid[uc_row] ls_credid = dw_uc.Object.credid[uc_row] IF uo_credence_ins.del(0,ls_subaccsetid,ls_credid,arg_msg,TRUE) = 0 THEN MessageBox('Error!',arg_msg) ELSE //日志 String ls_credtype long ls_credno ls_credtype = dw_uc.Object.credtype[uc_row] ls_credno = dw_uc.Object.credno[uc_row] f_setsysoplog('凭证','删除,帐套:'+s_sys_accset.cropname+'字:'+ls_credtype+',号:'+string(ls_credno),arg_msg,TRUE) //-- MessageBox(publ_operator,'删除凭证'+String(dw_uc.Object.credno[uc_row])+'成功!') dw_pageretr.DeleteRow(uc_row) dw_pageretr.PostEvent(RowFocusChanged!) END IF end event type cb_edit from uo_imflatbutton within w_credence_edit_popup integer x = 192 integer width = 192 integer height = 164 integer taborder = 80 string text = "修改&E" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT f_power_ind(1971,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF String arg_msg = '' Long uc_row Long ls_subaccsetid,ls_credid uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN MessageBox('系统提示','请选定当前目标凭证!') RETURN END IF ls_subaccsetid = dw_uc.Object.subaccsetid[uc_row] ls_credid = dw_uc.Object.credid[uc_row] IF NOT dw_edit_mode THEN IF uo_credence_ins.UPDATEbegin(ls_subaccsetid,ls_credid,arg_msg) = 0 THEN MessageBox(publ_operator,arg_msg) RETURN END IF END IF IF dw_edit_mode THEN IF MessageBox ("IF","是否确定要放弃保存当前单据?",Question!,YesNo! ) = 2 THEN RETURN END IF dw_edit_mode = NOT dw_edit_mode wf_refresh_interface() IF dw_edit_mode THEN dw_uc.SetFocus() cur_editfoucs = 2 ELSE PARENT.TriggerEvent('retrieve_pageretr') IF if_fcurrency THEN if_fcurrency = FALSE wf_change_childdw_face() END IF cur_editfoucs = 0 END IF end event type cb_add from uo_imflatbutton within w_credence_edit_popup integer width = 192 integer height = 164 integer taborder = 70 string text = "新建&S" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT f_power_ind(1971,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF String arg_msg = '' Long uc_row Decimal sum_debit,sum_credit DateTime firstdate,enddate Long i Long ls_yearmon ls_yearmon = il_dft_cmonth IF ls_yearmon < s_sys_accset.curryear THEN MessageBox(publ_operator,'默认凭证月份小于当前会计期间,操作取消!') RETURN END IF IF dw_edit_mode THEN dw_uc.AcceptText() dw_child.AcceptText() dw_child_share.AcceptText() uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN MessageBox(publ_operator,'请选定当前目标凭证!') RETURN END IF IF sys_option_credno_save = 0 THEN IF dw_uc.Object.credno[uc_row] <= 0 THEN MessageBox(publ_operator,'请正确填写凭证编号!') RETURN END IF END IF sum_debit = dw_child.Object.sum_debit[1] sum_credit = dw_child.Object.sum_credit[1] IF sum_debit <> 0 OR sum_credit <> 0 THEN IF String(sum_debit,'###0.00') <> String(sum_credit,'###0.00') THEN IF (String(sum_debit,'###0.00') = '0.00' OR String(sum_debit,'###0.00') = '-0.00') AND & (String(sum_credit,'###0.00') = '0.00' OR String(sum_credit,'###0.00') = '-0.00') THEN ELSE MessageBox(publ_operator,'借、贷方金额不等!') RETURN END IF END IF END IF //==================================================================== // script - clicked for cb_add // reason:检查数量是否已录入 //-------------------------------------------------------------------- // modified by: yyx date: 2004.02.17 //-------------------------------------------------------------------- FOR i = 1 TO dw_child.RowCount() String is_subid,is_brief Int is_hsqty Decimal is_amount,is_price is_brief = dw_child.Object.brief[i] is_subid = dw_child.Object.subid[i] is_hsqty = dw_child.Object.cw_subject_hsqty[i] is_amount = dw_child.Object.cw_credencemx_amount[i] is_price = dw_child.Object.cw_credencemx_price[i] IF IsNull(is_hsqty) THEN is_hsqty = 0 IF IsNull(is_amount) THEN is_amount = 0 IF IsNull(is_price) THEN is_price = 0 IF is_hsqty = 1 AND is_amount = 0 AND is_price = 0 THEN IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"没有录入数量,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN END IF Int li_hsdept,li_hsitem,li_hscust,li_hsspt Long ll_itemid,ll_deptid,ll_cusid,ll_sptid li_hsdept = dw_child.Object.cw_subject_hsdept[i] ll_deptid = dw_child.Object.cw_credencemx_deptid[i] li_hsitem = dw_child.Object.cw_subject_hsitem[i] ll_itemid = dw_child.Object.cw_credencemx_itemid[i] li_hscust = dw_child.Object.cw_subject_hscust[i] ll_cusid = dw_child.Object.cw_credencemx_cusid[i] li_hsspt = dw_child.Object.cw_subject_hsspt[i] ll_sptid = dw_child.Object.cw_credencemx_sptid[i] IF IsNull(li_hsdept) THEN li_hsdept = 0 IF IsNull(ll_deptid) THEN ll_deptid = 0 IF IsNull(li_hsitem) THEN li_hsitem = 0 IF IsNull(ll_itemid) THEN ll_itemid = 0 IF IsNull(li_hscust) THEN li_hscust = 0 IF IsNull(ll_cusid) THEN ll_cusid = 0 IF IsNull(li_hsspt) THEN li_hsspt = 0 IF IsNull(ll_sptid) THEN ll_sptid = 0 IF li_hsdept = 1 AND ll_deptid = 0 THEN IF sys_option_cred_dics_limit = 0 THEN IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算部门,分录没有选择部门,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN ELSE MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算部门,分录没有选择部门,不能保存当前凭证,请检查") END IF END IF IF li_hsitem = 1 AND ll_itemid = 0 THEN IF sys_option_cred_dics_limit = 0 THEN IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算项目,分录没有选择项目,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN ELSE MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算项目,分录没有选择项目,不能保存当前凭证,请检查") END IF END IF IF li_hscust = 1 AND ll_cusid = 0 THEN IF sys_option_cred_dics_limit = 0 THEN IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算客户,分录没有选择客户,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN ELSE MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算客户,分录没有选择客户,不能保存当前凭证,请检查") END IF END IF IF li_hsspt = 1 AND ll_sptid = 0 THEN IF sys_option_cred_dics_limit = 0 THEN IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算供应商,分录没有选择供应商,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN ELSE MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算供应商,分录没有选择供应商,不能保存当前凭证,请检查") END IF END IF NEXT //==================================================================== //==================================================================== // script - clicked for cb_add // reason:检查贷方是否录入现金银行 //-------------------------------------------------------------------- // modified by: yyx date: 2004.02.17 //-------------------------------------------------------------------- IF sys_bank_awoke = 1 THEN FOR i = 1 TO dw_child.RowCount() Dec arg_rawdebit,arg_rawcredit IF dw_child.Object.debit[i] <> 0 THEN arg_rawdebit = dw_child.Object.cw_credencemx_rawmoney[i] arg_rawcredit = 0 ELSEIF dw_child.Object.credit[i] <> 0 THEN arg_rawdebit = 0 arg_rawcredit = dw_child.Object.cw_credencemx_rawmoney[i] END IF IF f_check_credit(dw_uc.Object.credid[uc_row],dw_child.Object.subid[i],& dw_child.Object.debit[i],dw_child.Object.credit[i],& arg_rawdebit,arg_rawcredit,arg_msg) = 0 THEN IF MessageBox ("询问","科目:"+String(dw_child.Object.subid[i])+" 为现金或银行余额贷方分录,是否确定要保存当前凭证吗? ~n" + arg_msg,question!,yesno! ) = 2 THEN RETURN END IF NEXT END IF //==================================================================== uo_credence_ins.subaccsetid = dw_uc.Object.subaccsetid[uc_row] //子帐id uo_credence_ins.credno = dw_uc.Object.credno[uc_row] // 编号 uo_credence_ins.creddate = dw_uc.Object.creddate[uc_row] // 日期 uo_credence_ins.billnumber = dw_uc.Object.billnumber[uc_row] //附件 uo_credence_ins.credtype = dw_uc.Object.credtype[uc_row] //凭证字 uo_credence_ins.reldcode = dw_uc.Object.reldcode[uc_row] //凭证字 uo_credence_ins.reldate = dw_uc.Object.reldate[uc_row] //凭证字 uo_credence_ins.ifauto = 0 IF s_tran.c_long > 0 THEN uo_credence_ins.readtype = s_tran.c_long ELSE uo_credence_ins.readtype = dw_uc.Object.readtype[uc_row] END IF uo_credence_ins.relevantbillid = s_tran.d_long uo_credence_ins.cmonth = ls_yearmon // 日期 FOR i = 1 TO dw_child.RowCount() Dec ls_rawdebit,ls_rawcredit,ls_price,ls_amount String ls_brief IF dw_child.Object.debit[i] <> 0 THEN ls_rawdebit = dw_child.Object.cw_credencemx_rawmoney[i] ls_rawcredit = 0 ELSEIF dw_child.Object.credit[i] <> 0 THEN ls_rawdebit = 0 ls_rawcredit = dw_child.Object.cw_credencemx_rawmoney[i] END IF ls_amount = dw_child.Object.cw_credencemx_amount[i] IF ls_amount = 0 THEN ls_price = 0 ELSE ls_price = Round((dw_child.Object.debit[i] + dw_child.Object.credit[i])/ls_amount ,4) END IF ls_brief = Trim(dw_child.Object.brief[i]) IF uo_credence_ins.acceptmx(dw_child.Object.no[i],dw_child.Object.subid[i],& ls_brief,dw_child.Object.rate[i],ls_rawdebit,& ls_rawcredit,dw_child.Object.debit[i],dw_child.Object.credit[i],& ls_amount,ls_price,& dw_child.Object.cw_credencemx_deptid[i],dw_child.Object.cw_credencemx_itemid[i],& dw_child.Object.cw_credencemx_billdate[i],dw_child.Object.cw_credencemx_billid[i],& dw_child.Object.cw_credencemx_billno[i],dw_child.Object.cropbillid[i],& dw_child.Object.cw_credencemx_readonly[i],& dw_child.Object.cw_credencemx_cusid[i],& dw_child.Object.cw_credencemx_sptid[i],& dw_child.Object.cw_credencemx_empid[i] ,arg_msg) = 0 THEN MessageBox('error!',arg_msg) RETURN END IF NEXT IF uo_credence_ins.Save(publ_operator,arg_msg,TRUE) = 0 THEN MessageBox('error!',arg_msg) RETURN END IF MessageBox(publ_operator,'保存操作成功!') //write ini SetProfileString (sys_inifilename,publ_userid+'_'+dw_uc.DataObject, String(sys_accsetid),dw_uc.Object.credtype[dw_uc.GetRow()]) // dw_pageretr.SelectRow(0,FALSE) dw_pageretr.SelectRow(uc_row,TRUE) wf_refresh_curuc(uo_credence_ins.subaccsetid,uo_credence_ins.credid) //刷新uc IF if_fcurrency THEN if_fcurrency = FALSE wf_change_childdw_face() END IF ELSE IF uo_credence_ins.newbegin() = 0 THEN MessageBox('error!',arg_msg) RETURN END IF END IF //call super::clicked IF NOT dw_edit_mode THEN Int li_row, li_cur_row li_cur_row = dw_pageretr.GetRow() li_row = dw_pageretr.InsertRow (li_cur_row) dw_pageretr.ScrollToRow (li_row) END IF dw_edit_mode = NOT dw_edit_mode wf_refresh_interface() IF dw_edit_mode THEN dw_child.Reset() FOR i = 1 TO sys_credence_insertrow dw_child.InsertRow(0) NEXT // dw_uc.SetRedraw(FALSE) //read ini String ls_credtype_ini ls_credtype_ini = ProfileString(sys_inifilename,publ_userid+'_'+dw_uc.DataObject,String(sys_accsetid),'') dw_uc.Object.credtype[li_row] = ls_credtype_ini // dw_uc.AcceptText() String ls_credtype DateTime ls_creddate ls_credtype = Trim(dw_uc.Object.credtype[li_row]) IF sys_option_credno_save = 0 THEN dw_uc.Object.credno[li_row] = uo_credence_ins.get_new_credno(0,ls_credtype,ls_yearmon,arg_msg) IF Trim(arg_msg) <> '' THEN MessageBox('提示',arg_msg) END IF ls_creddate = f_rst_mon_1st(3,ls_yearmon) dw_uc.Object.creddate[li_row] = ls_creddate IF ii_if_dft_reldate = 0 THEN dw_uc.Object.reldate[li_row] = ls_creddate ELSE dw_uc.Object.reldate[li_row] = idt_dft_reldate END IF dw_uc.SetColumn("reldate") // dw_uc.SetRedraw(TRUE) dw_uc.SetFocus() cur_editfoucs = 1 ELSE cur_editfoucs = 0 PARENT.TriggerEvent("retrieve_childdw") IF sys_option_cred_auto_savecreate = 1 THEN cb_auto_create.TriggerEvent(Clicked!) END IF end event type cb_add_xm from uo_imflatbutton within w_credence_edit_popup integer x = 1070 integer width = 265 integer height = 164 integer taborder = 90 boolean enabled = false string text = "插明细F8" string normalpicname = "mx.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;int li_row_1, li_cur_row_1 li_cur_row_1 = dw_child.GetRow() li_row_1 = dw_child.InsertRow (li_cur_row_1) dw_child.ScrollToRow (li_row_1) dw_child.SetFocus() end event type cb_dele_xm from uo_imflatbutton within w_credence_edit_popup integer x = 1335 integer width = 224 integer height = 164 integer taborder = 100 boolean enabled = false string text = "删明细" string normalpicname = "mx1.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF MessageBox ("IF","是否确定要删除当前细目记录?",Question!,YesNo! ) = 2 THEN RETURN IF dw_child.GETROW()=0 THEN MESSAGEBOX('NO','请选择删除的行对象!') RETURN END IF dw_child.DeleteRow (0) dw_child.TriggerEvent (rowfocuschanged!) end event type cb_showall from uo_imflatbutton within w_credence_edit_popup integer x = 2135 integer width = 151 integer height = 164 integer taborder = 190 string text = "所有" string normalpicname = "setting.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;dw_uc.setfilter('') dw_uc.SetRedraw (false) dw_uc.filter() dw_uc.SetRedraw (true) end event type cb_auditing from uo_imflatbutton within w_credence_edit_popup integer x = 727 integer width = 192 integer height = 164 integer taborder = 250 boolean bringtotop = true string text = "审核&F" string normalpicname = "audit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT f_power_ind(1973,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long pagerert_row Long ls_subaccsetid,ls_credid pagerert_row = dw_uc.GetRow() IF pagerert_row <= 0 THEN MessageBox('系统提示','请选定当前目标凭证!') RETURN END IF IF MessageBox ("IF","是否确定要"+THIS.Text+"当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN ls_subaccsetid = dw_uc.Object.subaccsetid[pagerert_row] ls_credid = dw_uc.Object.credid[pagerert_row] IF wf_check_cash(arg_msg) = 0 THEN MessageBox('提示',arg_msg) RETURN END IF IF uo_credence_ins.Check(ls_subaccsetid,ls_credid,arg_msg,TRUE) = 0 THEN MessageBox('Error!',arg_msg) ELSE MessageBox(publ_operator,'审核成功!') wf_refresh_curuc(ls_subaccsetid,ls_credid) END IF end event type dw_child from u_dw_rbtnfilter within w_credence_edit_popup event dwnkey pbm_dwnkey integer x = 5 integer y = 652 integer width = 2990 integer height = 1300 integer taborder = 30 boolean bringtotop = true string dataobject = "dw_credencemx_index_popup" boolean vscrollbar = true borderstyle borderstyle = stylebox! end type event dwnkey;PARENT.TriggerEvent('user_key') String ls_subid,ls_briefcode,ls_briefname,ls_dftsubid,ls_subid_find,ls_subid_like Long ls_moneyid,cnt Int ls_hswb,ls_hsqty,ls_hsdept,ls_hsemp,ls_hsitem,ls_dcflag,ls_hscust,ls_hsspt,ls_hstrader Dec ls_rawmoney Double ls_rawrate Long child_row IF dw_edit_mode THEN child_row = dw_child.GetRow() IF child_row <= 0 THEN RETURN // IF (KeyDown(keyenter!) OR KeyDown(keytab!)) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN IF KeyDown(keyenter!) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN IF dw_child.GetColumnName() = 'brief' THEN dw_child.AcceptText() ls_briefcode = dw_child.Object.brief[child_row] IF ls_briefcode <> '' THEN SELECT top 1 briefname,dftsubid INTO :ls_briefname,:ls_dftsubid FROM cw_brief WHERE (briefcode = :ls_briefcode OR briefname = :ls_briefcode) AND accsetid = :sys_accsetid; IF sqlca.SQLCode <> 0 OR IsNull(ls_briefname) THEN ls_briefname = '' IF ls_briefname <> '' THEN dw_child.Object.brief[child_row] = ls_briefname IF dw_child.Object.subid[child_row] = '' THEN dw_child.Object.subid[child_row] = ls_dftsubid END IF END IF END IF IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF ELSEIF dw_child.GetColumnName() = 'subid' THEN dw_child.AcceptText() ls_subid = dw_child.Object.subid[child_row] ls_subid_like = '%'+ls_subid+'%' SELECT count(*) INTO :cnt FROM cw_subject WHERE ( cw_subject.subid LIKE :ls_subid_like OR cw_subject.name LIKE :ls_subid_like ) AND cw_subject.accsetid = :sys_accsetid; IF sqlca.SQLCode <> 0 THEN cb_addzy.TriggerEvent(Clicked!) RETURN 1 END IF IF cnt <> 1 THEN cb_addzy.TriggerEvent(Clicked!) RETURN 1 END IF SELECT top 1 cw_subject.moneyid,hswb,hsqty,hsdept,hsemp,hsitem,dcflag,cw_currency.rate, hscust,hsspt,cw_subject.subid,cw_subject.hstrader INTO :ls_moneyid,:ls_hswb,:ls_hsqty,:ls_hsdept, :ls_hsemp,:ls_hsitem,:ls_dcflag,:ls_rawrate,:ls_hscust,:ls_hsspt,:ls_subid_find,:ls_hstrader FROM cw_subject left OUTER join cw_currency on cw_subject.accsetid = cw_currency.accsetid AND cw_subject.moneyid = cw_currency.moneyid WHERE ( cw_subject.subid LIKE :ls_subid_like OR cw_subject.name LIKE :ls_subid_like ) AND cw_subject.accsetid = :sys_accsetid; IF sqlca.SQLCode <> 0 THEN cb_addzy.TriggerEvent(Clicked!) RETURN 1 END IF dw_child.Object.cw_subject_moneyid[child_row] = ls_moneyid dw_child.Object.cw_subject_hswb[child_row] = ls_hswb dw_child.Object.cw_subject_hsqty[child_row] = ls_hsqty dw_child.Object.cw_subject_hsdept[child_row] = ls_hsdept dw_child.Object.cw_subject_hsemp[child_row] = ls_hsemp dw_child.Object.cw_subject_hsitem[child_row] = ls_hsitem dw_child.Object.cw_subject_dcflag[child_row] = ls_dcflag dw_child.Object.cw_subject_hscust[child_row] = ls_hscust dw_child.Object.cw_subject_hsspt[child_row] = ls_hsspt dw_child.Object.cw_subject_hstrader[child_row] = ls_hstrader dw_child.Object.subid[child_row] = ls_subid_find wf_rtr_balc() IF ls_hswb <> 0 THEN if_fcurrency = TRUE dw_child.Object.rate[child_row] = ls_rawrate wf_change_childdw_face() IF ls_hswb = 2 THEN Long ll_moneyid_native Decimal ld_rate SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate FROM cw_currency Where accsetid = :sys_accsetid AND native = 1; IF sqlca.SQLCode <> 0 THEN ll_moneyid_native = 0 ld_rate = 0 ELSE dw_child.Object.cw_subject_moneyid[child_row] = ll_moneyid_native dw_child.Object.rate[child_row] = ld_rate END IF END IF ELSE dw_child.Object.rate[child_row] = 0 END IF IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF ELSEIF dw_child.GetColumnName() = 'cw_credencemx_rawmoney' THEN dw_child.AcceptText() IF dw_child.Object.cw_subject_moneyid[child_row] > 0 THEN ls_rawrate = dw_child.Object.rate[child_row] ls_rawmoney = dw_child.Object.cw_credencemx_rawmoney[child_row] IF dw_child.Object.cw_subject_dcflag[child_row] = 1 THEN dw_child.Object.debit[child_row] = Round(ls_rawmoney * ls_rawrate,2) ELSE dw_child.Object.credit[child_row] = Round(ls_rawmoney * ls_rawrate,2) END IF IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF END IF ELSEIF dw_child.GetColumnName() = 'debit' THEN dw_child.AcceptText() wf_rtr_balc() IF dw_child.Object.debit[child_row] <> 0 THEN dw_child.Object.credit[child_row] = 0 IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 ELSEIF Key = KeySpaceBar! THEN dw_child.SetRedraw(FALSE) dw_child.SetColumn('credit') dw_child.Object.credit[child_row] = dw_child.Object.debit[child_row] dw_child.Object.debit[child_row] = 0 dw_child.SetRedraw(TRUE) RETURN 1 END IF ELSEIF dw_child.GetColumnName() = 'credit' THEN dw_child.AcceptText() wf_rtr_balc() IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 ELSEIF Key = KeySpaceBar! THEN dw_child.SetRedraw(FALSE) dw_child.SetColumn('debit') dw_child.Object.debit[child_row] = dw_child.Object.credit[child_row] dw_child.Object.credit[child_row] = 0 dw_child.SetRedraw(TRUE) RETURN 1 END IF IF dw_child.Object.credit[child_row] <> 0 THEN dw_child.Object.debit[child_row] = 0 dw_child.AcceptText() END IF ELSE IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF END IF ELSE IF KeyDown( KeyF12!) AND dw_child.GetColumnName() = 'brief' THEN dw_child.AcceptText() dw_child.SetRedraw(FALSE) IF child_row > 1 THEN dw_child.Object.brief[child_row] = dw_child.Object.brief[child_row - 1] END IF dw_child.SetRedraw(TRUE) elseIF KeyDown( KeyF11!) AND dw_child.GetColumnName() = 'brief' THEN dw_child.AcceptText() dw_child.SetRedraw(FALSE) IF child_row > 1 THEN dw_child.Object.brief[child_row] = dw_child.Object.brief[1] END IF dw_child.SetRedraw(TRUE) END IF END IF END IF end event event constructor;call super::constructor;titleclick_sort_use=true end event event clicked;call super::clicked;//IF row > 0 THEN // // // this.setrow(row) // this.selectrow(0,false) // this.selectrow(row,true) // // dw_child_share.SETROW(this.getrow()) // dw_child_share.ScrollToRow (this.getrow()) //end if end event event doubleclicked;IF NOT dw_edit_mode THEN RETURN dw_child.AcceptText() IF dwo.Name = 'cw_subject_moneyid' THEN IF dw_child.Object.cw_subject_hswb[row] = 2 THEN IF NOT IsValid(w_currency_ch) THEN OPEN(w_currency_ch) s_currency s_ch_rst s_ch_rst = Message.PowerObjectParm IF s_ch_rst.moneyid = 0 THEN RETURN dw_child.Object.cw_subject_moneyid[row] = s_ch_rst.moneyid dw_child.Object.rate[row] = s_ch_rst.rate dw_child.setcolumn('cw_credencemx_rawmoney') END IF END IF ELSE cb_addzy.TriggerEvent(Clicked!) END IF end event event rowfocuschanged;Long ll_getrow ll_getrow = THIS.GetRow() IF ll_getrow <= 0 THEN st_mxdscrp.Text = '' ELSE THIS.SelectRow(0,FALSE) THIS.SetRow(ll_getrow) THIS.ScrollToRow (ll_getrow) THIS.SelectRow(ll_getrow,TRUE) THIS.AcceptText() st_mxdscrp.Text = '分录:'+String(ll_getrow)+',搞要:'+THIS.Object.brief[ll_getrow] dw_child_share.SetRow(ll_getrow) dw_child_share.ScrollToRow (ll_getrow) END IF IF dw_edit_mode THEN wf_rtr_balc() IF sys_option_lbrief = 1 AND ll_getrow > 1 AND cur_editfoucs = 1 THEN dw_child.Object.brief[ll_getrow] = dw_child.Object.brief[ll_getrow - 1 ] END IF END IF end event event itemchanged; IF NOT dw_edit_mode THEN RETURN String ls_subid Long ll_moneyid Int li_hswb,li_hsqty,li_hsdept,li_hsemp,li_hsitem,li_dcflag,li_hscust,li_hsspt dw_child.AcceptText() IF row <= 0 THEN RETURN IF dwo.Name = 'subid' THEN ls_subid = dw_child.Object.subid[row] SELECT moneyid,hswb,hsqty,hsdept,hsemp,hsitem,dcflag,hscust,hsspt INTO :ll_moneyid,:li_hswb,:li_hsqty,:li_hsdept,:li_hsemp, :li_hsitem,:li_dcflag,:li_hscust,:li_hsspt FROM cw_subject WHERE accsetid = :sys_accsetid AND subid = :ls_subid; IF sqlca.SQLCode <> 0 THEN RETURN wf_reshare_subid() dw_child.Object.cw_subject_moneyid[row] = ll_moneyid dw_child.Object.cw_subject_hswb[row] = li_hswb dw_child.Object.cw_subject_hsqty[row] = li_hsqty dw_child.Object.cw_subject_hsdept[row] = li_hsdept dw_child.Object.cw_subject_hsemp[row] = li_hsemp dw_child.Object.cw_subject_hsitem[row] = li_hsitem dw_child.Object.cw_subject_hscust[row] = li_hscust dw_child.Object.cw_subject_hsspt[row] = li_hsspt dw_child.Object.cw_subject_dcflag[row] = li_dcflag IF li_hswb <> 0 THEN if_fcurrency = TRUE wf_change_childdw_face() IF li_hswb = 2 THEN Long ll_moneyid_native Decimal ld_rate SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate FROM cw_currency Where accsetid = :sys_accsetid AND native = 1; IF sqlca.SQLCode <> 0 THEN ll_moneyid_native = 0 ld_rate = 0 ELSE dw_child.Object.cw_subject_moneyid[row] = ll_moneyid_native dw_child.Object.rate[row] = ld_rate END IF END IF END IF END IF //cw_subject_hsdept //cw_subject_hsemp //cw_subject_hsitem //cw_subject_hsqty //cw_subject_hswb //cw_subject_moneyid //cw_subject_specialcode end event type cb_money from uo_imflatbutton within w_credence_edit_popup integer x = 1559 integer width = 151 integer height = 164 integer taborder = 170 boolean bringtotop = true string text = "外币" string normalpicname = "p2.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;if_fcurrency = NOT if_fcurrency wf_change_childdw_face() end event type dw_child_share from datawindow within w_credence_edit_popup event key pbm_dwnkey integer x = 46 integer y = 1428 integer width = 1774 integer height = 520 integer taborder = 60 boolean bringtotop = true string dataobject = "dw_credencemx_index2_popup" boolean border = false boolean livescroll = true end type event key;PARENT.TriggerEvent('user_key') IF Key = keyenter! THEN RETURN 1 end event event itemchanged;if not dw_edit_mode then return dec ls_amount,ls_price,ls_amt long child_row,uc_row dw_child_share.accepttext() dw_child.accepttext() child_row = dw_child_share.getrow() uc_row = dw_child.getrow() if child_row <= 0 then return if uc_row <= 0 then return ls_amt = dw_child.object.debit[uc_row] + dw_child.object.credit[uc_row] if string(dwo.name) = 'cw_credencemx_amount' then if dw_child_share.object.cw_subject_hsqty[child_row] > 0 or dw_child.object.cw_subject_hsqty[child_row] > 0 then ls_amount = dw_child_share.object.cw_credencemx_amount[child_row] if ls_amount > 0 then ls_price = round(ls_amt/ls_amount,4) end if dw_child_share.object.cw_credencemx_price[child_row] = ls_price end if elseif string(dwo.name) = 'cw_credencemx_price' then if dw_child_share.object.cw_subject_hsqty[child_row] > 0 or dw_child.object.cw_subject_hsqty[child_row] > 0 then ls_amount = dw_child_share.object.cw_credencemx_amount[child_row] if ls_amount > 0 then ls_price = round(ls_amt/ls_amount,4) end if dw_child_share.object.cw_credencemx_price[child_row] = ls_price end if end if //cw_credencemx_amount end event event buttonclicked;IF row <= 0 THEN RETURN //IF dw_edit_mode THEN // s_edit_index_tran s_ch_tran //传递参数使用 // s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行 // s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 // s_ch_tran.arg_pkid = 0 //目标定位PKID (备用) // s_ch_tran.arg_string_code = ''//查询列(物料编码)部分内容,用于初步筛选 // // IF dwo.Name = 'b_dept' THEN // IF THIS.Object.cw_subject_hsdept[row] = 0 THEN // MessageBox('提示','科目不是核算部门,不能选择部门') // RETURN // END IF // // IF NOT IsValid(w_department_ch) THEN // OPEN(w_department_ch) // // Long ll_deptid // ll_deptid = Message.DoubleParm // // IF ll_deptid > 0 THEN // THIS.Object.cw_credencemx_deptid[row] = ll_deptid // END IF // END IF // ELSEIF dwo.Name = 'b_item' THEN // // IF THIS.Object.cw_subject_hsitem[row] = 0 THEN // MessageBox('提示','科目不是核算银行,不能选择银行') // RETURN // END IF // IF NOT IsValid(w_hsaccount_ch) THEN // OPEN(w_hsaccount_ch) // // s_accounts s_account // s_account = Message.PowerObjectParm // // IF s_account.accountsid > 0 THEN // THIS.Object.cw_credencemx_itemid[row] = s_account.accountsid // END IF // END IF // ELSEIF dwo.Name = 'b_emp' THEN // // IF THIS.Object.cw_subject_hstrader[row] = 0 THEN // MessageBox('提示','科目不是核算个人,不能选择个人') // RETURN // END IF // IF NOT IsValid(w_empinfo_choice) THEN // OPEN(w_empinfo_choice) // // s_empselect s_select // s_select = Message.PowerObjectParm // // IF s_select.empid > 0 THEN // THIS.Object.cw_credencemx_empid[row] = s_select.empid // END IF // END IF // ELSEIF dwo.Name = 'b_cust' THEN // // IF THIS.Object.cw_subject_hscust[row] = 0 THEN // MessageBox('提示','科目不是核算客户,不能选择客户') // RETURN // END IF // // IF NOT IsValid(W_cust_edit) THEN // OpenWithParm(W_cust_edit,s_ch_tran) //调用 // // s_custom S_INSCUST_cust // S_INSCUST_cust = Message.PowerObjectParm //接受返回结构 // // IF S_INSCUST_cust.cusid > 0 THEN //正常返回值则可以取以下值 // THIS.SetRedraw(FALSE) // THIS.Object.cw_credencemx_cusid[row] = S_INSCUST_cust.cusid // THIS.SetRedraw(TRUE) // END IF // END IF // ELSEIF dwo.Name = 'b_spt' THEN // // IF THIS.Object.cw_subject_hsspt[row] = 0 THEN // MessageBox('提示','科目不是核算供应商,不能选择供应商') // RETURN // END IF // // IF NOT IsValid(W_spt_edit) THEN // OpenWithParm(W_spt_edit,s_ch_tran) //调用 // // S_spt S_INSCUST_spt // S_INSCUST_spt = Message.PowerObjectParm //接受返回结构 // // IF S_INSCUST_spt.sptid > 0 THEN //正常返回值则可以取以下值 // THIS.SetRedraw(FALSE) // THIS.Object.cw_credencemx_sptid[row] = S_INSCUST_spt.sptid // THIS.SetRedraw(TRUE) // END IF // END IF // END IF //END IF end event type st_3 from statictext within w_credence_edit_popup integer x = 2697 integer y = 196 integer width = 151 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean enabled = false string text = "编号" alignment alignment = right! boolean focusrectangle = false end type type cb_cauditing from uo_imflatbutton within w_credence_edit_popup integer x = 919 integer width = 151 integer height = 164 integer taborder = 230 boolean bringtotop = true string text = "撤审" string normalpicname = "caudit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;IF NOT f_power_ind(1974,sys_msg_pow) THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long pagerert_row Long ls_subaccsetid,ls_credid pagerert_row = dw_uc.GetRow() IF pagerert_row <= 0 THEN MessageBox('系统提示','请选定当前目标凭证!') RETURN END IF IF MessageBox ("IF","是否确定要"+THIS.Text+"当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN ls_subaccsetid = dw_uc.Object.subaccsetid[pagerert_row] ls_credid = dw_uc.Object.credid[pagerert_row] IF uo_credence_ins.cancel_check_1(ls_subaccsetid,ls_credid,1,arg_msg,TRUE) = 0 THEN MessageBox('Error!',arg_msg) ELSE MessageBox(publ_operator,'撤审成功!') wf_refresh_curuc(ls_subaccsetid,ls_credid) END IF end event type cb_print_1 from uo_imflatbutton within w_credence_edit_popup integer x = 2478 integer width = 192 integer height = 164 integer taborder = 160 boolean bringtotop = true string text = "打印&O" string normalpicname = "print.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=本位币格式~tEvent=ue_print" menustr = menustr + "|" + "Text=外币格式~tEvent=ue_print_wb" menustr = menustr + "|" + "Text=-" menustr = menustr + "|" + "Text=打印列表凭证~tEvent=ue_print_list" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = CREATE m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(THIS, menustr) dmPopupMenu.mf_PopMenu() DESTROY dmPopupMenu END IF end event type ddlb_credtype from dropdownlistbox within w_credence_edit_popup integer x = 2437 integer y = 180 integer width = 293 integer height = 512 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean vscrollbar = true borderstyle borderstyle = stylelowered! end type event constructor;String ls_credtype DECLARE cur_credtype_1 CURSOR FOR SELECT cw_Credenceword.Credenceword FROM cw_Credenceword Where accsetid = :sys_accsetid; OPEN cur_credtype_1; FETCH cur_credtype_1 INTO :ls_credtype; DO WHILE sqlca.SQLCode = 0 THIS.AddItem(ls_credtype) FETCH cur_credtype_1 INTO :ls_credtype; LOOP CLOSE cur_credtype_1; THIS.AddItem('[全部]') THIS.Text = '[全部]' end event event selectionchanged;cur_credtype = THIS.Text IF THIS.Text = '[全部]' THEN cur_credtype = '-1' PARENT.TriggerEvent("retrieve_pageretr") end event type st_dft_cmonth from statictext within w_credence_edit_popup integer x = 5 integer y = 176 integer width = 654 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 82700779 boolean enabled = false string text = "默认凭证月份" boolean focusrectangle = false end type type cbx_1 from checkbox within w_credence_edit_popup integer x = 859 integer y = 196 integer width = 498 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "选会计科目定义" boolean checked = true end type event clicked;Int li_ifdy IF THIS.Checked THEN li_ifdy = 1 ELSE li_ifdy = 0 END IF SetProfileString (sys_inifilename,dw_pageretr.DataObject, "ifdy", String(li_ifdy)) end event event constructor;Int li_ifdy li_ifdy = Integer(ProfileString (sys_inifilename,dw_pageretr.DataObject, "ifdy", '1')) IF li_ifdy = 0 THEN THIS.Checked = FALSE ELSE THIS.Checked = TRUE END IF end event type ddlb_status from dropdownlistbox within w_credence_edit_popup integer x = 1499 integer y = 180 integer width = 320 integer height = 452 integer taborder = 120 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "[全部]" boolean sorted = false boolean vscrollbar = true string item[] = {"[全部]","待审核","待过帐","过帐完毕"} borderstyle borderstyle = stylelowered! end type event selectionchanged;if index=1 then cur_checkflag=-1 cur_postflag= -1 elseif index=2 then cur_checkflag= 0 cur_postflag= 0 elseif index=3 then cur_checkflag= 1 cur_postflag= 0 elseif index=4 then cur_checkflag= 1 cur_postflag= 1 end if parent.triggerevent("retrieve_pageretr") end event type st_2 from statictext within w_credence_edit_popup integer x = 1344 integer y = 196 integer width = 151 integer height = 52 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean enabled = false string text = "状态" alignment alignment = right! boolean focusrectangle = false end type type st_4 from statictext within w_credence_edit_popup integer x = 2231 integer y = 196 integer width = 210 integer height = 52 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean enabled = false string text = "凭证字:" alignment alignment = right! boolean focusrectangle = false end type type cb_other from uo_imflatbutton within w_credence_edit_popup integer x = 1710 integer width = 274 integer height = 164 integer taborder = 180 boolean bringtotop = true string text = "其它功能" string normalpicname = "other.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=找平~tEvent=ue_balance" menustr=menustr + "|" + "Text=-" menustr=menustr + "|" + "Text=计税~tEvent=ue_cmpl_tax" menustr=menustr + "|" + "Text=-" menustr=menustr + "|" + "Text=计算器~tEvent=ue_computer" menustr=menustr + "|" + "Text=-" menustr=menustr + "|" + "Text=现金流量分配~tEvent=ue_cash" menustr=menustr + "|" + "Text=-" menustr=menustr + "|" + "Text=调入模式凭证~tEvent=ue_cred_mode" menustr=menustr + "|" + "Text=将凭证另存为模式凭证~tEvent=ue_cred_savetomode" menustr=menustr + "|" + "Text=-" menustr=menustr + "|" + "Text=查看相关单据~tEvent=ue_bill_find" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event type em_cmonth from editmask within w_credence_edit_popup integer x = 1961 integer y = 180 integer width = 279 integer height = 84 integer taborder = 140 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! string mask = "000000" boolean autoskip = true boolean spin = true double increment = 1 end type event modified;i_cmonth = Long(THIS.Text) PARENT.TriggerEvent("retrieve_pageretr") end event type mle_msg from statictext within w_credence_edit_popup integer x = 2999 integer y = 176 integer width = 549 integer height = 1964 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 16777215 boolean enabled = false boolean border = true borderstyle borderstyle = styleraised! boolean focusrectangle = false end type type dw_uc from datawindow within w_credence_edit_popup event dwnkey pbm_dwnkey integer y = 372 integer width = 2990 integer height = 1772 integer taborder = 110 string dataobject = "dw_credence_edit_popup" boolean border = false boolean livescroll = true end type event dwnkey;parent.triggerevent('user_key') if key = KeyDownArrow! then return 1 if dw_edit_mode then if dw_uc.GetColumnName ( )='billnumber' and key = KeyEnter! then dw_child.setfocus() dw_child.scrolltorow(1) dw_child.SetColumn ('brief') return 1 else if key = KeyEnter! Then // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab Return 1 end If end if end if end event event rowfocuschanged; IF not dw_edit_mode then if currentrow >0 THEN dw_pageretr.SETROW(currentrow) dw_pageretr.ScrollToRow(currentrow) dw_pageretr.selectrow(0,false) dw_pageretr.selectrow(currentrow,true) end if // parent.triggerevent('retrieve_childdw') end if //if currentrow>0 and not dw_edit_mode then // if dw_uc.object.flag[currentrow]=1 then // cb_auditing.enabled=false // cb_delet.enabled=false // cb_edit.enabled=false // cb_addzy.enabled=true // else // cb_auditing.enabled=true // cb_delet.enabled=true // cb_edit.enabled=true // cb_addzy.enabled=false // end if //else // cb_auditing.enabled=false // cb_delet.enabled=false // cb_edit.enabled=false // cb_addzy.enabled=false //end if end event event rowfocuschanging;if dw_edit_mode then return 1 end event event itemchanged;if not dw_edit_mode then return if row <= 0 then return if dwo.name <> 'credtype' then return dw_uc.accepttext() dw_uc.setredraw(false) string ls_credtype,arg_msg long ls_yearmon ls_yearmon = il_dft_cmonth ls_credtype = dw_uc.object.credtype[row] if sys_option_credno_save = 0 then dw_uc.object.credno[row] = uo_credence_ins.get_new_credno(0,ls_credtype,ls_yearmon,arg_msg) if trim(arg_msg)<>'' then messagebox('提示',arg_msg) end if dw_uc.setcolumn("creddate") dw_uc.setredraw(true) end event type cb_auto_create from uo_imflatbutton within w_credence_edit_popup boolean visible = false integer x = 3049 integer y = 456 integer width = 229 integer height = 104 integer taborder = 310 boolean bringtotop = true string text = "自动建" end type event clicked;cb_add.triggerevent(clicked!) end event type ln_5 from line within w_credence_edit_popup long linecolor = 33554432 integer linethickness = 4 integer beginy = 360 integer endx = 1001 integer endy = 360 end type type ln_6 from line within w_credence_edit_popup long linecolor = 16777215 integer linethickness = 4 integer beginy = 364 integer endx = 1001 integer endy = 364 end type type st_mxdscrp from statictext within w_credence_edit_popup integer x = 14 integer y = 292 integer width = 2962 integer height = 52 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 boolean enabled = false boolean focusrectangle = false end type type cb_dft from commandbutton within w_credence_edit_popup integer x = 695 integer y = 180 integer width = 146 integer height = 84 integer taborder = 270 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "设置" end type event clicked;s_edit_index_tran s_rst OPEN(w_credence_edit_popup_dft) s_rst = Message.PowerObjectParm IF s_rst.d_long = 0 THEN RETURN il_dft_cmonth = s_rst.b_long ii_if_dft_reldate = s_rst.c_long idt_dft_reldate = s_rst.b_datetime wf_text() end event type st_dft_reldate from statictext within w_credence_edit_popup integer x = 5 integer y = 224 integer width = 654 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 82700779 string text = "默认相关日期" boolean focusrectangle = false end type type ln_1 from line within w_credence_edit_popup long linecolor = 33554432 integer linethickness = 4 integer beginy = 168 integer endx = 1001 integer endy = 168 end type type ln_2 from line within w_credence_edit_popup long linecolor = 16777215 integer linethickness = 4 integer beginy = 172 integer endx = 1001 integer endy = 172 end type type ln_3 from line within w_credence_edit_popup long linecolor = 33554432 integer linethickness = 4 integer beginy = 280 integer endx = 1001 integer endy = 280 end type type ln_4 from line within w_credence_edit_popup long linecolor = 16777215 integer linethickness = 4 integer beginy = 284 integer endx = 1001 integer endy = 284 end type type r_bar from rectangle within w_credence_edit_popup long linecolor = 16777215 long fillcolor = 1073741824 integer x = 3497 integer width = 73 integer height = 172 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_1.beginy - 5 end event