123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- $PBExportHeader$w_musttake_mod.srw
- forward
- global type w_musttake_mod from w_publ_base
- end type
- type dw_1 from datawindow within w_musttake_mod
- end type
- type cb_2 from uo_imflatbutton within w_musttake_mod
- end type
- type cb_1 from uo_imflatbutton within w_musttake_mod
- end type
- end forward
- global type w_musttake_mod from w_publ_base
- integer y = 388
- 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_musttake_mod w_musttake_mod
- type variables
- s_edit_index_tran s_tran
- uo_musttake uo_take
- long li_cusid,li_scid,ll_moneyid
- string ls_billcode
- decimal ld_takeamt
-
- 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_takedate
- Decimal arg_oriamt
- Decimal arg_msttakeamt
- Decimal arg_takeamt
- String arg_inrep
- Long arg_banktypeid
- String arg_billcode
- Long arg_cusid
- Long arg_scid
- String arg_takeabout
- DateTime arg_viewdate
- Long arg_accountsid
- Long arg_itemid
- String arg_relcode
- arg_scid = dw_1.Object.scid[li_row]
- arg_cusid = dw_1.Object.cusid[li_row]
- arg_takedate = dw_1.Object.takedate[li_row]
- arg_oriamt = dw_1.Object.oriamt[li_row]
- arg_msttakeamt = dw_1.Object.msttakeamt[li_row]
- arg_takeamt = dw_1.Object.takeamt[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_takeabout = 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_cusid = 0 THEN
- // MessageBox('提示','请选择当前客户!',information!,ok!)
- // rslt = 0
- // GOTO ext
- //END IF
- IF sys_option_msttake_takeamt_secaudit = 1 AND &
- dw_1.Object.takeamt[li_row] <> 0 THEN
- MessageBox('系统提示','系统选项使用了[070]客户收款单使用二级审核,只能使用客户收款单增加收款,请检查!')
- rslt = 0
- GOTO ext
- END IF
- IF uo_take.add_takerec(arg_scid,arg_cusid,arg_takedate,arg_inrep,&
- arg_oriamt,arg_msttakeamt,arg_takeamt,&
- arg_takeabout,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.cusid[li_newrow] = li_cusid
- dw_1.object.moneyid[li_newrow] = ll_moneyid
- dw_1.object.scid[li_newrow] = li_scid
- dw_1.object.billcode[li_newrow] = ls_billcode
- dw_1.object.takeamt[li_newrow] = ld_takeamt
- dw_1.object.oriamt[li_newrow] = 0 - ld_takeamt
- if ls_billcode = '' then// 新建时插入上次输入,收款时插入单号
- dw_1.Object.billcode[li_newrow] = f_profilestring(sys_empid, dw_1.DataObject, "dft_billcode", String(0))
- end if
- dw_1.Object.itemid[li_newrow] = Long(f_profilestring(sys_empid, dw_1.DataObject, "dft_itemid", 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_musttake_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_musttake_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_cusid = s_tran.b_long
- li_scid = s_tran.c_long
- ls_billcode = s_tran.b_string
- ld_takeamt = 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_take = create uo_musttake
- end event
- event close;call super::close;destroy uo_take
- end event
- type cb_func from w_publ_base`cb_func within w_musttake_mod
- boolean visible = false
- integer x = 2355
- integer y = 13
- end type
- type cb_exit from w_publ_base`cb_exit within w_musttake_mod
- integer x = 2231
- integer y = 899
- integer taborder = 30
- string text = "取消"
- end type
- type dw_1 from datawindow within w_musttake_mod
- event key pbm_dwnkey
- event dwnkey pbm_dwnkey
- integer width = 2538
- integer height = 848
- integer taborder = 10
- boolean bringtotop = true
- string dataobject = "dw_msttake_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_musttake_mod
- integer x = 1905
- integer y = 899
- 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_musttake_mod
- integer x = 1503
- integer y = 899
- integer width = 406
- 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
|