123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539 |
- $PBExportHeader$w_flow_cred.srw
- forward
- global type w_flow_cred from w_publ_base
- end type
- type cb_save from commandbutton within w_flow_cred
- end type
- type cb_refresh from commandbutton within w_flow_cred
- end type
- type dw_2 from datawindow within w_flow_cred
- end type
- type cb_mod from commandbutton within w_flow_cred
- end type
- type cb_ch from commandbutton within w_flow_cred
- end type
- type cb_del from commandbutton within w_flow_cred
- end type
- type dw_1 from u_dw_rbtnfilter within w_flow_cred
- end type
- type cb_ch_brief from commandbutton within w_flow_cred
- end type
- type dw_3 from datawindow within w_flow_cred
- end type
- type cb_write_amt from commandbutton within w_flow_cred
- end type
- type st_amt from statictext within w_flow_cred
- end type
- end forward
- global type w_flow_cred from w_publ_base
- int Width=3269
- int Height=2300
- WindowType WindowType=response!
- boolean TitleBar=true
- string Title="现金流量金额分配"
- long BackColor=83686901
- boolean MinBox=false
- cb_save cb_save
- cb_refresh cb_refresh
- dw_2 dw_2
- cb_mod cb_mod
- cb_ch cb_ch
- cb_del cb_del
- dw_1 dw_1
- cb_ch_brief cb_ch_brief
- dw_3 dw_3
- cb_write_amt cb_write_amt
- st_amt st_amt
- end type
- global w_flow_cred w_flow_cred
- type variables
- s_flow_cred s_flowcred
- end variables
- forward prototypes
- public function integer wf_face ()
- end prototypes
- public function integer wf_face ();cb_ch.enabled = dw_edit_mode
- cb_ch_brief.enabled = dw_edit_mode
- cb_write_amt.enabled = dw_edit_mode
- cb_save.enabled = dw_edit_mode
- cb_del.enabled = dw_edit_mode
- cb_refresh.enabled = not dw_edit_mode
- if dw_edit_mode then
- cb_mod.text = '放弃'
- dw_2.settaborder('cw_cashitem_brief',10)
- dw_2.settaborder('cw_cashitem_debit',20)
- dw_2.settaborder('cw_cashitem_credit',30)
- else
- cb_mod.text = '修改'
- dw_2.settaborder('cw_cashitem_brief',0)
- dw_2.settaborder('cw_cashitem_debit',0)
- dw_2.settaborder('cw_cashitem_credit',0)
- end if
- return 1
- end function
- on w_flow_cred.create
- int iCurrent
- call super::create
- this.cb_save=create cb_save
- this.cb_refresh=create cb_refresh
- this.dw_2=create dw_2
- this.cb_mod=create cb_mod
- this.cb_ch=create cb_ch
- this.cb_del=create cb_del
- this.dw_1=create dw_1
- this.cb_ch_brief=create cb_ch_brief
- this.dw_3=create dw_3
- this.cb_write_amt=create cb_write_amt
- this.st_amt=create st_amt
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_save
- this.Control[iCurrent+2]=this.cb_refresh
- this.Control[iCurrent+3]=this.dw_2
- this.Control[iCurrent+4]=this.cb_mod
- this.Control[iCurrent+5]=this.cb_ch
- this.Control[iCurrent+6]=this.cb_del
- this.Control[iCurrent+7]=this.dw_1
- this.Control[iCurrent+8]=this.cb_ch_brief
- this.Control[iCurrent+9]=this.dw_3
- this.Control[iCurrent+10]=this.cb_write_amt
- this.Control[iCurrent+11]=this.st_amt
- end on
- on w_flow_cred.destroy
- call super::destroy
- destroy(this.cb_save)
- destroy(this.cb_refresh)
- destroy(this.dw_2)
- destroy(this.cb_mod)
- destroy(this.cb_ch)
- destroy(this.cb_del)
- destroy(this.dw_1)
- destroy(this.cb_ch_brief)
- destroy(this.dw_3)
- destroy(this.cb_write_amt)
- destroy(this.st_amt)
- end on
- event open;call super::open;wf_face()
- s_flowcred = Message.PowerObjectParm
- st_amt.text = '金额:'+string(abs(s_flowcred.debit - s_flowcred.credit),'#,#0.00')
- dw_1.SetTransObject(sqlca)
- dw_2.SetTransObject(sqlca)
- cb_refresh.TriggerEvent(Clicked!)
- long ll_i,ll_row
- for ll_i = 1 to upperbound(s_flowcred.brief)
- ll_row = dw_3.insertrow(0)
- dw_3.object.brief[ll_row] = s_flowcred.brief[ll_i]
- next
- end event
- type cb_exit from w_publ_base`cb_exit within w_flow_cred
- int X=2944
- int Y=1376
- int Width=224
- end type
- type cb_save from commandbutton within w_flow_cred
- int X=2693
- int Y=1376
- int Width=247
- int Height=96
- int TabOrder=20
- boolean BringToTop=true
- string Text="保存"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;IF dw_2.RowCount() <= 0 THEN RETURN
- Long i
- Decimal sum_debit,sum_credit
- String c_msg
- dw_2.AcceptText()
- sum_debit = dw_2.Object.sum_debit[1]
- sum_credit = dw_2.Object.sum_credit[1]
- IF String(s_flowcred.debit - s_flowcred.credit,'#,##0.00') <> String(sum_debit - sum_credit,'#,##0.00') THEN
- c_msg = '凭证中现金流量类科目借方、贷方差额为:'+String(s_flowcred.debit - s_flowcred.credit,'#,##0.00') + '~n'
- c_msg = c_msg + '而现金流量金额分配中流入、流出差额为:'+String(sum_debit - sum_credit,'#,##0.00') + '~n'
- c_msg = c_msg + '两者不相等,是否继续保存?'
- IF MessageBox ( '系统提示', c_msg , Question! , YesNo! ) = 2 THEN RETURN
- END IF
- Long ls_flowid,ll_printid
- string ls_brief
- Decimal ls_debit,ls_credit
- DELETE FROM cw_cashitem
- WHERE accsetid = :s_flowcred.accsetid
- AND credid = :s_flowcred.credid;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','删除凭证原现金流量失败>>'+sqlca.SQLErrText)
- ROLLBACK;
- RETURN
- END IF
- FOR i = 1 TO dw_2.RowCount()
- ls_flowid = dw_2.Object.cw_flow_flowid[i]
- ls_debit = dw_2.Object.cw_cashitem_debit[i]
- ls_credit = dw_2.Object.cw_cashitem_credit[i]
- ll_printid = dw_2.Object.pid[i]
- ls_brief = dw_2.Object.cw_cashitem_brief[i]
-
- IF IsNull(ls_debit) THEN ls_debit = 0
- IF IsNull(ls_credit) THEN ls_credit = 0
-
- IF ls_debit <> 0 OR ls_credit <> 0 THEN
- INSERT INTO cw_cashitem(accsetid,credid,flowid,debit,credit,brief,printid)
- Values(:s_flowcred.accsetid,:s_flowcred.credid,:ls_flowid,:ls_debit,:ls_credit,:ls_brief,:ll_printid);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','增加凭证现金流量失败>>'+sqlca.SQLErrText)
- ROLLBACK;
- RETURN
- END IF
- END IF
- NEXT
- COMMIT;
- MessageBox('系统提示','凭证现金流量保存成功')
- dw_edit_mode = FALSE
- wf_face()
- end event
- type cb_refresh from commandbutton within w_flow_cred
- int Y=1376
- int Width=270
- int Height=96
- int TabOrder=60
- boolean BringToTop=true
- string Text="刷新"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;dw_1.retrieve(s_flowcred.accsetid)
- dw_2.retrieve(s_flowcred.accsetid,s_flowcred.credid)
- end event
- type dw_2 from datawindow within w_flow_cred
- int Y=1488
- int Width=3173
- int Height=644
- int TabOrder=100
- boolean BringToTop=true
- string DataObject="dw_flow_cred_ch"
- BorderStyle BorderStyle=StyleLowered!
- boolean HScrollBar=true
- boolean VScrollBar=true
- boolean LiveScroll=true
- end type
- event rowfocuschanged;IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- end event
- event doubleclicked;cb_del.triggerevent(clicked!)
- end event
- type cb_mod from commandbutton within w_flow_cred
- int X=891
- int Y=1376
- int Width=247
- int Height=96
- int TabOrder=70
- boolean BringToTop=true
- string Text="修改"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;dw_edit_mode = not dw_edit_mode
- wf_face()
- end event
- type cb_ch from commandbutton within w_flow_cred
- int X=270
- int Y=1376
- int Width=311
- int Height=96
- int TabOrder=80
- boolean BringToTop=true
- string Text="↓ 选择"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;if not dw_edit_mode then return
- Long ll_row,ll_row_i
- int li_detailfalg
- dw_1.AcceptText()
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择现金流量项目')
- RETURN
- END IF
- li_detailfalg = dw_1.object.detailfalg[ll_row]
- IF li_detailfalg = 0 THEN
- MessageBox('提示','一级项目,不能选择')
- RETURN
- END IF
- ll_row_i = dw_2.insertrow(0)
- dw_2.object.cw_flow_cashcode[ll_row_i] = dw_1.object.cw_flow_cashcode[ll_row]
- dw_2.object.cw_flow_flowname[ll_row_i] = dw_1.object.cw_flow_flowname[ll_row]
- dw_2.object.cw_flow_flowid[ll_row_i] = dw_1.object.cw_flow_flowid[ll_row]
- dw_2.object.cw_flow_dcflag[ll_row_i] = dw_1.object.cw_flow_dcflag[ll_row]
- dw_2.selectrow(0,false)
- dw_2.scrolltorow(ll_row_i)
- dw_2.selectrow(ll_row_i,true)
- dw_2.setfocus()
- dw_2.setcolumn('cw_cashitem_brief')
-
- end event
- type cb_del from commandbutton within w_flow_cred
- int X=581
- int Y=1376
- int Width=311
- int Height=96
- int TabOrder=90
- boolean BringToTop=true
- string Text="↑ 删除"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;if not dw_edit_mode then return
- Long ll_row
- dw_2.AcceptText()
- ll_row = dw_2.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择要删除的现金流量项目')
- RETURN
- END IF
- IF MessageBox ("IF","是否确定要删除现金流量项目吗?",Question!,YesNo! ) = 2 THEN RETURN
- dw_2.deleterow(ll_row)
- end event
- type dw_1 from u_dw_rbtnfilter within w_flow_cred
- int X=0
- int Y=0
- int Width=2194
- int Height=1360
- int TabOrder=30
- boolean BringToTop=true
- string DataObject="dw_flow_cred"
- boolean HScrollBar=true
- boolean VScrollBar=true
- end type
- event rowfocuschanged;IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- end event
- event doubleclicked;cb_ch.triggerevent(clicked!)
- end event
- event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
- RBUTTON_FILTER_USE=true //右键查询功能开关
- end event
- type cb_ch_brief from commandbutton within w_flow_cred
- int X=2194
- int Y=1376
- int Width=357
- int Height=96
- int TabOrder=40
- boolean BringToTop=true
- string Text="↓ 选择摘要"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;if not dw_edit_mode then return
- Long ll_row,ll_row_i
- dw_3.AcceptText()
- dw_2.AcceptText()
- ll_row = dw_3.GetRow()
- ll_row_i = dw_2.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择摘要')
- RETURN
- END IF
- IF ll_row_i <= 0 THEN
- MessageBox('提示','请选择添加摘要的行')
- RETURN
- END IF
- dw_2.object.cw_cashitem_brief[ll_row_i] = dw_3.object.brief[ll_row]
- dw_2.selectrow(0,false)
- dw_2.scrolltorow(ll_row_i)
- dw_2.selectrow(ll_row_i,true)
- dw_2.setfocus()
- dw_2.setcolumn('cw_cashitem_brief')
-
- end event
- type dw_3 from datawindow within w_flow_cred
- int X=2194
- int Width=978
- int Height=1360
- int TabOrder=50
- boolean BringToTop=true
- string DataObject="dw_flow_cred_brief"
- BorderStyle BorderStyle=StyleLowered!
- boolean HScrollBar=true
- boolean VScrollBar=true
- boolean LiveScroll=true
- end type
- event doubleclicked;cb_ch_brief.triggerevent(clicked!)
- end event
- event rowfocuschanged;IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- end event
- type cb_write_amt from commandbutton within w_flow_cred
- int X=1838
- int Y=1376
- int Width=357
- int Height=96
- int TabOrder=30
- boolean BringToTop=true
- string Text="自动填金额"
- int TextSize=-9
- int Weight=400
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
- event clicked;IF NOT dw_edit_mode THEN RETURN
- Long ll_row_i
- dw_2.AcceptText()
- ll_row_i = dw_2.GetRow()
- IF ll_row_i <= 0 THEN
- MessageBox('提示','请选择添加摘要的行')
- RETURN
- END IF
- dw_2.SelectRow(0,FALSE)
- dw_2.ScrollToRow(ll_row_i)
- dw_2.SelectRow(ll_row_i,TRUE)
- dw_2.SetFocus()
- Decimal ld_amt
- ld_amt = s_flowcred.debit - s_flowcred.credit
- IF ld_amt > 0 THEN
- dw_2.Object.cw_cashitem_debit[ll_row_i] = Abs(ld_amt)
- dw_2.SetColumn('cw_cashitem_debit')
- ELSE
- dw_2.Object.cw_cashitem_credit[ll_row_i] = Abs(ld_amt)
- dw_2.SetColumn('cw_cashitem_credit')
- END IF
- end event
- type st_amt from statictext within w_flow_cred
- int X=1161
- int Y=1400
- int Width=585
- int Height=52
- boolean Enabled=false
- boolean BringToTop=true
- string Text="none"
- boolean FocusRectangle=false
- long TextColor=16711680
- long BackColor=67108864
- int TextSize=-9
- int Weight=700
- string FaceName="宋体"
- FontCharSet FontCharSet=GB2312CharSet!
- FontPitch FontPitch=Variable!
- end type
|