$PBExportHeader$w_mustpay_mod.srw forward global type w_mustpay_mod from w_publ_base end type type dw_1 from datawindow within w_mustpay_mod end type type cb_2 from uo_imflatbutton within w_mustpay_mod end type type cb_1 from uo_imflatbutton within w_mustpay_mod end type end forward global type w_mustpay_mod from w_publ_base integer width = 2560 integer height = 1120 string title = "应付帐录入" boolean minbox = false windowtype windowtype = response! dw_1 dw_1 cb_2 cb_2 cb_1 cb_1 end type global w_mustpay_mod w_mustpay_mod type variables s_edit_index_tran s_tran uo_mustpay uo_pay long li_sptid,li_scid string ls_billcode decimal ld_payamt long ll_moneyid end variables forward prototypes public function integer wf_save () public function integer wf_insertrow () end prototypes public function integer wf_save ();Int rslt = 1 Long li_row dw_1.AcceptText() li_row = dw_1.GetRow() IF li_row <= 0 THEN MessageBox('提示','记录错误',information!,ok!) rslt = 0 GOTO ext END IF String arg_msg DateTime arg_paydate Decimal arg_oriamt Decimal arg_mstpayamt Decimal arg_payamt String arg_inrep Long arg_banktypeid String arg_billcode Long arg_sptid Long arg_scid String arg_payabout DateTime arg_viewdate Long arg_accountsid Long arg_itemid String arg_relcode arg_scid = dw_1.Object.scid[li_row] arg_sptid = dw_1.Object.sptid[li_row] arg_paydate = dw_1.Object.paydate[li_row] arg_oriamt = dw_1.Object.oriamt[li_row] arg_mstpayamt = dw_1.Object.mstpayamt[li_row] arg_payamt = dw_1.Object.payamt[li_row] arg_inrep = dw_1.Object.inrep[li_row] arg_banktypeid = dw_1.Object.banktypeid[li_row] arg_billcode = dw_1.Object.billcode[li_row] arg_payabout = dw_1.Object.dscrp[li_row] arg_viewdate = dw_1.Object.viewdate[li_row] arg_accountsid = dw_1.Object.accountsid[li_row] arg_itemid = dw_1.Object.itemid[li_row] arg_relcode = dw_1.Object.relcode[li_row] //IF arg_sptid = 0 THEN // MessageBox('提示','请选择当前供应商!',information!,ok!) // rslt = 0 // GOTO ext //END IF IF uo_pay.add_payrec(arg_scid,arg_sptid,arg_paydate,arg_inrep,& arg_oriamt,arg_mstpayamt,arg_payamt,& arg_payabout,arg_billcode,arg_banktypeid,0,publ_operator,& 0,0,arg_msg,True,arg_viewdate,arg_accountsid,arg_itemid,ll_moneyid,arg_relcode) = 0 THEN MessageBox("错误",arg_msg,stopsign!,ok!) rslt = 0 GOTO ext END IF f_SetProfileString(sys_empid, dw_1.DataObject, "dft_itemid", String(dw_1.Object.itemid[li_row])) f_SetProfileString(sys_empid, dw_1.DataObject, "dft_billcode", String(dw_1.Object.billcode[li_row])) f_SetProfileString(sys_empid, dw_1.DataObject, "dft_banktypeid", String(dw_1.Object.banktypeid[li_row])) ext: RETURN rslt end function public function integer wf_insertrow ();long li_newrow dw_1.setredraw(false) li_newrow = dw_1.insertrow(0) dw_1.object.sptid[li_newrow] = li_sptid dw_1.object.scid[li_newrow] = li_scid dw_1.object.moneyid[li_newrow] = ll_moneyid dw_1.object.billcode[li_newrow] = ls_billcode dw_1.object.payamt[li_newrow] = ld_payamt dw_1.object.oriamt[li_newrow] = 0 - ld_payamt dw_1.Object.itemid[li_newrow] = Long(f_profilestring(sys_empid, dw_1.DataObject, "dft_itemid", String(0))) dw_1.Object.billcode[li_newrow] = f_profilestring(sys_empid, dw_1.DataObject, "dft_billcode", String(0)) dw_1.Object.banktypeid[li_newrow] = Long(f_profilestring(sys_empid, dw_1.DataObject, "dft_banktypeid", String(0))) dw_1.Object.inrep[li_newrow] = publ_operator dw_1.setfocus() dw_1.setcolumn('billcode') dw_1.setredraw(true) return 1 end function on w_mustpay_mod.create int iCurrent call super::create this.dw_1=create dw_1 this.cb_2=create cb_2 this.cb_1=create cb_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_1 this.Control[iCurrent+2]=this.cb_2 this.Control[iCurrent+3]=this.cb_1 end on on w_mustpay_mod.destroy call super::destroy destroy(this.dw_1) destroy(this.cb_2) destroy(this.cb_1) end on event open;call super::open;dw_1.settransobject(sqlca) s_tran=message.powerobjectparm li_sptid = s_tran.b_long li_scid = s_tran.c_long ls_billcode = s_tran.b_string ld_payamt = s_tran.b_decimal ll_moneyid= s_tran.d_long datawindowchild childdw dw_1.SetTransObject (sqlca) dw_1.GetChild("accountsid",childdw) childdw.SetTransObject (sqlca) IF childdw.Retrieve(sys_user_account) = 0 THEN childdw.InsertRow(0) END IF wf_insertrow() uo_pay = create uo_mustpay end event event close;call super::close;destroy uo_pay end event type cb_func from w_publ_base`cb_func within w_mustpay_mod boolean visible = false integer x = 1129 integer y = 912 end type type cb_exit from w_publ_base`cb_exit within w_mustpay_mod integer x = 2185 integer y = 900 integer taborder = 30 string text = "取消" end type type dw_1 from datawindow within w_mustpay_mod event key pbm_dwnkey event dwnkey pbm_dwnkey integer width = 2523 integer height = 864 integer taborder = 10 boolean bringtotop = true string dataobject = "dw_mstpay_mod" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event dwnkey;if key = keydownarrow! then return 1 if key = keyenter! or key = keydownarrow! then // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 0 elseif key = keyuparrow! then keybd_event ( 16, 0, 0 , 0 ) keybd_event ( 9, 0, 0 , 0 ) keybd_event ( 9, 0, 2, 0 ) keybd_event ( 16, 0, 2, 0 ) return 0 end if end event event rbuttondown;Long ll_row,ll_column ll_row = THIS.GetRow() ll_column = THIS.GetColumn() IF ll_row <= 0 THEN RETURN IF ll_column <= 0 THEN RETURN IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X + PARENT.X s_calender.Y = THIS.Y + PARENT.Y OpenWithParm(w_calendar,s_calender) THIS.SetItem(ll_row,ll_column,id_date_selected) end if end event type cb_2 from uo_imflatbutton within w_mustpay_mod integer x = 1861 integer y = 900 integer width = 329 integer height = 96 integer taborder = 40 string text = "保存[C^+S]" end type event clicked;call super::clicked;if wf_save() = 0 then return close(parent) end event type cb_1 from uo_imflatbutton within w_mustpay_mod integer x = 1458 integer y = 900 integer width = 407 integer height = 96 integer taborder = 40 string text = "保存&新增[&S]" end type event clicked;call super::clicked;if wf_save() = 0 then return long li_newrow dw_1.reset() wf_insertrow() end event