w_credence_edit_popup.srw 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831
  1. $PBExportHeader$w_credence_edit_popup.srw
  2. $PBExportComments$凭证录入
  3. forward
  4. global type w_credence_edit_popup from w_publ_pageretr
  5. end type
  6. type cb_print from uo_imflatbutton within w_credence_edit_popup
  7. end type
  8. type cb_retrieve from uo_imflatbutton within w_credence_edit_popup
  9. end type
  10. type cb_addzy from uo_imflatbutton within w_credence_edit_popup
  11. end type
  12. type cb_delet from uo_imflatbutton within w_credence_edit_popup
  13. end type
  14. type cb_edit from uo_imflatbutton within w_credence_edit_popup
  15. end type
  16. type cb_add from uo_imflatbutton within w_credence_edit_popup
  17. end type
  18. type cb_add_xm from uo_imflatbutton within w_credence_edit_popup
  19. end type
  20. type cb_dele_xm from uo_imflatbutton within w_credence_edit_popup
  21. end type
  22. type cb_showall from uo_imflatbutton within w_credence_edit_popup
  23. end type
  24. type cb_auditing from uo_imflatbutton within w_credence_edit_popup
  25. end type
  26. type dw_child from u_dw_rbtnfilter within w_credence_edit_popup
  27. end type
  28. type cb_money from uo_imflatbutton within w_credence_edit_popup
  29. end type
  30. type dw_child_share from datawindow within w_credence_edit_popup
  31. end type
  32. type st_3 from statictext within w_credence_edit_popup
  33. end type
  34. type cb_cauditing from uo_imflatbutton within w_credence_edit_popup
  35. end type
  36. type cb_print_1 from uo_imflatbutton within w_credence_edit_popup
  37. end type
  38. type ddlb_credtype from dropdownlistbox within w_credence_edit_popup
  39. end type
  40. type st_dft_cmonth from statictext within w_credence_edit_popup
  41. end type
  42. type cbx_1 from checkbox within w_credence_edit_popup
  43. end type
  44. type ddlb_status from dropdownlistbox within w_credence_edit_popup
  45. end type
  46. type st_2 from statictext within w_credence_edit_popup
  47. end type
  48. type st_4 from statictext within w_credence_edit_popup
  49. end type
  50. type cb_other from uo_imflatbutton within w_credence_edit_popup
  51. end type
  52. type em_cmonth from editmask within w_credence_edit_popup
  53. end type
  54. type mle_msg from statictext within w_credence_edit_popup
  55. end type
  56. type dw_uc from datawindow within w_credence_edit_popup
  57. end type
  58. type cb_auto_create from uo_imflatbutton within w_credence_edit_popup
  59. end type
  60. type ln_5 from line within w_credence_edit_popup
  61. end type
  62. type ln_6 from line within w_credence_edit_popup
  63. end type
  64. type st_mxdscrp from statictext within w_credence_edit_popup
  65. end type
  66. type cb_dft from commandbutton within w_credence_edit_popup
  67. end type
  68. type st_dft_reldate from statictext within w_credence_edit_popup
  69. end type
  70. type ln_1 from line within w_credence_edit_popup
  71. end type
  72. type ln_2 from line within w_credence_edit_popup
  73. end type
  74. type ln_3 from line within w_credence_edit_popup
  75. end type
  76. type ln_4 from line within w_credence_edit_popup
  77. end type
  78. type r_bar from rectangle within w_credence_edit_popup
  79. end type
  80. end forward
  81. global type w_credence_edit_popup from w_publ_pageretr
  82. integer width = 3611
  83. integer height = 2380
  84. string title = "记帐凭证"
  85. boolean maxbox = true
  86. windowstate windowstate = maximized!
  87. event retrieve_childdw ( )
  88. event retrieve_uc ( )
  89. event refresh_interface ( )
  90. event ue_f7 ( )
  91. event ue_f8 ( )
  92. event ue_f9 ( )
  93. event ue_f10 ( )
  94. event ue_f6 ( )
  95. event ue_f11 ( )
  96. event ue_f12 ( )
  97. event ue_print ( )
  98. event ue_print_wb ( )
  99. event ue_print_view ( )
  100. event ue_print_wb_view ( )
  101. event ue_cmpl_tax ( )
  102. event ue_computer ( )
  103. event ue_cash ( )
  104. event ue_cred_mode ( )
  105. event ue_print_list ( )
  106. event ue_balance ( )
  107. event ue_cred_savetomode ( )
  108. event ue_bill_find ( )
  109. event ue_xls ( )
  110. event ue_print_list2 ( )
  111. cb_print cb_print
  112. cb_retrieve cb_retrieve
  113. cb_addzy cb_addzy
  114. cb_delet cb_delet
  115. cb_edit cb_edit
  116. cb_add cb_add
  117. cb_add_xm cb_add_xm
  118. cb_dele_xm cb_dele_xm
  119. cb_showall cb_showall
  120. cb_auditing cb_auditing
  121. dw_child dw_child
  122. cb_money cb_money
  123. dw_child_share dw_child_share
  124. st_3 st_3
  125. cb_cauditing cb_cauditing
  126. cb_print_1 cb_print_1
  127. ddlb_credtype ddlb_credtype
  128. st_dft_cmonth st_dft_cmonth
  129. cbx_1 cbx_1
  130. ddlb_status ddlb_status
  131. st_2 st_2
  132. st_4 st_4
  133. cb_other cb_other
  134. em_cmonth em_cmonth
  135. mle_msg mle_msg
  136. dw_uc dw_uc
  137. cb_auto_create cb_auto_create
  138. ln_5 ln_5
  139. ln_6 ln_6
  140. st_mxdscrp st_mxdscrp
  141. cb_dft cb_dft
  142. st_dft_reldate st_dft_reldate
  143. ln_1 ln_1
  144. ln_2 ln_2
  145. ln_3 ln_3
  146. ln_4 ln_4
  147. r_bar r_bar
  148. end type
  149. global w_credence_edit_popup w_credence_edit_popup
  150. type variables
  151. Int child_column_int = 1,uc_column_int = 1
  152. uo_credence uo_credence_ins
  153. Long cur_id = 0
  154. Boolean if_fcurrency = FALSE //是否核算外币
  155. Long cur_checkflag = -1
  156. Long cur_postflag = -1
  157. String cur_credtype = '-1'
  158. Int cur_editfoucs = 0
  159. Boolean if_changedw
  160. Long i_cmonth
  161. Long ll_xls_billid,ll_xls_Templatesid
  162. String ls_xls_DefaultDataWindow
  163. Long il_dft_cmonth
  164. Int ii_if_dft_reldate
  165. DateTime idt_dft_reldate
  166. end variables
  167. forward prototypes
  168. public function integer wf_refresh_interface ()
  169. public function integer wf_lock_child ()
  170. public function integer wf_no_edit ()
  171. public function integer wf_lock_uc ()
  172. public function integer wf_refresh_curuc (long arg_subaccsetid, long arg_credid)
  173. public function integer wf_change_childdw_face ()
  174. public function integer wf_setrow (long arg_credno)
  175. public subroutine wf_reshare_subid ()
  176. public function integer wf_rtr_balc ()
  177. public function integer wf_flagstatus_rf ()
  178. public function integer wf_check_cash (ref string arg_msg)
  179. public subroutine wf_text ()
  180. end prototypes
  181. event retrieve_childdw;Long row,uc_credid,uc_subaccsetid,i,li_row,cnt
  182. row = dw_uc.GetRow()
  183. //1.会计科目
  184. wf_reshare_subid()
  185. IF row > 0 THEN
  186. uc_subaccsetid = dw_uc.Object.subaccsetid[row]
  187. uc_credid = dw_uc.Object.credid[row]
  188. dw_child.SetRedraw (FALSE)
  189. dw_child.Retrieve(sys_accsetid,uc_subaccsetid,uc_credid)
  190. dw_child.ShareData(dw_child_share)
  191. cnt = dw_child.RowCount()
  192. FOR i = 1 TO sys_credence_insertrow - cnt
  193. dw_child.InsertRow(0)
  194. NEXT
  195. dw_child.SetRedraw (TRUE)
  196. ELSE
  197. dw_child.Reset()
  198. dw_child.ShareData(dw_child_share)
  199. END IF
  200. end event
  201. event refresh_interface();//被 wf_refresh_interface() 调用,用于界面刷新
  202. cb_addzy.Enabled = dw_edit_mode
  203. ddlb_status.Enabled = NOT dw_edit_mode
  204. cb_dft.Enabled = NOT dw_edit_mode
  205. em_cmonth.Enabled = NOT dw_edit_mode
  206. ddlb_credtype.Enabled = NOT dw_edit_mode
  207. cbx_1.Enabled = dw_edit_mode
  208. //mle_msg.Visible = dw_edit_mode
  209. IF dw_edit_mode AND cur_editfoucs = 1 THEN
  210. IF sys_option_credno_save = 1 THEN
  211. dw_uc.SetTabOrder('credno',0)
  212. END IF
  213. END IF
  214. IF dw_edit_mode AND sys_system_mode = -1 THEN
  215. dw_child_share.SetTabOrder('cw_credencemx_cusid',0)
  216. dw_child_share.SetTabOrder('cw_credencemx_sptid',0)
  217. END IF
  218. IF NOT dw_edit_mode THEN if_changedw = FALSE
  219. end event
  220. event ue_print();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  221. MessageBox(publ_operator,'你没有使用权限!')
  222. RETURN
  223. END IF
  224. //--直接打印
  225. uo_print_preview uo_print
  226. IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  227. S_print_MSG LS_PRMSG
  228. Long LS_ROW
  229. LS_ROW = dw_uc.GetRow()
  230. IF LS_ROW <= 0 THEN
  231. MessageBox('NO','没有打印目标单据!')
  232. RETURN
  233. END IF
  234. String ls_windowname
  235. ls_windowname = THIS.ClassName ( )
  236. String ls_old_dwname,ls_new_dwname = ''
  237. ls_old_dwname = 'dw_pr_credence'
  238. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  239. IF ls_new_dwname = '' THEN
  240. ls_new_dwname = ls_old_dwname
  241. END IF
  242. LS_PRMSG.obj_dwNAME = ls_new_dwname
  243. LS_PRMSG.TAG_TEXT = '记帐凭证'
  244. LS_PRMSG.FILTER_STRING = ''
  245. LS_PRMSG.retr_pram_falg = 15
  246. LS_PRMSG.PAGECH_FLAG = 0
  247. LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW]
  248. LS_PRMSG.printrow = sys_emptyrowcount
  249. LS_PRMSG.retr_scid = sys_accsetid
  250. Long ll_rowcount = 0
  251. SELECT count(*) INTO :ll_rowcount FROM cw_credencemx
  252. WHERE accsetid = :sys_accsetid
  253. AND credid = :LS_PRMSG.retr_pramnmb;
  254. IF sqlca.SQLCode <> 0 THEN
  255. RETURN
  256. END IF
  257. LS_PRMSG.rowcnt = ll_rowcount
  258. uo_print.FACT_PRINT_MSG = LS_PRMSG
  259. String arg_msg
  260. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  261. MessageBox("系统提示",arg_msg)
  262. RETURN
  263. END IF
  264. uo_print.ds_print()
  265. end event
  266. event ue_print_wb();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  267. MessageBox(publ_operator,'你没有使用权限!')
  268. RETURN
  269. END IF
  270. //--直接打印
  271. uo_print_preview uo_print
  272. IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  273. S_print_MSG LS_PRMSG
  274. Long LS_ROW
  275. LS_ROW = dw_uc.GetRow()
  276. IF LS_ROW <= 0 THEN
  277. MessageBox('NO','没有打印目标单据!')
  278. RETURN
  279. END IF
  280. String ls_windowname
  281. ls_windowname = THIS.ClassName ( )
  282. String ls_old_dwname,ls_new_dwname = ''
  283. ls_old_dwname = 'dw_pr_credence_wb'
  284. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  285. IF ls_new_dwname = '' THEN
  286. ls_new_dwname = ls_old_dwname
  287. END IF
  288. LS_PRMSG.obj_dwNAME = ls_new_dwname
  289. LS_PRMSG.TAG_TEXT = '记帐凭证'
  290. LS_PRMSG.FILTER_STRING = ''
  291. LS_PRMSG.retr_pram_falg = 15
  292. LS_PRMSG.PAGECH_FLAG = 0
  293. LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW]
  294. LS_PRMSG.printrow = sys_emptyrowcount
  295. LS_PRMSG.retr_scid = sys_accsetid
  296. Long ll_rowcount = 0
  297. SELECT count(*) INTO :ll_rowcount FROM cw_credencemx
  298. WHERE accsetid = :sys_accsetid
  299. AND credid = :LS_PRMSG.retr_pramnmb;
  300. IF sqlca.SQLCode <> 0 THEN
  301. RETURN
  302. END IF
  303. LS_PRMSG.rowcnt = ll_rowcount
  304. uo_print.FACT_PRINT_MSG = LS_PRMSG
  305. String arg_msg
  306. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  307. MessageBox("系统提示",arg_msg)
  308. RETURN
  309. END IF
  310. uo_print.ds_print()
  311. end event
  312. event ue_print_view();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  313. MessageBox(publ_operator,'你没有使用权限!')
  314. RETURN
  315. END IF
  316. Long LS_ROW
  317. LS_ROW = dw_uc.GetRow()
  318. IF LS_ROW <= 0 THEN
  319. MessageBox('NO','没有打印目标单据!')
  320. RETURN
  321. END IF
  322. String ls_windowname
  323. ls_windowname = THIS.ClassName ( )
  324. String ls_old_dwname,ls_new_dwname = ''
  325. ls_old_dwname = 'dw_pr_credence'
  326. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  327. IF ls_new_dwname = '' THEN
  328. ls_new_dwname = ls_old_dwname
  329. END IF
  330. S_print_MSG LS_PRMSG
  331. LS_PRMSG.obj_dwNAME = ls_new_dwname
  332. LS_PRMSG.TAG_TEXT = '记帐凭证'
  333. LS_PRMSG.FILTER_STRING = ''
  334. LS_PRMSG.retr_pram_falg = 15
  335. LS_PRMSG.PAGECH_FLAG = 0
  336. LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW]
  337. LS_PRMSG.printrow = sys_emptyrowcount
  338. LS_PRMSG.retr_scid = sys_accsetid
  339. Long ll_rowcount = 0
  340. SELECT count(*) INTO :ll_rowcount FROM cw_credencemx
  341. WHERE accsetid = :sys_accsetid
  342. AND credid = :LS_PRMSG.retr_pramnmb;
  343. IF sqlca.SQLCode <> 0 THEN
  344. RETURN
  345. END IF
  346. LS_PRMSG.rowcnt = ll_rowcount
  347. //====================================================================
  348. OpenWithParm(w_publ_preview,LS_PRMSG)
  349. end event
  350. event ue_print_wb_view();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  351. MessageBox(publ_operator,'你没有使用权限!')
  352. RETURN
  353. END IF
  354. Long LS_ROW
  355. LS_ROW = dw_uc.GetRow()
  356. IF LS_ROW <= 0 THEN
  357. MessageBox('NO','没有打印目标单据!')
  358. RETURN
  359. END IF
  360. String ls_windowname
  361. ls_windowname = THIS.ClassName ( )
  362. String ls_old_dwname,ls_new_dwname = ''
  363. ls_old_dwname = 'dw_pr_credence_wb'
  364. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  365. IF ls_new_dwname = '' THEN
  366. ls_new_dwname = ls_old_dwname
  367. END IF
  368. S_print_MSG LS_PRMSG
  369. LS_PRMSG.obj_dwNAME = ls_new_dwname
  370. LS_PRMSG.TAG_TEXT = '记帐凭证'
  371. LS_PRMSG.FILTER_STRING = ''
  372. LS_PRMSG.retr_pram_falg = 15
  373. LS_PRMSG.PAGECH_FLAG = 0
  374. LS_PRMSG.retr_pramnmb = dw_uc.Object.credid[LS_ROW]
  375. LS_PRMSG.printrow = sys_emptyrowcount
  376. LS_PRMSG.retr_scid = sys_accsetid
  377. Long ll_rowcount = 0
  378. SELECT count(*) INTO :ll_rowcount FROM cw_credencemx
  379. WHERE accsetid = :sys_accsetid
  380. AND credid = :LS_PRMSG.retr_pramnmb;
  381. IF sqlca.SQLCode <> 0 THEN
  382. RETURN
  383. END IF
  384. LS_PRMSG.rowcnt = ll_rowcount
  385. //====================================================================
  386. OpenWithParm(w_publ_preview,LS_PRMSG)
  387. end event
  388. event ue_cmpl_tax;if not dw_edit_mode then
  389. messagebox('提示','非编辑状态下不可用')
  390. return
  391. end if
  392. long childrow
  393. decimal ld_debit,ld_credit,ld_tax_debit,ld_tax_credit
  394. dw_child.accepttext()
  395. childrow = dw_child.getrow()
  396. if childrow <= 0 then return
  397. ld_debit = dw_child.object.debit[childrow]
  398. ld_credit = dw_child.object.credit[childrow]
  399. if ld_debit <> 0 then ld_tax_debit = round(ld_debit/sys_bank_taxrate,2)
  400. if ld_credit <> 0 then ld_tax_credit = round(ld_credit/sys_bank_taxrate,2)
  401. dw_child.object.debit[childrow] = ld_tax_debit
  402. dw_child.object.credit[childrow] = ld_tax_credit
  403. end event
  404. event ue_computer;run('calc.exe')
  405. end event
  406. event ue_cash;IF dw_edit_mode THEN RETURN
  407. IF dw_uc.GetRow() <= 0 THEN RETURN
  408. Long i,cash_cnt
  409. s_flow_cred s_flowcred
  410. dw_uc.AcceptText()
  411. s_flowcred.accsetid = dw_uc.Object.accsetid[dw_uc.GetRow()]
  412. s_flowcred.credid = dw_uc.Object.credid[dw_uc.GetRow()]
  413. string ls_brief,ls_brief_arr[]
  414. DECLARE cur_brief CURSOR FOR
  415. SELECT cw_credencemx.brief
  416. FROM cw_subject,cw_credencemx
  417. WHERE cw_subject.accsetid = cw_credencemx.accsetid
  418. AND cw_subject.subid = cw_credencemx.subid
  419. AND cw_credencemx.accsetid = :s_flowcred.accsetid
  420. AND cw_credencemx.credid = :s_flowcred.credid
  421. AND cw_subject.hsemp = 1;
  422. open cur_brief;
  423. fetch cur_brief into :ls_brief;
  424. do while sqlca.sqlcode = 0
  425. cash_cnt++
  426. ls_brief_arr[cash_cnt] = ls_brief
  427. fetch cur_brief into :ls_brief;
  428. loop
  429. close cur_brief;
  430. IF cash_cnt = 0 THEN
  431. MessageBox('系统提示','凭证明细没有科目核算现金流量')
  432. RETURN
  433. END IF
  434. SELECT sum(debit),sum(credit)
  435. INTO :s_flowcred.debit,:s_flowcred.credit
  436. FROM cw_subject,cw_credencemx
  437. WHERE cw_subject.accsetid = cw_credencemx.accsetid
  438. AND cw_subject.subid = cw_credencemx.subid
  439. AND cw_credencemx.accsetid = :s_flowcred.accsetid
  440. AND cw_credencemx.credid = :s_flowcred.credid
  441. AND cw_subject.hsemp = 1;
  442. IF sqlca.SQLCode <> 0 THEN
  443. MessageBox('系统提示','查询凭证明细科目核算现金流量金额失败')
  444. RETURN
  445. END IF
  446. s_flowcred.brief = ls_brief_arr
  447. OpenWithParm(w_flow_cred,s_flowcred)
  448. end event
  449. event ue_cred_mode;IF NOT dw_edit_mode THEN
  450. MessageBox('提示','非编辑状态下不可用')
  451. RETURN
  452. END IF
  453. Long uc_row
  454. uc_row = dw_uc.GetRow()
  455. IF uc_row <= 0 THEN RETURN
  456. Open(w_credence_mode_choice)
  457. Long ls_credid
  458. String ls_credtype
  459. Int ls_billnumber
  460. ls_credid = Message.DoubleParm
  461. IF ls_credid <= 0 THEN RETURN
  462. SELECT credtype,billnumber INTO :ls_credtype,:ls_billnumber
  463. FROM cw_credence_auto
  464. WHERE accsetid = :sys_accsetid
  465. AND credid = :ls_credid;
  466. IF sqlca.SQLCode <> 0 THEN RETURN
  467. dw_uc.Object.credtype[uc_row] = ls_credtype
  468. dw_uc.Object.billnumber[uc_row] = ls_billnumber
  469. Long child_row
  470. String ls_subid,ls_brief,ls_billno
  471. Decimal ls_debit,ls_credit,ls_amount,ls_price
  472. Long ls_deptid,ls_itemid,ls_billid
  473. Int li_hsqty,li_hsdept,li_hsemp,li_hsitem,li_dcflag
  474. DECLARE modecred_cur CURSOR FOR
  475. SELECT cw_credencemx_auto.subid,
  476. cw_credencemx_auto.brief,
  477. cw_credencemx_auto.debit,
  478. cw_credencemx_auto.credit,
  479. cw_credencemx_auto.amount,
  480. cw_credencemx_auto.price,
  481. cw_credencemx_auto.deptid,
  482. cw_credencemx_auto.itemid,
  483. cw_credencemx_auto.billid,
  484. cw_credencemx_auto.billno,
  485. cw_subject.hsqty,
  486. cw_subject.hsdept,
  487. cw_subject.hsemp,
  488. cw_subject.hsitem,
  489. cw_subject.dcflag
  490. FROM cw_credencemx_auto,cw_subject
  491. WHERE cw_credencemx_auto.accsetid = :sys_accsetid
  492. AND cw_credencemx_auto.credid = :ls_credid
  493. AND cw_credencemx_auto.accsetid = cw_subject.accsetid
  494. AND cw_credencemx_auto.subid = cw_subject.subid
  495. Order By cw_credencemx_auto.printid;
  496. OPEN modecred_cur;
  497. FETCH modecred_cur INTO :ls_subid,:ls_brief,:ls_debit,:ls_credit,
  498. :ls_amount,:ls_price,:ls_deptid,:ls_itemid,
  499. :ls_billid,:ls_billno,:li_hsqty,:li_hsdept,
  500. :li_hsemp,:li_hsitem,:li_dcflag;
  501. DO WHILE sqlca.SQLCode = 0
  502. dw_child.AcceptText()
  503. Long ll_i
  504. Boolean if_f
  505. FOR ll_i = 1 TO dw_child.RowCount()
  506. IF Len(Trim(dw_child.Object.subid[ll_i])) > 0 THEN CONTINUE
  507. if_f = TRUE
  508. child_row = ll_i
  509. EXIT
  510. NEXT
  511. IF NOT if_f THEN
  512. child_row = dw_child.InsertRow(0)
  513. END IF
  514. dw_child.Object.brief[child_row] = ls_brief
  515. dw_child.Object.subid[child_row] = ls_subid
  516. dw_child.Object.debit[child_row] = ls_debit
  517. dw_child.Object.credit[child_row] = ls_credit
  518. dw_child.Object.cw_credencemx_billid[child_row] = ls_billid
  519. dw_child.Object.cw_credencemx_billno[child_row] = ls_billno
  520. dw_child.Object.cw_credencemx_amount[child_row] = ls_amount
  521. dw_child.Object.cw_credencemx_price[child_row] = ls_price
  522. dw_child.Object.cw_credencemx_deptid[child_row] = ls_deptid
  523. dw_child.Object.cw_credencemx_itemid[child_row] = ls_itemid
  524. dw_child.Object.cw_subject_hsqty[child_row] = li_hsqty
  525. dw_child.Object.cw_subject_hsdept[child_row] = li_hsdept
  526. dw_child.Object.cw_subject_hsemp[child_row] = li_hsemp
  527. dw_child.Object.cw_subject_hsitem[child_row] = li_hsitem
  528. dw_child.Object.cw_subject_dcflag[child_row] = li_dcflag
  529. FETCH modecred_cur INTO :ls_subid,:ls_brief,:ls_debit,:ls_credit,
  530. :ls_amount,:ls_price,:ls_deptid,:ls_itemid,
  531. :ls_billid,:ls_billno,:li_hsqty,:li_hsdept,
  532. :li_hsemp,:li_hsitem,:li_dcflag;
  533. LOOP
  534. CLOSE modecred_cur;
  535. // brief
  536. // subid
  537. // debit
  538. // credit
  539. // cw_credencemx_billid
  540. // cw_credencemx_billno
  541. // cw_credencemx_amount
  542. // cw_credencemx_price
  543. // cw_credencemx_deptid
  544. // cw_credencemx_itemid
  545. //
  546. end event
  547. event ue_print_list();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  548. MessageBox(publ_operator,'你没有使用权限!')
  549. RETURN
  550. END IF
  551. //--直接打印
  552. uo_print_preview uo_print
  553. IF MessageBox ("if","是否确定要打印列表中凭证吗?",question!,yesno! ) = 2 THEN RETURN
  554. s_print_msg ls_prmsg
  555. Long ls_i
  556. IF dw_pageretr.RowCount() <= 0 THEN
  557. MessageBox('no','没有打印目标凭证!')
  558. RETURN
  559. END IF
  560. String ls_windowname
  561. ls_windowname = THIS.ClassName ( )
  562. String ls_old_dwname,ls_new_dwname = ''
  563. String ls_old_dwname_wb,ls_new_dwname_wb = ''
  564. ls_old_dwname = 'dw_pr_credence'
  565. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  566. IF ls_new_dwname = '' THEN
  567. ls_new_dwname = ls_old_dwname
  568. END IF
  569. //wb
  570. ls_old_dwname_wb = 'dw_pr_credence_wb'
  571. ls_new_dwname_wb = f_get_dwprint_dynamic_chname(ls_old_dwname_wb,ls_windowname)
  572. IF ls_new_dwname_wb = '' THEN
  573. ls_new_dwname_wb = ls_old_dwname_wb
  574. END IF
  575. ls_prmsg.retr_pram_falg = 15
  576. ls_prmsg.tag_text = '记帐凭证'
  577. ls_prmsg.filter_string = ''
  578. ls_prmsg.pagech_flag = 0
  579. ls_prmsg.pagech_flag = 0
  580. ls_prmsg.printrow = sys_emptyrowcount
  581. ls_prmsg.retr_scid = sys_accsetid
  582. OPEN(w_sys_wait_jdt) //初始化进度条
  583. w_sys_wait_jdt.Show()
  584. w_sys_wait_jdt.wf_accepttol(dw_pageretr.RowCount())
  585. FOR ls_i = 1 TO dw_pageretr.RowCount()
  586. w_sys_wait_jdt.st_msg.Text = "打印凭证:"+dw_pageretr.Object.credtype[ls_i]+' '+String(dw_pageretr.Object.credno[ls_i]) //进度信息
  587. ls_prmsg.retr_pramnmb = dw_pageretr.Object.credid[ls_i]
  588. Long ll_rowcount = 0
  589. SELECT count(*) INTO :ll_rowcount FROM cw_credencemx
  590. WHERE accsetid = :sys_accsetid
  591. AND credid = :ls_prmsg.retr_pramnmb;
  592. IF sqlca.SQLCode <> 0 THEN
  593. RETURN
  594. END IF
  595. ls_prmsg.rowcnt = ll_rowcount
  596. //格式
  597. Long mx_raw_cnt
  598. SELECT count(*) INTO :mx_raw_cnt
  599. FROM cw_credencemx,cw_subject
  600. WHERE cw_credencemx.accsetid = :sys_accsetid
  601. AND cw_credencemx.credid = :ls_prmsg.retr_pramnmb
  602. AND cw_credencemx.accsetid = cw_subject.accsetid
  603. AND cw_credencemx.subid = cw_subject.subid
  604. AND cw_subject.hswb = 1;
  605. IF sqlca.SQLCode <> 0 THEN
  606. RETURN
  607. END IF
  608. IF mx_raw_cnt = 0 THEN
  609. ls_prmsg.obj_dwname = ls_new_dwname
  610. ELSE
  611. ls_prmsg.obj_dwname = ls_new_dwname_wb
  612. END IF
  613. //
  614. // messagebox('',ls_prmsg.obj_dwname)
  615. uo_print.fact_print_msg = ls_prmsg
  616. String arg_msg
  617. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  618. MessageBox("系统提示",arg_msg)
  619. RETURN
  620. END IF
  621. uo_print.ds_print()
  622. w_sys_wait_jdt.wf_inc(ls_i) //进度
  623. NEXT
  624. CLOSE(w_sys_wait_jdt)
  625. end event
  626. event ue_balance;if not dw_edit_mode then
  627. messagebox('提示','非编辑状态下不可用')
  628. return
  629. end if
  630. long childrow
  631. decimal ld_sum_debit,ld_sum_credit,ld_amt
  632. dw_child.accepttext()
  633. childrow = dw_child.getrow()
  634. if childrow <= 0 then return
  635. if dw_child.object.debit[childrow] <> 0 or dw_child.object.debit[childrow] <> 0 then return
  636. ld_sum_debit = dw_child.object.sum_debit[childrow]
  637. ld_sum_credit = dw_child.object.sum_credit[childrow]
  638. ld_amt = abs(ld_sum_debit - ld_sum_credit)
  639. if dw_child.GetColumnName() = 'debit' then
  640. dw_child.object.debit[childrow] = ld_amt
  641. dw_child.object.credit[childrow] = 0
  642. elseif dw_child.GetColumnName() = 'credit' then
  643. dw_child.object.credit[childrow] = ld_amt
  644. dw_child.object.debit[childrow] = 0
  645. end if
  646. end event
  647. event ue_cred_savetomode;IF dw_edit_mode THEN
  648. MessageBox('提示','编辑状态下不可用')
  649. RETURN
  650. END IF
  651. Int rslt = 1
  652. Long ll_ucrow,i
  653. String arg_msg,ls_str
  654. uo_credence_mode uo_cred_mode
  655. uo_cred_mode = CREATE uo_credence_mode
  656. ll_ucrow = dw_uc.GetRow()
  657. IF ll_ucrow <= 0 THEN
  658. arg_msg = '请选择凭证'
  659. rslt = 0
  660. GOTO ext
  661. END IF
  662. s_inputbox s_sreu
  663. s_sreu.Title = '请输入模式凭证的名称'
  664. OpenWithParm(w_inputbox,s_sreu)
  665. ls_str = Message.StringParm
  666. IF Trim(ls_str) = '' OR IsNull(ls_str) THEN RETURN
  667. IF uo_cred_mode.newbegin(0,arg_msg) = 0 THEN
  668. rslt = 0
  669. GOTO ext
  670. END IF
  671. uo_cred_mode.Credname = ls_str
  672. uo_cred_mode.credtype = dw_uc.Object.credtype[ll_ucrow]
  673. uo_cred_mode.billnumber = 0
  674. uo_cred_mode.ifalways = 1
  675. FOR i = 1 TO dw_child.RowCount()
  676. IF dw_child.Object.subid[i] = '' THEN CONTINUE
  677. IF uo_cred_mode.acceptmx(dw_child.Object.subid[i],&
  678. dw_child.Object.brief[i],&
  679. 0,&
  680. 0,&
  681. 0,&
  682. 0,&
  683. '',&
  684. 0,&
  685. 0,&
  686. 0,&
  687. 0,&
  688. 0,&
  689. 0,&
  690. 0,&
  691. '',&
  692. arg_msg,i) = 0 THEN
  693. MessageBox('error!',arg_msg)
  694. RETURN
  695. END IF
  696. NEXT
  697. IF uo_cred_mode.Save(arg_msg,TRUE) = 0 THEN
  698. MessageBox('error!',arg_msg)
  699. GOTO ext
  700. END IF
  701. ext:
  702. IF rslt = 0 THEN
  703. MessageBox('提示','失败,'+arg_msg)
  704. ELSE
  705. MessageBox('提示','成功')
  706. END IF
  707. DESTROY uo_cred_mode
  708. end event
  709. event ue_bill_find();IF dw_edit_mode THEN RETURN
  710. IF dw_pageretr.GetRow() <= 0 THEN RETURN
  711. String ls_code
  712. ls_code = dw_pageretr.Object.reldcode[dw_pageretr.GetRow()]
  713. f_open_win(0,ls_code)
  714. end event
  715. event ue_print_list2();IF NOT f_power_ind(1975,sys_msg_pow) THEN
  716. MessageBox(publ_operator,'你没有使用权限!')
  717. RETURN
  718. END IF
  719. Long ls_i,ll_credid_array[]
  720. IF dw_pageretr.RowCount() <= 0 THEN
  721. MessageBox('no','没有打印目标凭证!')
  722. RETURN
  723. END IF
  724. FOR ls_i = 1 TO dw_pageretr.RowCount()
  725. ll_credid_array[ls_i] = dw_pageretr.Object.credid[ls_i]
  726. NEXT
  727. String ls_windowname
  728. ls_windowname = THIS.ClassName ( )
  729. String ls_old_dwname,ls_new_dwname = ''
  730. ls_old_dwname = 'dw_pr_credence_list'
  731. ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname)
  732. IF ls_new_dwname = '' THEN
  733. ls_new_dwname = ls_old_dwname
  734. END IF
  735. S_print_MSG LS_PRMSG
  736. LS_PRMSG.obj_dwNAME = ls_new_dwname
  737. LS_PRMSG.TAG_TEXT = '记帐凭证'
  738. LS_PRMSG.FILTER_STRING = ''
  739. LS_PRMSG.retr_pram_falg = 25
  740. LS_PRMSG.PAGECH_FLAG = 0
  741. LS_PRMSG.retr_pramnmb = sys_accsetid
  742. LS_PRMSG.a_long_arr = ll_credid_array
  743. OpenWithParm(w_publ_preview,LS_PRMSG)
  744. end event
  745. public function integer wf_refresh_interface ();//wf_refresh_interface
  746. IF dw_edit_mode THEN
  747. cb_add_xm.Enabled = TRUE
  748. cb_dele_xm.Enabled = TRUE
  749. cb_retrieve.Enabled = FALSE
  750. cb_delet.Enabled = FALSE
  751. cb_print.Enabled = FALSE
  752. cb_showall.Enabled = FALSE
  753. cb_auditing.Enabled = FALSE
  754. dw_pageretr.RBUTTON_FILTER_USE = FALSE //右键查询功能开关
  755. dw_pageretr.titleclick_sort_use = FALSE //单击标题排序功能开关
  756. cb_edit.Enabled = TRUE
  757. cb_add.Enabled = TRUE
  758. cb_edit.Text = "放弃&E"
  759. cb_add.Text = "保存&S"
  760. cb_edit.normalpicname = 'Undo.bmp'
  761. cb_add.normalpicname = 'Save.bmp'
  762. ELSE
  763. cb_add_xm.Enabled = FALSE
  764. cb_dele_xm.Enabled = FALSE
  765. cb_retrieve.Enabled = TRUE
  766. cb_delet.Enabled = TRUE
  767. cb_print.Enabled = TRUE
  768. cb_showall.Enabled = TRUE
  769. cb_auditing.Enabled = TRUE
  770. cb_add.Enabled = TRUE
  771. cb_edit.Enabled = TRUE
  772. dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  773. dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关
  774. cb_edit.Text = "修改&E"
  775. cb_add.Text = "新建&S"
  776. cb_edit.normalpicname = 'OPEN.bmp'
  777. cb_add.normalpicname = 'new.bmp'
  778. IF dw_pageretr.GetRow() <= 0 THEN
  779. cb_edit.Enabled = FALSE
  780. cb_delet.Enabled = FALSE
  781. cb_auditing.Enabled = FALSE
  782. END IF
  783. END IF
  784. IF dw_edit_mode THEN
  785. cb_nextpage.Enabled = FALSE
  786. cb_retrieveall.Enabled = FALSE
  787. em_pagerowno.Enabled = FALSE
  788. sle_usual_query.Enabled = FALSE
  789. ELSE
  790. cb_nextpage.Enabled = TRUE
  791. cb_retrieveall.Enabled = TRUE
  792. em_pagerowno.Enabled = TRUE
  793. sle_usual_query.Enabled = TRUE
  794. END IF
  795. wf_lock_child()
  796. wf_lock_uc()
  797. cb_edit.of_init_draw()
  798. cb_add.of_init_draw()
  799. cb_edit.of_paint()
  800. cb_add.of_paint()
  801. cb_add.TriggerEvent('ue_textchange')
  802. cb_edit.TriggerEvent('ue_textchange')
  803. THIS.TriggerEvent('refresh_interface')
  804. RETURN 1
  805. end function
  806. public function integer wf_lock_child ();//wf_lock_child
  807. INT LS_INT
  808. IF dw_edit_mode THEN
  809. FOR LS_INT=1 TO child_column_int
  810. dw_child.SetTabOrder (LS_INT,LS_INT*10 )
  811. NEXT
  812. //child_share
  813. FOR LS_INT=1 TO child_column_int
  814. dw_child_share.SetTabOrder (LS_INT,LS_INT*10 )
  815. NEXT
  816. ELSE
  817. FOR LS_INT=1 TO child_column_int
  818. dw_child.SetTabOrder (LS_INT, 0)
  819. NEXT
  820. //child_share
  821. FOR LS_INT=1 TO child_column_int
  822. dw_child_share.SetTabOrder (LS_INT, 0)
  823. NEXT
  824. END IF
  825. RETURN 1
  826. end function
  827. public function integer wf_no_edit ();//wf_no_edit
  828. if dw_edit_mode then
  829. cb_edit.enabled=true
  830. else
  831. cb_edit.enabled=false
  832. end if
  833. return 1
  834. end function
  835. public function integer wf_lock_uc ();//wf_lock_uc
  836. Int LS_INT
  837. Long ls_row
  838. ls_row = dw_uc.GetRow()
  839. IF dw_edit_mode THEN
  840. FOR LS_INT = 1 TO uc_column_int
  841. dw_uc.SetTabOrder (LS_INT,LS_INT*10 )
  842. NEXT
  843. ELSE
  844. FOR LS_INT = 1 TO uc_column_int
  845. dw_uc.SetTabOrder (LS_INT, 0)
  846. NEXT
  847. END IF
  848. IF ls_row > 0 THEN dw_uc.SetRow(ls_row)
  849. RETURN 1
  850. end function
  851. public function integer wf_refresh_curuc (long arg_subaccsetid, long arg_credid);//wf_refresh_curuc
  852. IF arg_subaccsetid < 0 THEN RETURN 0
  853. IF arg_credid <= 0 OR IsNull(arg_credid) THEN RETURN 0
  854. Long uc_row
  855. uc_row = dw_uc.GetRow()
  856. IF uc_row <= 0 THEN RETURN 0
  857. dw_uc.SetRedraw(FALSE)
  858. Long credno
  859. DateTime creddate
  860. Long billnumber
  861. String credtype
  862. Long cmonth
  863. String billmaker
  864. DateTime billmakerdate
  865. String billcheck
  866. DateTime billcheckdate
  867. String billpost
  868. DateTime billpostdate
  869. Int checkflag
  870. Int postflag
  871. DateTime moddate
  872. String modemp
  873. Int ifauto
  874. SELECT cw_credence.credno,
  875. cw_credence.creddate ,
  876. cw_credence.billnumber ,
  877. cw_credence.credtype ,
  878. cw_credence.cmonth ,
  879. cw_credence.billmaker,
  880. cw_credence.billmakerdate ,
  881. cw_credence.billcheck ,
  882. cw_credence.billcheckdate ,
  883. cw_credence.billpost ,
  884. cw_credence.billpostdate ,
  885. cw_credence.checkflag ,
  886. cw_credence.postflag ,
  887. cw_credence.moddate ,
  888. cw_credence.modemp ,
  889. cw_credence.ifauto
  890. INTO :credno ,
  891. :creddate ,
  892. :billnumber,
  893. :credtype ,
  894. :cmonth ,
  895. :billmaker,
  896. :billmakerdate ,
  897. :billcheck ,
  898. :billcheckdate ,
  899. :billpost ,
  900. :billpostdate ,
  901. :checkflag ,
  902. :postflag ,
  903. :moddate ,
  904. :modemp,
  905. :ifauto
  906. FROM cw_credence
  907. WHERE ( cw_credence.accsetid = :sys_accsetid ) AND
  908. ( cw_credence.subaccsetid = :arg_subaccsetid ) AND
  909. ( cw_credence.credid = :arg_credid) ;
  910. IF sqlca.SQLCode <> 0 THEN
  911. MessageBox('系统提示',"查询操作失败(错误凭证唯一码)")
  912. RETURN 0
  913. END IF
  914. dw_uc.Object.accsetid[uc_row] = sys_accsetid
  915. dw_uc.Object.subaccsetid[uc_row] = arg_subaccsetid
  916. dw_uc.Object.credid[uc_row] = arg_credid
  917. dw_uc.Object.credno[uc_row] = credno
  918. dw_uc.Object.creddate[uc_row] = creddate
  919. dw_uc.Object.billnumber[uc_row] = billnumber
  920. dw_uc.Object.credtype[uc_row] = credtype
  921. dw_uc.Object.cmonth[uc_row] = cmonth
  922. dw_uc.Object.billmaker[uc_row] = billmaker
  923. dw_uc.Object.billmakerdate[uc_row] = billmakerdate
  924. dw_uc.Object.billcheck[uc_row] = billcheck
  925. dw_uc.Object.billcheckdate[uc_row] = billcheckdate
  926. dw_uc.Object.billpost[uc_row] = billpost
  927. dw_uc.Object.billpostdate[uc_row] = billpostdate
  928. dw_uc.Object.checkflag[uc_row] = checkflag
  929. dw_uc.Object.postflag[uc_row] = postflag
  930. dw_uc.Object.moddate[uc_row] = moddate
  931. dw_uc.Object.modemp[uc_row] = modemp
  932. dw_uc.Object.ifauto[uc_row] = ifauto
  933. wf_flagstatus_rf()
  934. dw_uc.SetRedraw(TRUE)
  935. RETURN 1
  936. //credid
  937. //accsetid
  938. //subaccsetid
  939. //credno
  940. //creddate
  941. //billnumber
  942. //credtype
  943. //cmonth
  944. //billmaker
  945. //billmakerdate
  946. //billcheck
  947. //billcheckdate
  948. //billpost
  949. //billpostdate
  950. //checkflag
  951. //postflag
  952. end function
  953. public function integer wf_change_childdw_face ();Long ls_sit,ls_width
  954. IF if_fcurrency THEN
  955. IF NOT if_changedw THEN
  956. dw_child.Modify('cw_subject_moneyid_t.visible=1 ~n rate_t.visible=1 ~n cw_credencemx_rawmoney_t.visible=1 ~n')
  957. dw_child.Modify('cw_subject_moneyid.visible=1 ~n rate.visible=1 ~n cw_credencemx_rawmoney.visible=1 ~n')
  958. ls_width = Long(dw_child.Describe('subid.width')) - Long(dw_child.Describe('cw_subject_moneyid.width')) - Long(dw_child.Describe('rate.width'))
  959. dw_child.Modify('subid.width='+String(ls_width))
  960. ls_sit = Long(dw_child.Describe('subid.x'))+Long(dw_child.Describe('subid.width')) + 2
  961. dw_child.Modify('cw_subject_moneyid_t.x='+String(ls_sit))
  962. dw_child.Modify('cw_subject_moneyid.x='+String(ls_sit))
  963. ls_sit = Long(dw_child.Describe('cw_subject_moneyid.x'))+Long(dw_child.Describe('cw_subject_moneyid.width')) + 6
  964. dw_child.Modify('rate_t.x='+String(ls_sit))
  965. dw_child.Modify('rate.x='+String(ls_sit))
  966. dw_child.Modify('cw_credencemx_rawmoney_t.x='+String(ls_sit))
  967. dw_child.Modify('cw_credencemx_rawmoney.x='+String(ls_sit))
  968. ls_sit = Long(dw_child.Describe('rate.x'))+Long(dw_child.Describe('rate.width')) + 6
  969. dw_child.Modify('debit.x='+String(ls_sit))
  970. dw_child.Modify('debit_t.x='+String(ls_sit))
  971. dw_child.Modify('sum_debit.x='+String(ls_sit))
  972. dw_child.Modify('sum_rawmoney.x='+String(ls_sit))
  973. ls_sit = Long(dw_child.Describe('debit.x'))+Long(dw_child.Describe('debit.width')) + 6
  974. dw_child.Modify('credit.x='+String(ls_sit))
  975. dw_child.Modify('credit_t.x='+String(ls_sit))
  976. dw_child.Modify('sum_credit.x='+String(ls_sit))
  977. END IF
  978. IF NOT if_changedw THEN if_changedw = TRUE
  979. ELSE
  980. ls_width = Long(dw_child.Describe('subid.width')) + Long(dw_child.Describe('cw_subject_moneyid.width')) + Long(dw_child.Describe('rate.width'))
  981. dw_child.Modify('cw_subject_moneyid_t.visible=0 ~n rate_t.visible=0 ~n cw_credencemx_rawmoney_t.visible=0 ~n')
  982. dw_child.Modify('cw_subject_moneyid.visible=0 ~n rate.visible=0 ~n cw_credencemx_rawmoney.visible=0 ~n')
  983. dw_child.Modify('subid.width='+String(ls_width))
  984. ls_sit = Long(dw_child.Describe('subid.x'))+Long(dw_child.Describe('subid.width')) + 4
  985. dw_child.Modify('debit.x='+String(ls_sit))
  986. dw_child.Modify('debit_t.x='+String(ls_sit))
  987. dw_child.Modify('sum_debit.x='+String(ls_sit))
  988. dw_child.Modify('sum_rawmoney.x='+String(ls_sit))
  989. ls_sit = Long(dw_child.Describe('debit.x'))+Long(dw_child.Describe('debit.width')) + 6
  990. dw_child.Modify('credit.x='+String(ls_sit))
  991. dw_child.Modify('credit_t.x='+String(ls_sit))
  992. dw_child.Modify('sum_credit.x='+String(ls_sit))
  993. if_changedw = FALSE
  994. END IF
  995. RETURN 1
  996. // cw_credencemx_rawmoney
  997. // cw_subject_moneyid
  998. // rate
  999. // debit
  1000. // credit
  1001. // cw_subject_moneyid
  1002. // cw_credencemx_rawmoney
  1003. end function
  1004. public function integer wf_setrow (long arg_credno);long ll_found
  1005. ll_found = dw_pageretr.Find("credno = "+ string(arg_credno),1, dw_pageretr.RowCount())
  1006. if ll_found > 0 then
  1007. dw_pageretr.setredraw(false)
  1008. dw_pageretr.selectrow(0,false)
  1009. dw_pageretr.scrolltorow(ll_found)
  1010. dw_pageretr.selectrow(ll_found,true)
  1011. dw_pageretr.setredraw(true)
  1012. end if
  1013. return 1
  1014. end function
  1015. public subroutine wf_reshare_subid ();//1.会计科目
  1016. datawindowchild childdw_subid
  1017. dw_child.getchild("subid",childdw_subid)
  1018. childdw_subid.SetTransObject (sqlca)
  1019. ddd_subid_display_detail.sharedata(childdw_subid)
  1020. end subroutine
  1021. public function integer wf_rtr_balc ();int rslt = 1
  1022. string ls_msg,ls_subid
  1023. long ll_childrow,ll_ucrow,ll_credid
  1024. int li_dcflag
  1025. decimal ld_debit,ld_credit,ld_BDebit,ld_BCredit,ld_bgamt,ld_balcamt,ld_debit_i,ld_credit_i
  1026. if dw_edit_mode then
  1027. ll_ucrow = dw_uc.getrow()
  1028. if ll_ucrow <= 0 then
  1029. ls_msg = '没有凭证'
  1030. rslt = 0
  1031. goto ext
  1032. end if
  1033. ll_credid = dw_uc.object.credid[ll_ucrow]
  1034. ll_childrow = dw_child.getrow()
  1035. if ll_childrow <= 0 then
  1036. ls_msg = '没有明细科目'
  1037. rslt = 0
  1038. goto ext
  1039. end if
  1040. ls_subid = dw_child.object.subid[ll_childrow]
  1041. ld_debit_i = dw_child.object.debit[ll_childrow]
  1042. ld_credit_i = dw_child.object.credit[ll_childrow]
  1043. if ls_subid = '' then
  1044. ls_msg = ''
  1045. rslt = 0
  1046. goto ext
  1047. end if
  1048. select cw_subject.dcflag
  1049. into :li_dcflag
  1050. from cw_subject
  1051. where subid = :ls_subid
  1052. and accsetid = :sys_accsetid;
  1053. if sqlca.sqlcode <> 0 then
  1054. ls_msg = '查询:'+ls_subid+'余额方向失败'
  1055. rslt = 0
  1056. goto ext
  1057. end if
  1058. select isnull(cw_Balance.BDebit,0),
  1059. isnull(cw_Balance.BCredit,0)
  1060. into :ld_BDebit,:ld_BCredit
  1061. from cw_Balance
  1062. where cw_Balance.accsetid = :sys_accsetid
  1063. and cw_Balance.YearMon = :sys_curyearmon
  1064. and cw_Balance.subid = :ls_subid;
  1065. if sqlca.sqlcode = -1 then
  1066. ls_msg = '查询:'+ls_subid+'期初余额失败'
  1067. rslt = 0
  1068. goto ext
  1069. end if
  1070. select isnull(sum(cw_credencemx.debit),0),
  1071. isnull(sum(cw_credencemx.credit),0)
  1072. into :ld_debit,:ld_credit
  1073. from cw_credencemx,cw_credence
  1074. where ( cw_credence.accsetid = cw_credencemx.accsetid )
  1075. and ( cw_credence.credid = cw_credencemx.credid )
  1076. and ( cw_credence.cmonth = :sys_curyearmon )
  1077. and ( cw_credencemx.subid = :ls_subid )
  1078. and ( cw_credence.credid <> :ll_credid )
  1079. and ( cw_credence.accsetid = :sys_accsetid );
  1080. if sqlca.sqlcode <> 0 then
  1081. ls_msg = '查询:'+ls_subid+'本月发生金额失败'
  1082. rslt = 0
  1083. goto ext
  1084. end if
  1085. if li_dcflag = 1 then
  1086. ld_bgamt = ld_bdebit - ld_bcredit
  1087. ld_balcamt = ld_bdebit - ld_bcredit + ld_debit - ld_credit + ld_debit_i - ld_credit_i
  1088. else
  1089. ld_bgamt = ld_bcredit - ld_bdebit
  1090. ld_balcamt = ld_bcredit - ld_bdebit + ld_credit - ld_debit + ld_credit_i - ld_debit_i
  1091. end if
  1092. ls_msg = ls_msg + '~n 科目:'+ls_subid
  1093. ls_msg = ls_msg + '~n'
  1094. ls_msg = ls_msg + '~n 期初余额:'+string(ld_bgamt,'#,##0.00')
  1095. ls_msg = ls_msg + '~n本月发生借方:'+string(ld_debit + ld_debit_i,'#,##0.00')
  1096. ls_msg = ls_msg + '~n本月发生借方:'+string(ld_credit + ld_credit_i,'#,##0.00')
  1097. ls_msg = ls_msg + '~n 期末余额:'+string(ld_balcamt,'#,##0.00')
  1098. end if
  1099. ext:
  1100. mle_msg.text = ls_msg
  1101. return rslt
  1102. end function
  1103. public function integer wf_flagstatus_rf ();//wf_flagstatus_rf
  1104. Long pagerert_row
  1105. pagerert_row = dw_pageretr.GetRow()
  1106. IF pagerert_row <= 0 THEN
  1107. cb_auditing.Enabled = FALSE
  1108. cb_cauditing.Enabled = FALSE
  1109. GOTO ext
  1110. END IF
  1111. IF dw_edit_mode THEN
  1112. cb_auditing.Enabled = FALSE
  1113. cb_cauditing.Enabled = FALSE
  1114. ELSE
  1115. IF dw_pageretr.Object.checkflag[pagerert_row] = 0 THEN
  1116. cb_auditing.Enabled = TRUE
  1117. cb_cauditing.Enabled = FALSE
  1118. ELSEIF dw_pageretr.Object.checkflag[pagerert_row] = 1 and dw_pageretr.Object.postflag[pagerert_row] = 0 THEN
  1119. cb_auditing.Enabled = FALSE
  1120. cb_cauditing.Enabled = TRUE
  1121. ELSEIF dw_pageretr.Object.checkflag[pagerert_row] = 1 and dw_pageretr.Object.postflag[pagerert_row] = 1 THEN
  1122. cb_auditing.Enabled = FALSE
  1123. cb_cauditing.Enabled = FALSE
  1124. END IF
  1125. END IF
  1126. ext:
  1127. RETURN 0
  1128. end function
  1129. public function integer wf_check_cash (ref string arg_msg);Int rslt = 1
  1130. IF sys_option_use_cash = 0 THEN
  1131. rslt = 1
  1132. GOTO ext
  1133. END IF
  1134. IF dw_edit_mode THEN
  1135. rslt = 0
  1136. arg_msg = '编辑状态不可用'
  1137. GOTO ext
  1138. END IF
  1139. IF dw_pageretr.GetRow() <= 0 THEN
  1140. rslt = 0
  1141. arg_msg = '请选择凭证'
  1142. GOTO ext
  1143. END IF
  1144. Long i,cnt
  1145. Long ll_accsetid,ll_credid
  1146. dw_pageretr.AcceptText()
  1147. ll_accsetid = dw_pageretr.Object.accsetid[dw_pageretr.GetRow()]
  1148. ll_credid = dw_pageretr.Object.credid[dw_pageretr.GetRow()]
  1149. SELECT count(*) INTO :cnt
  1150. FROM cw_subject,cw_credencemx
  1151. WHERE cw_subject.accsetid = cw_credencemx.accsetid
  1152. AND cw_subject.subid = cw_credencemx.subid
  1153. AND cw_credencemx.accsetid = :ll_accsetid
  1154. AND cw_credencemx.credid = :ll_credid
  1155. AND cw_subject.hsemp = 1;
  1156. IF sqlca.SQLCode <> 0 THEN
  1157. arg_msg = '查询分录是否有核算现金流量科目失败,'+sqlca.SQLErrText
  1158. rslt = 0
  1159. GOTO ext
  1160. END IF
  1161. IF cnt = 0 THEN
  1162. rslt = 1
  1163. GOTO ext
  1164. END IF
  1165. Decimal ld_debit,ld_credit
  1166. SELECT sum(debit),sum(credit) INTO :ld_debit,:ld_credit
  1167. FROM cw_subject,cw_credencemx
  1168. WHERE cw_subject.accsetid = cw_credencemx.accsetid
  1169. AND cw_subject.subid = cw_credencemx.subid
  1170. AND cw_credencemx.accsetid = :ll_accsetid
  1171. AND cw_credencemx.credid = :ll_credid
  1172. AND cw_subject.hsemp = 1;
  1173. IF sqlca.SQLCode <> 0 THEN
  1174. arg_msg = '查询分录核算现金流量科目金额失败,'+sqlca.SQLErrText
  1175. rslt = 0
  1176. GOTO ext
  1177. END IF
  1178. IF ld_debit = ld_credit THEN
  1179. rslt = 1
  1180. GOTO ext
  1181. END IF
  1182. cnt = 0
  1183. SELECT count(*) INTO :cnt
  1184. FROM cw_cashitem
  1185. WHERE accsetid = :ll_accsetid
  1186. AND credid = :ll_credid;
  1187. IF sqlca.SQLCode <> 0 THEN
  1188. arg_msg = '查询现金流量分配失败,'+sqlca.SQLErrText
  1189. rslt = 0
  1190. GOTO ext
  1191. END IF
  1192. IF cnt = 0 THEN
  1193. arg_msg = '现金流量未分配,请检查'
  1194. rslt = 0
  1195. GOTO ext
  1196. END IF
  1197. ext:
  1198. RETURN rslt
  1199. end function
  1200. public subroutine wf_text ();st_dft_cmonth.Text = '默认凭证月份:'+String(il_dft_cmonth)
  1201. IF ii_if_dft_reldate = 1 THEN
  1202. st_dft_reldate.Text = '默认相关日期:'+String(idt_dft_reldate,'yyyy-mm-dd')
  1203. ELSE
  1204. st_dft_reldate.Text = '默认相关日期:无'
  1205. END IF
  1206. end subroutine
  1207. on w_credence_edit_popup.create
  1208. int iCurrent
  1209. call super::create
  1210. this.cb_print=create cb_print
  1211. this.cb_retrieve=create cb_retrieve
  1212. this.cb_addzy=create cb_addzy
  1213. this.cb_delet=create cb_delet
  1214. this.cb_edit=create cb_edit
  1215. this.cb_add=create cb_add
  1216. this.cb_add_xm=create cb_add_xm
  1217. this.cb_dele_xm=create cb_dele_xm
  1218. this.cb_showall=create cb_showall
  1219. this.cb_auditing=create cb_auditing
  1220. this.dw_child=create dw_child
  1221. this.cb_money=create cb_money
  1222. this.dw_child_share=create dw_child_share
  1223. this.st_3=create st_3
  1224. this.cb_cauditing=create cb_cauditing
  1225. this.cb_print_1=create cb_print_1
  1226. this.ddlb_credtype=create ddlb_credtype
  1227. this.st_dft_cmonth=create st_dft_cmonth
  1228. this.cbx_1=create cbx_1
  1229. this.ddlb_status=create ddlb_status
  1230. this.st_2=create st_2
  1231. this.st_4=create st_4
  1232. this.cb_other=create cb_other
  1233. this.em_cmonth=create em_cmonth
  1234. this.mle_msg=create mle_msg
  1235. this.dw_uc=create dw_uc
  1236. this.cb_auto_create=create cb_auto_create
  1237. this.ln_5=create ln_5
  1238. this.ln_6=create ln_6
  1239. this.st_mxdscrp=create st_mxdscrp
  1240. this.cb_dft=create cb_dft
  1241. this.st_dft_reldate=create st_dft_reldate
  1242. this.ln_1=create ln_1
  1243. this.ln_2=create ln_2
  1244. this.ln_3=create ln_3
  1245. this.ln_4=create ln_4
  1246. this.r_bar=create r_bar
  1247. iCurrent=UpperBound(this.Control)
  1248. this.Control[iCurrent+1]=this.cb_print
  1249. this.Control[iCurrent+2]=this.cb_retrieve
  1250. this.Control[iCurrent+3]=this.cb_addzy
  1251. this.Control[iCurrent+4]=this.cb_delet
  1252. this.Control[iCurrent+5]=this.cb_edit
  1253. this.Control[iCurrent+6]=this.cb_add
  1254. this.Control[iCurrent+7]=this.cb_add_xm
  1255. this.Control[iCurrent+8]=this.cb_dele_xm
  1256. this.Control[iCurrent+9]=this.cb_showall
  1257. this.Control[iCurrent+10]=this.cb_auditing
  1258. this.Control[iCurrent+11]=this.dw_child
  1259. this.Control[iCurrent+12]=this.cb_money
  1260. this.Control[iCurrent+13]=this.dw_child_share
  1261. this.Control[iCurrent+14]=this.st_3
  1262. this.Control[iCurrent+15]=this.cb_cauditing
  1263. this.Control[iCurrent+16]=this.cb_print_1
  1264. this.Control[iCurrent+17]=this.ddlb_credtype
  1265. this.Control[iCurrent+18]=this.st_dft_cmonth
  1266. this.Control[iCurrent+19]=this.cbx_1
  1267. this.Control[iCurrent+20]=this.ddlb_status
  1268. this.Control[iCurrent+21]=this.st_2
  1269. this.Control[iCurrent+22]=this.st_4
  1270. this.Control[iCurrent+23]=this.cb_other
  1271. this.Control[iCurrent+24]=this.em_cmonth
  1272. this.Control[iCurrent+25]=this.mle_msg
  1273. this.Control[iCurrent+26]=this.dw_uc
  1274. this.Control[iCurrent+27]=this.cb_auto_create
  1275. this.Control[iCurrent+28]=this.ln_5
  1276. this.Control[iCurrent+29]=this.ln_6
  1277. this.Control[iCurrent+30]=this.st_mxdscrp
  1278. this.Control[iCurrent+31]=this.cb_dft
  1279. this.Control[iCurrent+32]=this.st_dft_reldate
  1280. this.Control[iCurrent+33]=this.ln_1
  1281. this.Control[iCurrent+34]=this.ln_2
  1282. this.Control[iCurrent+35]=this.ln_3
  1283. this.Control[iCurrent+36]=this.ln_4
  1284. this.Control[iCurrent+37]=this.r_bar
  1285. end on
  1286. on w_credence_edit_popup.destroy
  1287. call super::destroy
  1288. destroy(this.cb_print)
  1289. destroy(this.cb_retrieve)
  1290. destroy(this.cb_addzy)
  1291. destroy(this.cb_delet)
  1292. destroy(this.cb_edit)
  1293. destroy(this.cb_add)
  1294. destroy(this.cb_add_xm)
  1295. destroy(this.cb_dele_xm)
  1296. destroy(this.cb_showall)
  1297. destroy(this.cb_auditing)
  1298. destroy(this.dw_child)
  1299. destroy(this.cb_money)
  1300. destroy(this.dw_child_share)
  1301. destroy(this.st_3)
  1302. destroy(this.cb_cauditing)
  1303. destroy(this.cb_print_1)
  1304. destroy(this.ddlb_credtype)
  1305. destroy(this.st_dft_cmonth)
  1306. destroy(this.cbx_1)
  1307. destroy(this.ddlb_status)
  1308. destroy(this.st_2)
  1309. destroy(this.st_4)
  1310. destroy(this.cb_other)
  1311. destroy(this.em_cmonth)
  1312. destroy(this.mle_msg)
  1313. destroy(this.dw_uc)
  1314. destroy(this.cb_auto_create)
  1315. destroy(this.ln_5)
  1316. destroy(this.ln_6)
  1317. destroy(this.st_mxdscrp)
  1318. destroy(this.cb_dft)
  1319. destroy(this.st_dft_reldate)
  1320. destroy(this.ln_1)
  1321. destroy(this.ln_2)
  1322. destroy(this.ln_3)
  1323. destroy(this.ln_4)
  1324. destroy(this.r_bar)
  1325. end on
  1326. event closequery;IF dw_edit_mode THEN
  1327. Int ls_row = 0
  1328. dw_UC.AcceptText()
  1329. ls_row = dw_UC.GetNextModified(0, Primary!)+&
  1330. dw_UC.GetNextModified(0, Filter!)+dw_UC.DeletedCount()
  1331. IF ls_row > 0 THEN
  1332. IF MessageBox('是否保存','单据数据已经改变,是否确定要放弃保存?',Question!,YesNo!,2 ) = 2 THEN
  1333. RETURN 1
  1334. END IF
  1335. ELSE
  1336. ls_row = dw_child.GetNextModified(0, Primary!)+&
  1337. dw_child.GetNextModified(0, Filter!)+dw_child.DeletedCount()
  1338. IF ls_row > 0 THEN
  1339. IF MessageBox('是否保存','单据明细数据已经改变,是否确定要放弃保存?',Question!,YesNo!,2 ) = 2 THEN
  1340. RETURN 1
  1341. END IF
  1342. END IF
  1343. END IF
  1344. END IF
  1345. end event
  1346. event user_key;call super::user_key;IF KeyDown(KeyF6!) THEN
  1347. this.TRIGGEREVENT('ue_f6')
  1348. ELSEIF KeyDown(KeyF7!) THEN
  1349. this.TRIGGEREVENT('ue_f7')
  1350. ELSEIF KeyDown(KeyF8!) or KeyDown(KeyShift!) and KeyDown(KeyEnter!) THEN
  1351. this.TRIGGEREVENT('ue_f8')
  1352. ELSEIF KeyDown(KeyF9!) THEN
  1353. this.TRIGGEREVENT('ue_f9')
  1354. ELSEIF KeyDown(KeyF10!) THEN
  1355. this.TRIGGEREVENT('ue_f10')
  1356. ELSEIF KeyDown(KeyF11!) THEN
  1357. this.TRIGGEREVENT('ue_f11')
  1358. ELSEIF KeyDown(KeyF12!) THEN
  1359. this.TRIGGEREVENT('ue_f12')
  1360. ELSEIF KeyDown(KeyF4!) THEN
  1361. if cb_add.enabled then cb_add.TRIGGEREVENT(CLICKED!)
  1362. ELSEIF KeyDown(KeyF5!) THEN
  1363. if cb_edit.enabled then cb_edit.TRIGGEREVENT(CLICKED!)
  1364. end if
  1365. end event
  1366. event open;THIS.TriggerEvent('ue_before_open')
  1367. wf_movetocenter()
  1368. OLD_TITLE = THIS.Title
  1369. s_tran = Message.PowerObjectParm
  1370. IF NOT IsNull(s_tran) THEN
  1371. retrieve_all = s_tran.if_retrieve_all
  1372. mode = s_tran.work_mode
  1373. arg_pkid = s_tran.arg_pkid
  1374. arg_string_code = s_tran.arg_string_code
  1375. if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效
  1376. ds_share = s_tran.ds_share
  1377. i_cmonth = s_tran.e_long
  1378. END IF
  1379. dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  1380. dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关
  1381. dw_pageretr.SetTransObject (sqlca)
  1382. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  1383. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  1384. ls_newselect = ori_oldselect
  1385. ds_curquery = CREATE DATASTORE
  1386. ds_curquery.DataObject = 'd_extr_find'
  1387. ds_curquery.SetTransObject (sqlca)
  1388. wf_editindex_lockf()
  1389. sle_usual_query.Text = Trim(arg_string_code)
  1390. em_cmonth.text = string(i_cmonth)
  1391. //wf_refresh_interface()
  1392. wf_change_childdw_face()
  1393. IF NOT retrieve_all THEN
  1394. THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  1395. ELSE
  1396. IF if_sharedata THEN
  1397. ds_share.ShareData(dw_pageretr)
  1398. ELSE
  1399. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  1400. THIS.TriggerEvent('retrieve_pageretr')
  1401. END IF
  1402. END IF
  1403. IF retrieve_all THEN
  1404. THIS.TriggerEvent("ue_usual_query_filt")
  1405. END IF
  1406. uc_column_int = 10 //uc dw前7列可以编辑
  1407. child_column_int = 21 //子dw前19列可以编辑
  1408. uo_credence_ins = CREATE uo_credence
  1409. end event
  1410. event ue_before_open;dw_child_share.SetTransObject(sqlca)
  1411. dw_child.SetTransObject(sqlca)
  1412. dw_uc.SetTransObject(sqlca)
  1413. il_dft_cmonth = sys_curyearmon
  1414. wf_text()
  1415. //2.凭证字
  1416. datawindowchild childdw_credword
  1417. dw_uc.GetChild("credtype",childdw_credword)
  1418. childdw_credword.SetTransObject (sqlca)
  1419. childdw_credword.Retrieve(sys_accsetid)
  1420. IF childdw_credword.RowCount() <= 0 THEN
  1421. childdw_credword.InsertRow(0)
  1422. END IF
  1423. //3.结算方式
  1424. //datawindowchild childdw_banktypeid
  1425. //dw_child_share.GetChild("cw_credencemx_billid",childdw_banktypeid)
  1426. //childdw_banktypeid.SetTransObject (sqlca)
  1427. //childdw_banktypeid.Retrieve(sys_accsetid)
  1428. //IF childdw_banktypeid.RowCount() <= 0 THEN
  1429. // childdw_banktypeid.InsertRow(0)
  1430. //END IF
  1431. ////5.项目
  1432. //datawindowchild childdw_itemid
  1433. //dw_child_share.GetChild("cw_credencemx_itemid",childdw_itemid)
  1434. //childdw_itemid.SetTransObject (sqlca)
  1435. //childdw_itemid.Retrieve(sys_accsetid)
  1436. //IF childdw_itemid.RowCount() <= 0 THEN
  1437. // childdw_itemid.InsertRow(0)
  1438. //END IF
  1439. //6.外币
  1440. //datawindowchild childdw_moneyid
  1441. //dw_child.GetChild("cw_subject_moneyid",childdw_moneyid)
  1442. //childdw_moneyid.SetTransObject (sqlca)
  1443. //childdw_moneyid.Retrieve(sys_accsetid)
  1444. //IF childdw_moneyid.RowCount() <= 0 THEN
  1445. // childdw_moneyid.InsertRow(0)
  1446. //END IF
  1447. //
  1448. end event
  1449. event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  1450. Boolean cb_retrieve_enabled
  1451. cb_nextpage_enabled = cb_nextpage.Enabled
  1452. cb_retrieveall_enabled = cb_retrieveall.Enabled
  1453. cb_nextpage.Enabled = FALSE
  1454. cb_retrieveall.Enabled = FALSE
  1455. dw_pageretr.ShareDataOff()
  1456. dw_pageretr.Retrieve(sys_accsetid,cur_checkflag,cur_postflag,cur_credtype,i_cmonth)
  1457. IF dw_pageretr.RowCount() > 0 AND dw_pageretr.GetRow() = 0 THEN dw_pageretr.SetRow(1)
  1458. dw_pageretr.ShareData(dw_uc)
  1459. wf_flagstatus_rf()
  1460. THIS.TriggerEvent('retrieve_childdw')
  1461. cb_nextpage.Enabled = cb_nextpage_enabled
  1462. cb_retrieveall.Enabled = cb_retrieveall_enabled
  1463. end event
  1464. event key;this.triggerevent('user_key')
  1465. end event
  1466. event close;
  1467. DESTROY uo_credence_ins
  1468. end event
  1469. event ue_filter;OPENWITHPARM(w_filter_query,dw_uc)
  1470. STRING LS_EXPR
  1471. LS_EXPR=Message.StringParm
  1472. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  1473. dw_uc.setfilter(LS_EXPR)
  1474. dw_uc.SetRedraw (false)
  1475. dw_uc.filter()
  1476. dw_pageretr.triggerevent('ue_after_filter')
  1477. dw_uc.SetRedraw (true)
  1478. end event
  1479. event ue_sort;OPENwithparm(w_sortrow,dw_uc)
  1480. STRING LS_EXPR
  1481. LS_EXPR=Message.StringParm
  1482. IF ISNULL(LS_EXPR) THEN LS_EXPR=' '
  1483. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  1484. dw_uc.setsort(LS_EXPR)
  1485. dw_uc.SetRedraw (false)
  1486. dw_uc.sort()
  1487. dw_uc.SetRedraw (true)
  1488. end event
  1489. event ue_usual_query_filt;call super::ue_usual_query_filt;String obj_expr = ''
  1490. IF Trim(sle_usual_query.Text) <> '' THEN
  1491. obj_expr = obj_expr+'( credno = '+Trim(sle_usual_query.Text)+')'
  1492. END IF
  1493. dw_pageretr.SetFilter(obj_expr)
  1494. dw_pageretr.SetRedraw(FALSE)
  1495. dw_pageretr.Filter()
  1496. IF dw_pageretr.RowCount() >= 1 THEN
  1497. dw_pageretr.SelectRow(0,FALSE)
  1498. dw_pageretr.SelectRow(1,TRUE)
  1499. END IF
  1500. dw_pageretr.SetRedraw(TRUE)
  1501. end event
  1502. event resize;call super::resize;ln_1.EndX = THIS.Width
  1503. ln_2.EndX = THIS.Width
  1504. r_bar.Width = THIS.Width
  1505. Long w_width,w_height
  1506. w_width = 3600
  1507. w_height = 2300
  1508. IF newwidth < w_width THEN THIS.Width = w_width
  1509. IF newheight < w_height THEN THIS.Height = w_height
  1510. dw_pageretr.Width = THIS.Width - (w_width - 549)
  1511. dw_pageretr.Height = THIS.Height - (w_height - 1976)
  1512. mle_msg.Width = dw_pageretr.Width
  1513. mle_msg.Height = dw_pageretr.Height
  1514. dw_uc.Height = THIS.Height - (w_height - 1772)
  1515. dw_child.Height = THIS.Height - (w_height - 1300)
  1516. dw_child_share.Y = THIS.Height - (w_height - 1428)
  1517. ln_5.EndX = dw_pageretr.x - 5
  1518. ln_6.EndX = ln_5.EndX
  1519. ln_3.EndX = ln_5.EndX
  1520. ln_4.EndX = ln_5.EndX
  1521. ln_1.EndX = ln_5.EndX
  1522. ln_2.EndX = ln_5.EndX
  1523. end event
  1524. event ue_usual_query_retr;call super::ue_usual_query_retr;this.triggerevent('retrieve_pageretr')
  1525. end event
  1526. type cb_func from w_publ_pageretr`cb_func within w_credence_edit_popup
  1527. integer x = 722
  1528. integer y = 28
  1529. integer width = 192
  1530. end type
  1531. type cb_exit from w_publ_pageretr`cb_exit within w_credence_edit_popup
  1532. integer x = 2670
  1533. integer y = 0
  1534. integer width = 151
  1535. integer height = 164
  1536. integer taborder = 300
  1537. integer picsize = 16
  1538. toolbaralignment pic_align = alignattop!
  1539. boolean border = false
  1540. end type
  1541. type sle_usual_query from w_publ_pageretr`sle_usual_query within w_credence_edit_popup
  1542. integer x = 2866
  1543. integer y = 176
  1544. integer width = 128
  1545. boolean bringtotop = true
  1546. end type
  1547. type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_credence_edit_popup
  1548. boolean visible = false
  1549. integer x = 3150
  1550. integer y = 860
  1551. integer width = 151
  1552. integer taborder = 260
  1553. end type
  1554. type em_pagerowno from w_publ_pageretr`em_pagerowno within w_credence_edit_popup
  1555. boolean visible = false
  1556. integer x = 3141
  1557. integer y = 736
  1558. integer height = 92
  1559. integer taborder = 240
  1560. boolean bringtotop = true
  1561. end type
  1562. type dw_pageretr from w_publ_pageretr`dw_pageretr within w_credence_edit_popup
  1563. integer x = 2999
  1564. integer y = 176
  1565. integer width = 549
  1566. integer height = 1964
  1567. integer taborder = 50
  1568. string title = "凭证摘要内容"
  1569. string dataobject = "dw_credence_index"
  1570. end type
  1571. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;DW_UC.SetRow(currentrow)
  1572. DW_UC.ScrollToRow (currentrow)
  1573. IF NOT dw_edit_mode THEN PARENT.TriggerEvent('retrieve_childdw')
  1574. wf_flagstatus_rf()
  1575. end event
  1576. event dw_pageretr::ue_after_filter;if not dw_edit_mode then parent.triggerevent('retrieve_childdw')
  1577. end event
  1578. type st_1 from w_publ_pageretr`st_1 within w_credence_edit_popup
  1579. integer x = 1829
  1580. integer y = 196
  1581. integer width = 151
  1582. string text = "期间:"
  1583. alignment alignment = center!
  1584. end type
  1585. type cb_nextpage from w_publ_pageretr`cb_nextpage within w_credence_edit_popup
  1586. boolean visible = false
  1587. integer x = 3177
  1588. integer y = 616
  1589. integer width = 151
  1590. integer taborder = 290
  1591. end type
  1592. type cb_print from uo_imflatbutton within w_credence_edit_popup
  1593. integer x = 2286
  1594. integer width = 192
  1595. integer height = 164
  1596. integer taborder = 200
  1597. string text = "预览&P"
  1598. string normalpicname = "preview.bmp"
  1599. integer picsize = 16
  1600. toolbaralignment pic_align = alignattop!
  1601. boolean border = false
  1602. end type
  1603. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1604. String menustr
  1605. menustr = "Text=本位币格式~tEvent=ue_print_view"
  1606. menustr = menustr + "|" + "Text=外币格式~tEvent=ue_print_wb_view"
  1607. menustr = menustr + "|" + "Text=-"
  1608. menustr = menustr + "|" + "Text=预览打印列表凭证~tEvent=ue_print_list2"
  1609. IF Len(Trim(menustr)) <> 0 THEN
  1610. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1611. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1612. dmPopupMenu.mf_PopMenu()
  1613. DESTROY dmPopupMenu
  1614. END IF
  1615. end event
  1616. type cb_retrieve from uo_imflatbutton within w_credence_edit_popup
  1617. integer x = 1984
  1618. integer width = 151
  1619. integer height = 164
  1620. integer taborder = 130
  1621. string text = "刷新"
  1622. string normalpicname = "refresh.bmp"
  1623. integer picsize = 16
  1624. toolbaralignment pic_align = alignattop!
  1625. boolean border = false
  1626. end type
  1627. event clicked;parent.triggerevent('retrieve_pageretr')
  1628. end event
  1629. type cb_addzy from uo_imflatbutton within w_credence_edit_popup
  1630. integer x = 535
  1631. integer width = 192
  1632. integer height = 164
  1633. integer taborder = 220
  1634. boolean bringtotop = true
  1635. boolean enabled = false
  1636. string text = "获取&A"
  1637. string normalpicname = "find.bmp"
  1638. integer picsize = 16
  1639. toolbaralignment pic_align = alignattop!
  1640. boolean border = false
  1641. end type
  1642. event clicked;IF NOT dw_edit_mode THEN RETURN
  1643. Long child_row
  1644. String ls_brief,ls_subid
  1645. s_subject s_rt_subject
  1646. dw_child.AcceptText()
  1647. child_row = dw_child.GetRow()
  1648. IF child_row <= 0 THEN
  1649. MessageBox('系统提示','请选定当前目标凭证明细!')
  1650. RETURN
  1651. END IF
  1652. IF dw_child.GetColumnName() = 'brief' THEN
  1653. OPEN(w_briefdef_edit)
  1654. ls_brief = Message.StringParm
  1655. IF ls_brief = '' THEN RETURN
  1656. dw_child.Object.brief[child_row] = ls_brief
  1657. ELSEIF dw_child.GetColumnName() = 'subid' THEN
  1658. IF cbx_1.Checked THEN
  1659. IF NOT IsValid(w_subjectdef_edit) THEN OpenWithParm(w_subjectdef_edit,0)
  1660. ELSE
  1661. IF NOT IsValid(w_subjectdef_ch) THEN OpenWithParm(w_subjectdef_ch,Trim(dw_child.Object.subid[child_row]))
  1662. END IF
  1663. s_rt_subject = Message.PowerObjectParm
  1664. IF s_rt_subject.subid = '' THEN RETURN
  1665. wf_reshare_subid()
  1666. dw_child.Object.subid[child_row] = s_rt_subject.subid
  1667. dw_child.Object.cw_subject_moneyid[child_row] = s_rt_subject.moneyid
  1668. dw_child.Object.cw_subject_hswb[child_row] = s_rt_subject.hswb
  1669. dw_child.Object.cw_subject_hsqty[child_row] = s_rt_subject.hsqty
  1670. dw_child.Object.cw_subject_hsdept[child_row] = s_rt_subject.hsdept
  1671. dw_child.Object.cw_subject_hsemp[child_row] = s_rt_subject.hsemp
  1672. dw_child.Object.cw_subject_hsitem[child_row] = s_rt_subject.hsitem
  1673. dw_child.Object.cw_subject_dcflag[child_row] = s_rt_subject.dcflag
  1674. dw_child.Object.cw_subject_hscust[child_row] = s_rt_subject.hscust
  1675. dw_child.Object.cw_subject_hsspt[child_row] = s_rt_subject.hsspt
  1676. dw_child.Object.cw_subject_hstrader[child_row] = s_rt_subject.hstrader
  1677. wf_rtr_balc()
  1678. IF s_rt_subject.hswb <> 0 THEN
  1679. if_fcurrency = TRUE
  1680. wf_change_childdw_face()
  1681. IF s_rt_subject.hswb = 2 THEN
  1682. Long ll_moneyid_native
  1683. Decimal ld_rate
  1684. SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate
  1685. FROM cw_currency Where accsetid = :sys_accsetid AND native = 1;
  1686. IF sqlca.SQLCode <> 0 THEN
  1687. ll_moneyid_native = 0
  1688. ld_rate = 0
  1689. ELSE
  1690. dw_child.Object.cw_subject_moneyid[child_row] = ll_moneyid_native
  1691. dw_child.Object.rate[child_row] = ld_rate
  1692. END IF
  1693. END IF
  1694. END IF
  1695. END IF
  1696. //cw_subject_hsdept
  1697. //cw_subject_hsemp
  1698. //cw_subject_hsitem
  1699. //cw_subject_hsqty
  1700. //cw_subject_hswb
  1701. //cw_subject_moneyid
  1702. //cw_subject_specialcode
  1703. end event
  1704. type cb_delet from uo_imflatbutton within w_credence_edit_popup
  1705. integer x = 384
  1706. integer width = 151
  1707. integer height = 164
  1708. integer taborder = 210
  1709. string text = "删除"
  1710. string normalpicname = "delete.bmp"
  1711. integer picsize = 16
  1712. toolbaralignment pic_align = alignattop!
  1713. boolean border = false
  1714. end type
  1715. event clicked;IF NOT f_power_ind(1972,sys_msg_pow) THEN
  1716. MessageBox(publ_operator,'你没有使用权限!')
  1717. RETURN
  1718. END IF
  1719. IF dw_edit_mode THEN RETURN
  1720. IF MessageBox ("IF","是否确定要删除当前凭证吗?",Question!,YesNo! ) = 2 THEN RETURN
  1721. String arg_msg = ''
  1722. Long uc_row
  1723. Long ls_subaccsetid,ls_credid
  1724. uc_row = dw_uc.GetRow()
  1725. IF uc_row <= 0 THEN
  1726. MessageBox('系统提示','请选定当前目标凭证!')
  1727. RETURN
  1728. END IF
  1729. ls_subaccsetid = dw_uc.Object.subaccsetid[uc_row]
  1730. ls_credid = dw_uc.Object.credid[uc_row]
  1731. IF uo_credence_ins.del(0,ls_subaccsetid,ls_credid,arg_msg,TRUE) = 0 THEN
  1732. MessageBox('Error!',arg_msg)
  1733. ELSE
  1734. //日志
  1735. String ls_credtype
  1736. long ls_credno
  1737. ls_credtype = dw_uc.Object.credtype[uc_row]
  1738. ls_credno = dw_uc.Object.credno[uc_row]
  1739. f_setsysoplog('凭证','删除,帐套:'+s_sys_accset.cropname+'字:'+ls_credtype+',号:'+string(ls_credno),arg_msg,TRUE)
  1740. //--
  1741. MessageBox(publ_operator,'删除凭证'+String(dw_uc.Object.credno[uc_row])+'成功!')
  1742. dw_pageretr.DeleteRow(uc_row)
  1743. dw_pageretr.PostEvent(RowFocusChanged!)
  1744. END IF
  1745. end event
  1746. type cb_edit from uo_imflatbutton within w_credence_edit_popup
  1747. integer x = 192
  1748. integer width = 192
  1749. integer height = 164
  1750. integer taborder = 80
  1751. string text = "修改&E"
  1752. string normalpicname = "open.bmp"
  1753. integer picsize = 16
  1754. toolbaralignment pic_align = alignattop!
  1755. boolean border = false
  1756. end type
  1757. event clicked;IF NOT f_power_ind(1971,sys_msg_pow) THEN
  1758. MessageBox(publ_operator,'你没有使用权限!')
  1759. RETURN
  1760. END IF
  1761. String arg_msg = ''
  1762. Long uc_row
  1763. Long ls_subaccsetid,ls_credid
  1764. uc_row = dw_uc.GetRow()
  1765. IF uc_row <= 0 THEN
  1766. MessageBox('系统提示','请选定当前目标凭证!')
  1767. RETURN
  1768. END IF
  1769. ls_subaccsetid = dw_uc.Object.subaccsetid[uc_row]
  1770. ls_credid = dw_uc.Object.credid[uc_row]
  1771. IF NOT dw_edit_mode THEN
  1772. IF uo_credence_ins.UPDATEbegin(ls_subaccsetid,ls_credid,arg_msg) = 0 THEN
  1773. MessageBox(publ_operator,arg_msg)
  1774. RETURN
  1775. END IF
  1776. END IF
  1777. IF dw_edit_mode THEN
  1778. IF MessageBox ("IF","是否确定要放弃保存当前单据?",Question!,YesNo! ) = 2 THEN RETURN
  1779. END IF
  1780. dw_edit_mode = NOT dw_edit_mode
  1781. wf_refresh_interface()
  1782. IF dw_edit_mode THEN
  1783. dw_uc.SetFocus()
  1784. cur_editfoucs = 2
  1785. ELSE
  1786. PARENT.TriggerEvent('retrieve_pageretr')
  1787. IF if_fcurrency THEN
  1788. if_fcurrency = FALSE
  1789. wf_change_childdw_face()
  1790. END IF
  1791. cur_editfoucs = 0
  1792. END IF
  1793. end event
  1794. type cb_add from uo_imflatbutton within w_credence_edit_popup
  1795. integer width = 192
  1796. integer height = 164
  1797. integer taborder = 70
  1798. string text = "新建&S"
  1799. string normalpicname = "new.bmp"
  1800. integer picsize = 16
  1801. toolbaralignment pic_align = alignattop!
  1802. boolean border = false
  1803. end type
  1804. event clicked;IF NOT f_power_ind(1971,sys_msg_pow) THEN
  1805. MessageBox(publ_operator,'你没有使用权限!')
  1806. RETURN
  1807. END IF
  1808. String arg_msg = ''
  1809. Long uc_row
  1810. Decimal sum_debit,sum_credit
  1811. DateTime firstdate,enddate
  1812. Long i
  1813. Long ls_yearmon
  1814. ls_yearmon = il_dft_cmonth
  1815. IF ls_yearmon < s_sys_accset.curryear THEN
  1816. MessageBox(publ_operator,'默认凭证月份小于当前会计期间,操作取消!')
  1817. RETURN
  1818. END IF
  1819. IF dw_edit_mode THEN
  1820. dw_uc.AcceptText()
  1821. dw_child.AcceptText()
  1822. dw_child_share.AcceptText()
  1823. uc_row = dw_uc.GetRow()
  1824. IF uc_row <= 0 THEN
  1825. MessageBox(publ_operator,'请选定当前目标凭证!')
  1826. RETURN
  1827. END IF
  1828. IF sys_option_credno_save = 0 THEN
  1829. IF dw_uc.Object.credno[uc_row] <= 0 THEN
  1830. MessageBox(publ_operator,'请正确填写凭证编号!')
  1831. RETURN
  1832. END IF
  1833. END IF
  1834. sum_debit = dw_child.Object.sum_debit[1]
  1835. sum_credit = dw_child.Object.sum_credit[1]
  1836. IF sum_debit <> 0 OR sum_credit <> 0 THEN
  1837. IF String(sum_debit,'###0.00') <> String(sum_credit,'###0.00') THEN
  1838. IF (String(sum_debit,'###0.00') = '0.00' OR String(sum_debit,'###0.00') = '-0.00') AND &
  1839. (String(sum_credit,'###0.00') = '0.00' OR String(sum_credit,'###0.00') = '-0.00') THEN
  1840. ELSE
  1841. MessageBox(publ_operator,'借、贷方金额不等!')
  1842. RETURN
  1843. END IF
  1844. END IF
  1845. END IF
  1846. //====================================================================
  1847. // script - clicked for cb_add
  1848. // reason:检查数量是否已录入
  1849. //--------------------------------------------------------------------
  1850. // modified by: yyx date: 2004.02.17
  1851. //--------------------------------------------------------------------
  1852. FOR i = 1 TO dw_child.RowCount()
  1853. String is_subid,is_brief
  1854. Int is_hsqty
  1855. Decimal is_amount,is_price
  1856. is_brief = dw_child.Object.brief[i]
  1857. is_subid = dw_child.Object.subid[i]
  1858. is_hsqty = dw_child.Object.cw_subject_hsqty[i]
  1859. is_amount = dw_child.Object.cw_credencemx_amount[i]
  1860. is_price = dw_child.Object.cw_credencemx_price[i]
  1861. IF IsNull(is_hsqty) THEN is_hsqty = 0
  1862. IF IsNull(is_amount) THEN is_amount = 0
  1863. IF IsNull(is_price) THEN is_price = 0
  1864. IF is_hsqty = 1 AND is_amount = 0 AND is_price = 0 THEN
  1865. IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"没有录入数量,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN
  1866. END IF
  1867. Int li_hsdept,li_hsitem,li_hscust,li_hsspt
  1868. Long ll_itemid,ll_deptid,ll_cusid,ll_sptid
  1869. li_hsdept = dw_child.Object.cw_subject_hsdept[i]
  1870. ll_deptid = dw_child.Object.cw_credencemx_deptid[i]
  1871. li_hsitem = dw_child.Object.cw_subject_hsitem[i]
  1872. ll_itemid = dw_child.Object.cw_credencemx_itemid[i]
  1873. li_hscust = dw_child.Object.cw_subject_hscust[i]
  1874. ll_cusid = dw_child.Object.cw_credencemx_cusid[i]
  1875. li_hsspt = dw_child.Object.cw_subject_hsspt[i]
  1876. ll_sptid = dw_child.Object.cw_credencemx_sptid[i]
  1877. IF IsNull(li_hsdept) THEN li_hsdept = 0
  1878. IF IsNull(ll_deptid) THEN ll_deptid = 0
  1879. IF IsNull(li_hsitem) THEN li_hsitem = 0
  1880. IF IsNull(ll_itemid) THEN ll_itemid = 0
  1881. IF IsNull(li_hscust) THEN li_hscust = 0
  1882. IF IsNull(ll_cusid) THEN ll_cusid = 0
  1883. IF IsNull(li_hsspt) THEN li_hsspt = 0
  1884. IF IsNull(ll_sptid) THEN ll_sptid = 0
  1885. IF li_hsdept = 1 AND ll_deptid = 0 THEN
  1886. IF sys_option_cred_dics_limit = 0 THEN
  1887. IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算部门,分录没有选择部门,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN
  1888. ELSE
  1889. MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算部门,分录没有选择部门,不能保存当前凭证,请检查")
  1890. END IF
  1891. END IF
  1892. IF li_hsitem = 1 AND ll_itemid = 0 THEN
  1893. IF sys_option_cred_dics_limit = 0 THEN
  1894. IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算项目,分录没有选择项目,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN
  1895. ELSE
  1896. MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算项目,分录没有选择项目,不能保存当前凭证,请检查")
  1897. END IF
  1898. END IF
  1899. IF li_hscust = 1 AND ll_cusid = 0 THEN
  1900. IF sys_option_cred_dics_limit = 0 THEN
  1901. IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算客户,分录没有选择客户,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN
  1902. ELSE
  1903. MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算客户,分录没有选择客户,不能保存当前凭证,请检查")
  1904. END IF
  1905. END IF
  1906. IF li_hsspt = 1 AND ll_sptid = 0 THEN
  1907. IF sys_option_cred_dics_limit = 0 THEN
  1908. IF MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算供应商,分录没有选择供应商,是否确定要保存当前凭证吗?",question!,yesno! ) = 2 THEN RETURN
  1909. ELSE
  1910. MessageBox ("询问","摘要:"+is_brief+",科目:"+is_subid+"核算供应商,分录没有选择供应商,不能保存当前凭证,请检查")
  1911. END IF
  1912. END IF
  1913. NEXT
  1914. //====================================================================
  1915. //====================================================================
  1916. // script - clicked for cb_add
  1917. // reason:检查贷方是否录入现金银行
  1918. //--------------------------------------------------------------------
  1919. // modified by: yyx date: 2004.02.17
  1920. //--------------------------------------------------------------------
  1921. IF sys_bank_awoke = 1 THEN
  1922. FOR i = 1 TO dw_child.RowCount()
  1923. Dec arg_rawdebit,arg_rawcredit
  1924. IF dw_child.Object.debit[i] <> 0 THEN
  1925. arg_rawdebit = dw_child.Object.cw_credencemx_rawmoney[i]
  1926. arg_rawcredit = 0
  1927. ELSEIF dw_child.Object.credit[i] <> 0 THEN
  1928. arg_rawdebit = 0
  1929. arg_rawcredit = dw_child.Object.cw_credencemx_rawmoney[i]
  1930. END IF
  1931. IF f_check_credit(dw_uc.Object.credid[uc_row],dw_child.Object.subid[i],&
  1932. dw_child.Object.debit[i],dw_child.Object.credit[i],&
  1933. arg_rawdebit,arg_rawcredit,arg_msg) = 0 THEN
  1934. IF MessageBox ("询问","科目:"+String(dw_child.Object.subid[i])+" 为现金或银行余额贷方分录,是否确定要保存当前凭证吗? ~n" + arg_msg,question!,yesno! ) = 2 THEN RETURN
  1935. END IF
  1936. NEXT
  1937. END IF
  1938. //====================================================================
  1939. uo_credence_ins.subaccsetid = dw_uc.Object.subaccsetid[uc_row] //子帐id
  1940. uo_credence_ins.credno = dw_uc.Object.credno[uc_row] // 编号
  1941. uo_credence_ins.creddate = dw_uc.Object.creddate[uc_row] // 日期
  1942. uo_credence_ins.billnumber = dw_uc.Object.billnumber[uc_row] //附件
  1943. uo_credence_ins.credtype = dw_uc.Object.credtype[uc_row] //凭证字
  1944. uo_credence_ins.reldcode = dw_uc.Object.reldcode[uc_row] //凭证字
  1945. uo_credence_ins.reldate = dw_uc.Object.reldate[uc_row] //凭证字
  1946. uo_credence_ins.ifauto = 0
  1947. IF s_tran.c_long > 0 THEN
  1948. uo_credence_ins.readtype = s_tran.c_long
  1949. ELSE
  1950. uo_credence_ins.readtype = dw_uc.Object.readtype[uc_row]
  1951. END IF
  1952. uo_credence_ins.relevantbillid = s_tran.d_long
  1953. uo_credence_ins.cmonth = ls_yearmon // 日期
  1954. FOR i = 1 TO dw_child.RowCount()
  1955. Dec ls_rawdebit,ls_rawcredit,ls_price,ls_amount
  1956. String ls_brief
  1957. IF dw_child.Object.debit[i] <> 0 THEN
  1958. ls_rawdebit = dw_child.Object.cw_credencemx_rawmoney[i]
  1959. ls_rawcredit = 0
  1960. ELSEIF dw_child.Object.credit[i] <> 0 THEN
  1961. ls_rawdebit = 0
  1962. ls_rawcredit = dw_child.Object.cw_credencemx_rawmoney[i]
  1963. END IF
  1964. ls_amount = dw_child.Object.cw_credencemx_amount[i]
  1965. IF ls_amount = 0 THEN
  1966. ls_price = 0
  1967. ELSE
  1968. ls_price = Round((dw_child.Object.debit[i] + dw_child.Object.credit[i])/ls_amount ,4)
  1969. END IF
  1970. ls_brief = Trim(dw_child.Object.brief[i])
  1971. IF uo_credence_ins.acceptmx(dw_child.Object.no[i],dw_child.Object.subid[i],&
  1972. ls_brief,dw_child.Object.rate[i],ls_rawdebit,&
  1973. ls_rawcredit,dw_child.Object.debit[i],dw_child.Object.credit[i],&
  1974. ls_amount,ls_price,&
  1975. dw_child.Object.cw_credencemx_deptid[i],dw_child.Object.cw_credencemx_itemid[i],&
  1976. dw_child.Object.cw_credencemx_billdate[i],dw_child.Object.cw_credencemx_billid[i],&
  1977. dw_child.Object.cw_credencemx_billno[i],dw_child.Object.cropbillid[i],&
  1978. dw_child.Object.cw_credencemx_readonly[i],&
  1979. dw_child.Object.cw_credencemx_cusid[i],&
  1980. dw_child.Object.cw_credencemx_sptid[i],&
  1981. dw_child.Object.cw_credencemx_empid[i] ,arg_msg) = 0 THEN
  1982. MessageBox('error!',arg_msg)
  1983. RETURN
  1984. END IF
  1985. NEXT
  1986. IF uo_credence_ins.Save(publ_operator,arg_msg,TRUE) = 0 THEN
  1987. MessageBox('error!',arg_msg)
  1988. RETURN
  1989. END IF
  1990. MessageBox(publ_operator,'保存操作成功!')
  1991. //write ini
  1992. SetProfileString (sys_inifilename,publ_userid+'_'+dw_uc.DataObject, String(sys_accsetid),dw_uc.Object.credtype[dw_uc.GetRow()])
  1993. //
  1994. dw_pageretr.SelectRow(0,FALSE)
  1995. dw_pageretr.SelectRow(uc_row,TRUE)
  1996. wf_refresh_curuc(uo_credence_ins.subaccsetid,uo_credence_ins.credid) //刷新uc
  1997. IF if_fcurrency THEN
  1998. if_fcurrency = FALSE
  1999. wf_change_childdw_face()
  2000. END IF
  2001. ELSE
  2002. IF uo_credence_ins.newbegin() = 0 THEN
  2003. MessageBox('error!',arg_msg)
  2004. RETURN
  2005. END IF
  2006. END IF
  2007. //call super::clicked
  2008. IF NOT dw_edit_mode THEN
  2009. Int li_row, li_cur_row
  2010. li_cur_row = dw_pageretr.GetRow()
  2011. li_row = dw_pageretr.InsertRow (li_cur_row)
  2012. dw_pageretr.ScrollToRow (li_row)
  2013. END IF
  2014. dw_edit_mode = NOT dw_edit_mode
  2015. wf_refresh_interface()
  2016. IF dw_edit_mode THEN
  2017. dw_child.Reset()
  2018. FOR i = 1 TO sys_credence_insertrow
  2019. dw_child.InsertRow(0)
  2020. NEXT
  2021. //
  2022. dw_uc.SetRedraw(FALSE)
  2023. //read ini
  2024. String ls_credtype_ini
  2025. ls_credtype_ini = ProfileString(sys_inifilename,publ_userid+'_'+dw_uc.DataObject,String(sys_accsetid),'')
  2026. dw_uc.Object.credtype[li_row] = ls_credtype_ini
  2027. //
  2028. dw_uc.AcceptText()
  2029. String ls_credtype
  2030. DateTime ls_creddate
  2031. ls_credtype = Trim(dw_uc.Object.credtype[li_row])
  2032. IF sys_option_credno_save = 0 THEN
  2033. dw_uc.Object.credno[li_row] = uo_credence_ins.get_new_credno(0,ls_credtype,ls_yearmon,arg_msg)
  2034. IF Trim(arg_msg) <> '' THEN MessageBox('提示',arg_msg)
  2035. END IF
  2036. ls_creddate = f_rst_mon_1st(3,ls_yearmon)
  2037. dw_uc.Object.creddate[li_row] = ls_creddate
  2038. IF ii_if_dft_reldate = 0 THEN
  2039. dw_uc.Object.reldate[li_row] = ls_creddate
  2040. ELSE
  2041. dw_uc.Object.reldate[li_row] = idt_dft_reldate
  2042. END IF
  2043. dw_uc.SetColumn("reldate")
  2044. //
  2045. dw_uc.SetRedraw(TRUE)
  2046. dw_uc.SetFocus()
  2047. cur_editfoucs = 1
  2048. ELSE
  2049. cur_editfoucs = 0
  2050. PARENT.TriggerEvent("retrieve_childdw")
  2051. IF sys_option_cred_auto_savecreate = 1 THEN cb_auto_create.TriggerEvent(Clicked!)
  2052. END IF
  2053. end event
  2054. type cb_add_xm from uo_imflatbutton within w_credence_edit_popup
  2055. integer x = 1070
  2056. integer width = 265
  2057. integer height = 164
  2058. integer taborder = 90
  2059. boolean enabled = false
  2060. string text = "插明细F8"
  2061. string normalpicname = "mx.bmp"
  2062. integer picsize = 16
  2063. toolbaralignment pic_align = alignattop!
  2064. boolean border = false
  2065. end type
  2066. event clicked;int li_row_1, li_cur_row_1
  2067. li_cur_row_1 = dw_child.GetRow()
  2068. li_row_1 = dw_child.InsertRow (li_cur_row_1)
  2069. dw_child.ScrollToRow (li_row_1)
  2070. dw_child.SetFocus()
  2071. end event
  2072. type cb_dele_xm from uo_imflatbutton within w_credence_edit_popup
  2073. integer x = 1335
  2074. integer width = 224
  2075. integer height = 164
  2076. integer taborder = 100
  2077. boolean enabled = false
  2078. string text = "删明细"
  2079. string normalpicname = "mx1.bmp"
  2080. integer picsize = 16
  2081. toolbaralignment pic_align = alignattop!
  2082. boolean border = false
  2083. end type
  2084. event clicked;IF MessageBox ("IF","是否确定要删除当前细目记录?",Question!,YesNo! ) = 2 THEN RETURN
  2085. IF dw_child.GETROW()=0 THEN
  2086. MESSAGEBOX('NO','请选择删除的行对象!')
  2087. RETURN
  2088. END IF
  2089. dw_child.DeleteRow (0)
  2090. dw_child.TriggerEvent (rowfocuschanged!)
  2091. end event
  2092. type cb_showall from uo_imflatbutton within w_credence_edit_popup
  2093. integer x = 2135
  2094. integer width = 151
  2095. integer height = 164
  2096. integer taborder = 190
  2097. string text = "所有"
  2098. string normalpicname = "setting.bmp"
  2099. integer picsize = 16
  2100. toolbaralignment pic_align = alignattop!
  2101. boolean border = false
  2102. end type
  2103. event clicked;dw_uc.setfilter('')
  2104. dw_uc.SetRedraw (false)
  2105. dw_uc.filter()
  2106. dw_uc.SetRedraw (true)
  2107. end event
  2108. type cb_auditing from uo_imflatbutton within w_credence_edit_popup
  2109. integer x = 727
  2110. integer width = 192
  2111. integer height = 164
  2112. integer taborder = 250
  2113. boolean bringtotop = true
  2114. string text = "审核&F"
  2115. string normalpicname = "audit.bmp"
  2116. integer picsize = 16
  2117. toolbaralignment pic_align = alignattop!
  2118. boolean border = false
  2119. end type
  2120. event clicked;IF NOT f_power_ind(1973,sys_msg_pow) THEN
  2121. MessageBox(publ_operator,'你没有使用权限!')
  2122. RETURN
  2123. END IF
  2124. IF dw_edit_mode THEN RETURN
  2125. String arg_msg = ''
  2126. Long pagerert_row
  2127. Long ls_subaccsetid,ls_credid
  2128. pagerert_row = dw_uc.GetRow()
  2129. IF pagerert_row <= 0 THEN
  2130. MessageBox('系统提示','请选定当前目标凭证!')
  2131. RETURN
  2132. END IF
  2133. IF MessageBox ("IF","是否确定要"+THIS.Text+"当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  2134. ls_subaccsetid = dw_uc.Object.subaccsetid[pagerert_row]
  2135. ls_credid = dw_uc.Object.credid[pagerert_row]
  2136. IF wf_check_cash(arg_msg) = 0 THEN
  2137. MessageBox('提示',arg_msg)
  2138. RETURN
  2139. END IF
  2140. IF uo_credence_ins.Check(ls_subaccsetid,ls_credid,arg_msg,TRUE) = 0 THEN
  2141. MessageBox('Error!',arg_msg)
  2142. ELSE
  2143. MessageBox(publ_operator,'审核成功!')
  2144. wf_refresh_curuc(ls_subaccsetid,ls_credid)
  2145. END IF
  2146. end event
  2147. type dw_child from u_dw_rbtnfilter within w_credence_edit_popup
  2148. event dwnkey pbm_dwnkey
  2149. integer x = 5
  2150. integer y = 652
  2151. integer width = 2990
  2152. integer height = 1300
  2153. integer taborder = 30
  2154. boolean bringtotop = true
  2155. string dataobject = "dw_credencemx_index_popup"
  2156. boolean vscrollbar = true
  2157. borderstyle borderstyle = stylebox!
  2158. end type
  2159. event dwnkey;PARENT.TriggerEvent('user_key')
  2160. String ls_subid,ls_briefcode,ls_briefname,ls_dftsubid,ls_subid_find,ls_subid_like
  2161. Long ls_moneyid,cnt
  2162. Int ls_hswb,ls_hsqty,ls_hsdept,ls_hsemp,ls_hsitem,ls_dcflag,ls_hscust,ls_hsspt,ls_hstrader
  2163. Dec ls_rawmoney
  2164. Double ls_rawrate
  2165. Long child_row
  2166. IF dw_edit_mode THEN
  2167. child_row = dw_child.GetRow()
  2168. IF child_row <= 0 THEN RETURN
  2169. // IF (KeyDown(keyenter!) OR KeyDown(keytab!)) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN
  2170. IF KeyDown(keyenter!) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN
  2171. IF dw_child.GetColumnName() = 'brief' THEN
  2172. dw_child.AcceptText()
  2173. ls_briefcode = dw_child.Object.brief[child_row]
  2174. IF ls_briefcode <> '' THEN
  2175. SELECT top 1 briefname,dftsubid INTO :ls_briefname,:ls_dftsubid
  2176. FROM cw_brief
  2177. WHERE (briefcode = :ls_briefcode OR briefname = :ls_briefcode)
  2178. AND accsetid = :sys_accsetid;
  2179. IF sqlca.SQLCode <> 0 OR IsNull(ls_briefname) THEN ls_briefname = ''
  2180. IF ls_briefname <> '' THEN
  2181. dw_child.Object.brief[child_row] = ls_briefname
  2182. IF dw_child.Object.subid[child_row] = '' THEN
  2183. dw_child.Object.subid[child_row] = ls_dftsubid
  2184. END IF
  2185. END IF
  2186. END IF
  2187. IF Key = keyenter! THEN
  2188. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2189. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2190. RETURN 1
  2191. END IF
  2192. ELSEIF dw_child.GetColumnName() = 'subid' THEN
  2193. dw_child.AcceptText()
  2194. ls_subid = dw_child.Object.subid[child_row]
  2195. ls_subid_like = '%'+ls_subid+'%'
  2196. SELECT count(*) INTO :cnt
  2197. FROM cw_subject
  2198. WHERE ( cw_subject.subid LIKE :ls_subid_like OR cw_subject.name LIKE :ls_subid_like )
  2199. AND cw_subject.accsetid = :sys_accsetid;
  2200. IF sqlca.SQLCode <> 0 THEN
  2201. cb_addzy.TriggerEvent(Clicked!)
  2202. RETURN 1
  2203. END IF
  2204. IF cnt <> 1 THEN
  2205. cb_addzy.TriggerEvent(Clicked!)
  2206. RETURN 1
  2207. END IF
  2208. SELECT top 1 cw_subject.moneyid,hswb,hsqty,hsdept,hsemp,hsitem,dcflag,cw_currency.rate,
  2209. hscust,hsspt,cw_subject.subid,cw_subject.hstrader
  2210. INTO :ls_moneyid,:ls_hswb,:ls_hsqty,:ls_hsdept,
  2211. :ls_hsemp,:ls_hsitem,:ls_dcflag,:ls_rawrate,:ls_hscust,:ls_hsspt,:ls_subid_find,:ls_hstrader
  2212. FROM cw_subject left OUTER join cw_currency on
  2213. cw_subject.accsetid = cw_currency.accsetid AND
  2214. cw_subject.moneyid = cw_currency.moneyid
  2215. WHERE ( cw_subject.subid LIKE :ls_subid_like OR cw_subject.name LIKE :ls_subid_like )
  2216. AND cw_subject.accsetid = :sys_accsetid;
  2217. IF sqlca.SQLCode <> 0 THEN
  2218. cb_addzy.TriggerEvent(Clicked!)
  2219. RETURN 1
  2220. END IF
  2221. dw_child.Object.cw_subject_moneyid[child_row] = ls_moneyid
  2222. dw_child.Object.cw_subject_hswb[child_row] = ls_hswb
  2223. dw_child.Object.cw_subject_hsqty[child_row] = ls_hsqty
  2224. dw_child.Object.cw_subject_hsdept[child_row] = ls_hsdept
  2225. dw_child.Object.cw_subject_hsemp[child_row] = ls_hsemp
  2226. dw_child.Object.cw_subject_hsitem[child_row] = ls_hsitem
  2227. dw_child.Object.cw_subject_dcflag[child_row] = ls_dcflag
  2228. dw_child.Object.cw_subject_hscust[child_row] = ls_hscust
  2229. dw_child.Object.cw_subject_hsspt[child_row] = ls_hsspt
  2230. dw_child.Object.cw_subject_hstrader[child_row] = ls_hstrader
  2231. dw_child.Object.subid[child_row] = ls_subid_find
  2232. wf_rtr_balc()
  2233. IF ls_hswb <> 0 THEN
  2234. if_fcurrency = TRUE
  2235. dw_child.Object.rate[child_row] = ls_rawrate
  2236. wf_change_childdw_face()
  2237. IF ls_hswb = 2 THEN
  2238. Long ll_moneyid_native
  2239. Decimal ld_rate
  2240. SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate
  2241. FROM cw_currency Where accsetid = :sys_accsetid AND native = 1;
  2242. IF sqlca.SQLCode <> 0 THEN
  2243. ll_moneyid_native = 0
  2244. ld_rate = 0
  2245. ELSE
  2246. dw_child.Object.cw_subject_moneyid[child_row] = ll_moneyid_native
  2247. dw_child.Object.rate[child_row] = ld_rate
  2248. END IF
  2249. END IF
  2250. ELSE
  2251. dw_child.Object.rate[child_row] = 0
  2252. END IF
  2253. IF Key = keyenter! THEN
  2254. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2255. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2256. RETURN 1
  2257. END IF
  2258. ELSEIF dw_child.GetColumnName() = 'cw_credencemx_rawmoney' THEN
  2259. dw_child.AcceptText()
  2260. IF dw_child.Object.cw_subject_moneyid[child_row] > 0 THEN
  2261. ls_rawrate = dw_child.Object.rate[child_row]
  2262. ls_rawmoney = dw_child.Object.cw_credencemx_rawmoney[child_row]
  2263. IF dw_child.Object.cw_subject_dcflag[child_row] = 1 THEN
  2264. dw_child.Object.debit[child_row] = Round(ls_rawmoney * ls_rawrate,2)
  2265. ELSE
  2266. dw_child.Object.credit[child_row] = Round(ls_rawmoney * ls_rawrate,2)
  2267. END IF
  2268. IF Key = keyenter! THEN
  2269. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2270. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2271. RETURN 1
  2272. END IF
  2273. END IF
  2274. ELSEIF dw_child.GetColumnName() = 'debit' THEN
  2275. dw_child.AcceptText()
  2276. wf_rtr_balc()
  2277. IF dw_child.Object.debit[child_row] <> 0 THEN dw_child.Object.credit[child_row] = 0
  2278. IF Key = keyenter! THEN
  2279. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2280. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2281. RETURN 1
  2282. ELSEIF Key = KeySpaceBar! THEN
  2283. dw_child.SetRedraw(FALSE)
  2284. dw_child.SetColumn('credit')
  2285. dw_child.Object.credit[child_row] = dw_child.Object.debit[child_row]
  2286. dw_child.Object.debit[child_row] = 0
  2287. dw_child.SetRedraw(TRUE)
  2288. RETURN 1
  2289. END IF
  2290. ELSEIF dw_child.GetColumnName() = 'credit' THEN
  2291. dw_child.AcceptText()
  2292. wf_rtr_balc()
  2293. IF Key = keyenter! THEN
  2294. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2295. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2296. RETURN 1
  2297. ELSEIF Key = KeySpaceBar! THEN
  2298. dw_child.SetRedraw(FALSE)
  2299. dw_child.SetColumn('debit')
  2300. dw_child.Object.debit[child_row] = dw_child.Object.credit[child_row]
  2301. dw_child.Object.credit[child_row] = 0
  2302. dw_child.SetRedraw(TRUE)
  2303. RETURN 1
  2304. END IF
  2305. IF dw_child.Object.credit[child_row] <> 0 THEN
  2306. dw_child.Object.debit[child_row] = 0
  2307. dw_child.AcceptText()
  2308. END IF
  2309. ELSE
  2310. IF Key = keyenter! THEN
  2311. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2312. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2313. RETURN 1
  2314. END IF
  2315. END IF
  2316. ELSE
  2317. IF KeyDown( KeyF12!) AND dw_child.GetColumnName() = 'brief' THEN
  2318. dw_child.AcceptText()
  2319. dw_child.SetRedraw(FALSE)
  2320. IF child_row > 1 THEN
  2321. dw_child.Object.brief[child_row] = dw_child.Object.brief[child_row - 1]
  2322. END IF
  2323. dw_child.SetRedraw(TRUE)
  2324. elseIF KeyDown( KeyF11!) AND dw_child.GetColumnName() = 'brief' THEN
  2325. dw_child.AcceptText()
  2326. dw_child.SetRedraw(FALSE)
  2327. IF child_row > 1 THEN
  2328. dw_child.Object.brief[child_row] = dw_child.Object.brief[1]
  2329. END IF
  2330. dw_child.SetRedraw(TRUE)
  2331. END IF
  2332. END IF
  2333. END IF
  2334. end event
  2335. event constructor;call super::constructor;titleclick_sort_use=true
  2336. end event
  2337. event clicked;call super::clicked;//IF row > 0 THEN
  2338. //
  2339. //
  2340. // this.setrow(row)
  2341. // this.selectrow(0,false)
  2342. // this.selectrow(row,true)
  2343. //
  2344. // dw_child_share.SETROW(this.getrow())
  2345. // dw_child_share.ScrollToRow (this.getrow())
  2346. //end if
  2347. end event
  2348. event doubleclicked;IF NOT dw_edit_mode THEN RETURN
  2349. dw_child.AcceptText()
  2350. IF dwo.Name = 'cw_subject_moneyid' THEN
  2351. IF dw_child.Object.cw_subject_hswb[row] = 2 THEN
  2352. IF NOT IsValid(w_currency_ch) THEN
  2353. OPEN(w_currency_ch)
  2354. s_currency s_ch_rst
  2355. s_ch_rst = Message.PowerObjectParm
  2356. IF s_ch_rst.moneyid = 0 THEN RETURN
  2357. dw_child.Object.cw_subject_moneyid[row] = s_ch_rst.moneyid
  2358. dw_child.Object.rate[row] = s_ch_rst.rate
  2359. dw_child.setcolumn('cw_credencemx_rawmoney')
  2360. END IF
  2361. END IF
  2362. ELSE
  2363. cb_addzy.TriggerEvent(Clicked!)
  2364. END IF
  2365. end event
  2366. event rowfocuschanged;Long ll_getrow
  2367. ll_getrow = THIS.GetRow()
  2368. IF ll_getrow <= 0 THEN
  2369. st_mxdscrp.Text = ''
  2370. ELSE
  2371. THIS.SelectRow(0,FALSE)
  2372. THIS.SetRow(ll_getrow)
  2373. THIS.ScrollToRow (ll_getrow)
  2374. THIS.SelectRow(ll_getrow,TRUE)
  2375. THIS.AcceptText()
  2376. st_mxdscrp.Text = '分录:'+String(ll_getrow)+',搞要:'+THIS.Object.brief[ll_getrow]
  2377. dw_child_share.SetRow(ll_getrow)
  2378. dw_child_share.ScrollToRow (ll_getrow)
  2379. END IF
  2380. IF dw_edit_mode THEN
  2381. wf_rtr_balc()
  2382. IF sys_option_lbrief = 1 AND ll_getrow > 1 AND cur_editfoucs = 1 THEN
  2383. dw_child.Object.brief[ll_getrow] = dw_child.Object.brief[ll_getrow - 1 ]
  2384. END IF
  2385. END IF
  2386. end event
  2387. event itemchanged;
  2388. IF NOT dw_edit_mode THEN RETURN
  2389. String ls_subid
  2390. Long ll_moneyid
  2391. Int li_hswb,li_hsqty,li_hsdept,li_hsemp,li_hsitem,li_dcflag,li_hscust,li_hsspt
  2392. dw_child.AcceptText()
  2393. IF row <= 0 THEN RETURN
  2394. IF dwo.Name = 'subid' THEN
  2395. ls_subid = dw_child.Object.subid[row]
  2396. SELECT moneyid,hswb,hsqty,hsdept,hsemp,hsitem,dcflag,hscust,hsspt
  2397. INTO :ll_moneyid,:li_hswb,:li_hsqty,:li_hsdept,:li_hsemp,
  2398. :li_hsitem,:li_dcflag,:li_hscust,:li_hsspt
  2399. FROM cw_subject
  2400. WHERE accsetid = :sys_accsetid
  2401. AND subid = :ls_subid;
  2402. IF sqlca.SQLCode <> 0 THEN RETURN
  2403. wf_reshare_subid()
  2404. dw_child.Object.cw_subject_moneyid[row] = ll_moneyid
  2405. dw_child.Object.cw_subject_hswb[row] = li_hswb
  2406. dw_child.Object.cw_subject_hsqty[row] = li_hsqty
  2407. dw_child.Object.cw_subject_hsdept[row] = li_hsdept
  2408. dw_child.Object.cw_subject_hsemp[row] = li_hsemp
  2409. dw_child.Object.cw_subject_hsitem[row] = li_hsitem
  2410. dw_child.Object.cw_subject_hscust[row] = li_hscust
  2411. dw_child.Object.cw_subject_hsspt[row] = li_hsspt
  2412. dw_child.Object.cw_subject_dcflag[row] = li_dcflag
  2413. IF li_hswb <> 0 THEN
  2414. if_fcurrency = TRUE
  2415. wf_change_childdw_face()
  2416. IF li_hswb = 2 THEN
  2417. Long ll_moneyid_native
  2418. Decimal ld_rate
  2419. SELECT moneyid,rate INTO :ll_moneyid_native,:ld_rate
  2420. FROM cw_currency Where accsetid = :sys_accsetid AND native = 1;
  2421. IF sqlca.SQLCode <> 0 THEN
  2422. ll_moneyid_native = 0
  2423. ld_rate = 0
  2424. ELSE
  2425. dw_child.Object.cw_subject_moneyid[row] = ll_moneyid_native
  2426. dw_child.Object.rate[row] = ld_rate
  2427. END IF
  2428. END IF
  2429. END IF
  2430. END IF
  2431. //cw_subject_hsdept
  2432. //cw_subject_hsemp
  2433. //cw_subject_hsitem
  2434. //cw_subject_hsqty
  2435. //cw_subject_hswb
  2436. //cw_subject_moneyid
  2437. //cw_subject_specialcode
  2438. end event
  2439. type cb_money from uo_imflatbutton within w_credence_edit_popup
  2440. integer x = 1559
  2441. integer width = 151
  2442. integer height = 164
  2443. integer taborder = 170
  2444. boolean bringtotop = true
  2445. string text = "外币"
  2446. string normalpicname = "p2.BMP"
  2447. integer picsize = 16
  2448. toolbaralignment pic_align = alignattop!
  2449. boolean border = false
  2450. end type
  2451. event clicked;if_fcurrency = NOT if_fcurrency
  2452. wf_change_childdw_face()
  2453. end event
  2454. type dw_child_share from datawindow within w_credence_edit_popup
  2455. event key pbm_dwnkey
  2456. integer x = 46
  2457. integer y = 1428
  2458. integer width = 1774
  2459. integer height = 520
  2460. integer taborder = 60
  2461. boolean bringtotop = true
  2462. string dataobject = "dw_credencemx_index2_popup"
  2463. boolean border = false
  2464. boolean livescroll = true
  2465. end type
  2466. event key;PARENT.TriggerEvent('user_key')
  2467. IF Key = keyenter! THEN RETURN 1
  2468. end event
  2469. event itemchanged;if not dw_edit_mode then return
  2470. dec ls_amount,ls_price,ls_amt
  2471. long child_row,uc_row
  2472. dw_child_share.accepttext()
  2473. dw_child.accepttext()
  2474. child_row = dw_child_share.getrow()
  2475. uc_row = dw_child.getrow()
  2476. if child_row <= 0 then return
  2477. if uc_row <= 0 then return
  2478. ls_amt = dw_child.object.debit[uc_row] + dw_child.object.credit[uc_row]
  2479. if string(dwo.name) = 'cw_credencemx_amount' then
  2480. if dw_child_share.object.cw_subject_hsqty[child_row] > 0 or dw_child.object.cw_subject_hsqty[child_row] > 0 then
  2481. ls_amount = dw_child_share.object.cw_credencemx_amount[child_row]
  2482. if ls_amount > 0 then
  2483. ls_price = round(ls_amt/ls_amount,4)
  2484. end if
  2485. dw_child_share.object.cw_credencemx_price[child_row] = ls_price
  2486. end if
  2487. elseif string(dwo.name) = 'cw_credencemx_price' then
  2488. if dw_child_share.object.cw_subject_hsqty[child_row] > 0 or dw_child.object.cw_subject_hsqty[child_row] > 0 then
  2489. ls_amount = dw_child_share.object.cw_credencemx_amount[child_row]
  2490. if ls_amount > 0 then
  2491. ls_price = round(ls_amt/ls_amount,4)
  2492. end if
  2493. dw_child_share.object.cw_credencemx_price[child_row] = ls_price
  2494. end if
  2495. end if
  2496. //cw_credencemx_amount
  2497. end event
  2498. event buttonclicked;IF row <= 0 THEN RETURN
  2499. //IF dw_edit_mode THEN
  2500. // s_edit_index_tran s_ch_tran //传递参数使用
  2501. // s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  2502. // s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  2503. // s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  2504. // s_ch_tran.arg_string_code = ''//查询列(物料编码)部分内容,用于初步筛选
  2505. //
  2506. // IF dwo.Name = 'b_dept' THEN
  2507. // IF THIS.Object.cw_subject_hsdept[row] = 0 THEN
  2508. // MessageBox('提示','科目不是核算部门,不能选择部门')
  2509. // RETURN
  2510. // END IF
  2511. //
  2512. // IF NOT IsValid(w_department_ch) THEN
  2513. // OPEN(w_department_ch)
  2514. //
  2515. // Long ll_deptid
  2516. // ll_deptid = Message.DoubleParm
  2517. //
  2518. // IF ll_deptid > 0 THEN
  2519. // THIS.Object.cw_credencemx_deptid[row] = ll_deptid
  2520. // END IF
  2521. // END IF
  2522. // ELSEIF dwo.Name = 'b_item' THEN
  2523. //
  2524. // IF THIS.Object.cw_subject_hsitem[row] = 0 THEN
  2525. // MessageBox('提示','科目不是核算银行,不能选择银行')
  2526. // RETURN
  2527. // END IF
  2528. // IF NOT IsValid(w_hsaccount_ch) THEN
  2529. // OPEN(w_hsaccount_ch)
  2530. //
  2531. // s_accounts s_account
  2532. // s_account = Message.PowerObjectParm
  2533. //
  2534. // IF s_account.accountsid > 0 THEN
  2535. // THIS.Object.cw_credencemx_itemid[row] = s_account.accountsid
  2536. // END IF
  2537. // END IF
  2538. // ELSEIF dwo.Name = 'b_emp' THEN
  2539. //
  2540. // IF THIS.Object.cw_subject_hstrader[row] = 0 THEN
  2541. // MessageBox('提示','科目不是核算个人,不能选择个人')
  2542. // RETURN
  2543. // END IF
  2544. // IF NOT IsValid(w_empinfo_choice) THEN
  2545. // OPEN(w_empinfo_choice)
  2546. //
  2547. // s_empselect s_select
  2548. // s_select = Message.PowerObjectParm
  2549. //
  2550. // IF s_select.empid > 0 THEN
  2551. // THIS.Object.cw_credencemx_empid[row] = s_select.empid
  2552. // END IF
  2553. // END IF
  2554. // ELSEIF dwo.Name = 'b_cust' THEN
  2555. //
  2556. // IF THIS.Object.cw_subject_hscust[row] = 0 THEN
  2557. // MessageBox('提示','科目不是核算客户,不能选择客户')
  2558. // RETURN
  2559. // END IF
  2560. //
  2561. // IF NOT IsValid(W_cust_edit) THEN
  2562. // OpenWithParm(W_cust_edit,s_ch_tran) //调用
  2563. //
  2564. // s_custom S_INSCUST_cust
  2565. // S_INSCUST_cust = Message.PowerObjectParm //接受返回结构
  2566. //
  2567. // IF S_INSCUST_cust.cusid > 0 THEN //正常返回值则可以取以下值
  2568. // THIS.SetRedraw(FALSE)
  2569. // THIS.Object.cw_credencemx_cusid[row] = S_INSCUST_cust.cusid
  2570. // THIS.SetRedraw(TRUE)
  2571. // END IF
  2572. // END IF
  2573. // ELSEIF dwo.Name = 'b_spt' THEN
  2574. //
  2575. // IF THIS.Object.cw_subject_hsspt[row] = 0 THEN
  2576. // MessageBox('提示','科目不是核算供应商,不能选择供应商')
  2577. // RETURN
  2578. // END IF
  2579. //
  2580. // IF NOT IsValid(W_spt_edit) THEN
  2581. // OpenWithParm(W_spt_edit,s_ch_tran) //调用
  2582. //
  2583. // S_spt S_INSCUST_spt
  2584. // S_INSCUST_spt = Message.PowerObjectParm //接受返回结构
  2585. //
  2586. // IF S_INSCUST_spt.sptid > 0 THEN //正常返回值则可以取以下值
  2587. // THIS.SetRedraw(FALSE)
  2588. // THIS.Object.cw_credencemx_sptid[row] = S_INSCUST_spt.sptid
  2589. // THIS.SetRedraw(TRUE)
  2590. // END IF
  2591. // END IF
  2592. // END IF
  2593. //END IF
  2594. end event
  2595. type st_3 from statictext within w_credence_edit_popup
  2596. integer x = 2697
  2597. integer y = 196
  2598. integer width = 151
  2599. integer height = 52
  2600. boolean bringtotop = true
  2601. integer textsize = -9
  2602. integer weight = 400
  2603. fontcharset fontcharset = gb2312charset!
  2604. fontpitch fontpitch = variable!
  2605. string facename = "宋体"
  2606. long textcolor = 33554432
  2607. long backcolor = 67108864
  2608. boolean enabled = false
  2609. string text = "编号"
  2610. alignment alignment = right!
  2611. boolean focusrectangle = false
  2612. end type
  2613. type cb_cauditing from uo_imflatbutton within w_credence_edit_popup
  2614. integer x = 919
  2615. integer width = 151
  2616. integer height = 164
  2617. integer taborder = 230
  2618. boolean bringtotop = true
  2619. string text = "撤审"
  2620. string normalpicname = "caudit.bmp"
  2621. integer picsize = 16
  2622. toolbaralignment pic_align = alignattop!
  2623. boolean border = false
  2624. end type
  2625. event clicked;IF NOT f_power_ind(1974,sys_msg_pow) THEN
  2626. MessageBox(publ_operator,'你没有使用权限!')
  2627. RETURN
  2628. END IF
  2629. IF dw_edit_mode THEN RETURN
  2630. String arg_msg = ''
  2631. Long pagerert_row
  2632. Long ls_subaccsetid,ls_credid
  2633. pagerert_row = dw_uc.GetRow()
  2634. IF pagerert_row <= 0 THEN
  2635. MessageBox('系统提示','请选定当前目标凭证!')
  2636. RETURN
  2637. END IF
  2638. IF MessageBox ("IF","是否确定要"+THIS.Text+"当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  2639. ls_subaccsetid = dw_uc.Object.subaccsetid[pagerert_row]
  2640. ls_credid = dw_uc.Object.credid[pagerert_row]
  2641. IF uo_credence_ins.cancel_check_1(ls_subaccsetid,ls_credid,1,arg_msg,TRUE) = 0 THEN
  2642. MessageBox('Error!',arg_msg)
  2643. ELSE
  2644. MessageBox(publ_operator,'撤审成功!')
  2645. wf_refresh_curuc(ls_subaccsetid,ls_credid)
  2646. END IF
  2647. end event
  2648. type cb_print_1 from uo_imflatbutton within w_credence_edit_popup
  2649. integer x = 2478
  2650. integer width = 192
  2651. integer height = 164
  2652. integer taborder = 160
  2653. boolean bringtotop = true
  2654. string text = "打印&O"
  2655. string normalpicname = "print.bmp"
  2656. integer picsize = 16
  2657. toolbaralignment pic_align = alignattop!
  2658. boolean border = false
  2659. end type
  2660. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  2661. String menustr
  2662. menustr = "Text=本位币格式~tEvent=ue_print"
  2663. menustr = menustr + "|" + "Text=外币格式~tEvent=ue_print_wb"
  2664. menustr = menustr + "|" + "Text=-"
  2665. menustr = menustr + "|" + "Text=打印列表凭证~tEvent=ue_print_list"
  2666. IF Len(Trim(menustr)) <> 0 THEN
  2667. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  2668. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  2669. dmPopupMenu.mf_PopMenu()
  2670. DESTROY dmPopupMenu
  2671. END IF
  2672. end event
  2673. type ddlb_credtype from dropdownlistbox within w_credence_edit_popup
  2674. integer x = 2437
  2675. integer y = 180
  2676. integer width = 293
  2677. integer height = 512
  2678. integer taborder = 40
  2679. boolean bringtotop = true
  2680. integer textsize = -9
  2681. integer weight = 400
  2682. fontcharset fontcharset = gb2312charset!
  2683. fontpitch fontpitch = variable!
  2684. string facename = "宋体"
  2685. long textcolor = 33554432
  2686. boolean vscrollbar = true
  2687. borderstyle borderstyle = stylelowered!
  2688. end type
  2689. event constructor;String ls_credtype
  2690. DECLARE cur_credtype_1 CURSOR FOR
  2691. SELECT cw_Credenceword.Credenceword
  2692. FROM cw_Credenceword
  2693. Where accsetid = :sys_accsetid;
  2694. OPEN cur_credtype_1;
  2695. FETCH cur_credtype_1 INTO :ls_credtype;
  2696. DO WHILE sqlca.SQLCode = 0
  2697. THIS.AddItem(ls_credtype)
  2698. FETCH cur_credtype_1 INTO :ls_credtype;
  2699. LOOP
  2700. CLOSE cur_credtype_1;
  2701. THIS.AddItem('[全部]')
  2702. THIS.Text = '[全部]'
  2703. end event
  2704. event selectionchanged;cur_credtype = THIS.Text
  2705. IF THIS.Text = '[全部]' THEN cur_credtype = '-1'
  2706. PARENT.TriggerEvent("retrieve_pageretr")
  2707. end event
  2708. type st_dft_cmonth from statictext within w_credence_edit_popup
  2709. integer x = 5
  2710. integer y = 176
  2711. integer width = 654
  2712. integer height = 52
  2713. boolean bringtotop = true
  2714. integer textsize = -9
  2715. integer weight = 400
  2716. fontcharset fontcharset = gb2312charset!
  2717. fontpitch fontpitch = variable!
  2718. string facename = "宋体"
  2719. long textcolor = 33554432
  2720. long backcolor = 82700779
  2721. boolean enabled = false
  2722. string text = "默认凭证月份"
  2723. boolean focusrectangle = false
  2724. end type
  2725. type cbx_1 from checkbox within w_credence_edit_popup
  2726. integer x = 859
  2727. integer y = 196
  2728. integer width = 498
  2729. integer height = 52
  2730. boolean bringtotop = true
  2731. integer textsize = -9
  2732. integer weight = 400
  2733. fontcharset fontcharset = gb2312charset!
  2734. fontpitch fontpitch = variable!
  2735. string facename = "宋体"
  2736. long textcolor = 33554432
  2737. long backcolor = 134217739
  2738. string text = "选会计科目定义"
  2739. boolean checked = true
  2740. end type
  2741. event clicked;Int li_ifdy
  2742. IF THIS.Checked THEN
  2743. li_ifdy = 1
  2744. ELSE
  2745. li_ifdy = 0
  2746. END IF
  2747. SetProfileString (sys_inifilename,dw_pageretr.DataObject, "ifdy", String(li_ifdy))
  2748. end event
  2749. event constructor;Int li_ifdy
  2750. li_ifdy = Integer(ProfileString (sys_inifilename,dw_pageretr.DataObject, "ifdy", '1'))
  2751. IF li_ifdy = 0 THEN
  2752. THIS.Checked = FALSE
  2753. ELSE
  2754. THIS.Checked = TRUE
  2755. END IF
  2756. end event
  2757. type ddlb_status from dropdownlistbox within w_credence_edit_popup
  2758. integer x = 1499
  2759. integer y = 180
  2760. integer width = 320
  2761. integer height = 452
  2762. integer taborder = 120
  2763. integer textsize = -9
  2764. integer weight = 400
  2765. fontcharset fontcharset = gb2312charset!
  2766. fontpitch fontpitch = variable!
  2767. string facename = "宋体"
  2768. long textcolor = 33554432
  2769. string text = "[全部]"
  2770. boolean sorted = false
  2771. boolean vscrollbar = true
  2772. string item[] = {"[全部]","待审核","待过帐","过帐完毕"}
  2773. borderstyle borderstyle = stylelowered!
  2774. end type
  2775. event selectionchanged;if index=1 then
  2776. cur_checkflag=-1
  2777. cur_postflag= -1
  2778. elseif index=2 then
  2779. cur_checkflag= 0
  2780. cur_postflag= 0
  2781. elseif index=3 then
  2782. cur_checkflag= 1
  2783. cur_postflag= 0
  2784. elseif index=4 then
  2785. cur_checkflag= 1
  2786. cur_postflag= 1
  2787. end if
  2788. parent.triggerevent("retrieve_pageretr")
  2789. end event
  2790. type st_2 from statictext within w_credence_edit_popup
  2791. integer x = 1344
  2792. integer y = 196
  2793. integer width = 151
  2794. integer height = 52
  2795. integer textsize = -9
  2796. integer weight = 400
  2797. fontcharset fontcharset = gb2312charset!
  2798. fontpitch fontpitch = variable!
  2799. string facename = "宋体"
  2800. long textcolor = 33554432
  2801. long backcolor = 67108864
  2802. boolean enabled = false
  2803. string text = "状态"
  2804. alignment alignment = right!
  2805. boolean focusrectangle = false
  2806. end type
  2807. type st_4 from statictext within w_credence_edit_popup
  2808. integer x = 2231
  2809. integer y = 196
  2810. integer width = 210
  2811. integer height = 52
  2812. integer textsize = -9
  2813. integer weight = 400
  2814. fontcharset fontcharset = gb2312charset!
  2815. fontpitch fontpitch = variable!
  2816. string facename = "宋体"
  2817. long textcolor = 33554432
  2818. long backcolor = 67108864
  2819. boolean enabled = false
  2820. string text = "凭证字:"
  2821. alignment alignment = right!
  2822. boolean focusrectangle = false
  2823. end type
  2824. type cb_other from uo_imflatbutton within w_credence_edit_popup
  2825. integer x = 1710
  2826. integer width = 274
  2827. integer height = 164
  2828. integer taborder = 180
  2829. boolean bringtotop = true
  2830. string text = "其它功能"
  2831. string normalpicname = "other.BMP"
  2832. integer picsize = 16
  2833. toolbaralignment pic_align = alignattop!
  2834. boolean border = false
  2835. end type
  2836. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  2837. string menustr
  2838. menustr="Text=找平~tEvent=ue_balance"
  2839. menustr=menustr + "|" + "Text=-"
  2840. menustr=menustr + "|" + "Text=计税~tEvent=ue_cmpl_tax"
  2841. menustr=menustr + "|" + "Text=-"
  2842. menustr=menustr + "|" + "Text=计算器~tEvent=ue_computer"
  2843. menustr=menustr + "|" + "Text=-"
  2844. menustr=menustr + "|" + "Text=现金流量分配~tEvent=ue_cash"
  2845. menustr=menustr + "|" + "Text=-"
  2846. menustr=menustr + "|" + "Text=调入模式凭证~tEvent=ue_cred_mode"
  2847. menustr=menustr + "|" + "Text=将凭证另存为模式凭证~tEvent=ue_cred_savetomode"
  2848. menustr=menustr + "|" + "Text=-"
  2849. menustr=menustr + "|" + "Text=查看相关单据~tEvent=ue_bill_find"
  2850. if len(trim(menustr))<>0 then
  2851. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  2852. dmPopupMenu.mf_BuildMenu(This, menustr)
  2853. dmPopupMenu.mf_PopMenu()
  2854. Destroy dmPopupMenu
  2855. end if
  2856. end event
  2857. type em_cmonth from editmask within w_credence_edit_popup
  2858. integer x = 1961
  2859. integer y = 180
  2860. integer width = 279
  2861. integer height = 84
  2862. integer taborder = 140
  2863. boolean bringtotop = true
  2864. integer textsize = -9
  2865. integer weight = 400
  2866. fontcharset fontcharset = gb2312charset!
  2867. fontpitch fontpitch = variable!
  2868. string facename = "宋体"
  2869. long textcolor = 33554432
  2870. borderstyle borderstyle = stylelowered!
  2871. string mask = "000000"
  2872. boolean autoskip = true
  2873. boolean spin = true
  2874. double increment = 1
  2875. end type
  2876. event modified;i_cmonth = Long(THIS.Text)
  2877. PARENT.TriggerEvent("retrieve_pageretr")
  2878. end event
  2879. type mle_msg from statictext within w_credence_edit_popup
  2880. integer x = 2999
  2881. integer y = 176
  2882. integer width = 549
  2883. integer height = 1964
  2884. integer textsize = -9
  2885. integer weight = 400
  2886. fontcharset fontcharset = gb2312charset!
  2887. fontpitch fontpitch = variable!
  2888. string facename = "宋体"
  2889. long textcolor = 33554432
  2890. long backcolor = 16777215
  2891. boolean enabled = false
  2892. boolean border = true
  2893. borderstyle borderstyle = styleraised!
  2894. boolean focusrectangle = false
  2895. end type
  2896. type dw_uc from datawindow within w_credence_edit_popup
  2897. event dwnkey pbm_dwnkey
  2898. integer y = 372
  2899. integer width = 2990
  2900. integer height = 1772
  2901. integer taborder = 110
  2902. string dataobject = "dw_credence_edit_popup"
  2903. boolean border = false
  2904. boolean livescroll = true
  2905. end type
  2906. event dwnkey;parent.triggerevent('user_key')
  2907. if key = KeyDownArrow! then return 1
  2908. if dw_edit_mode then
  2909. if dw_uc.GetColumnName ( )='billnumber' and key = KeyEnter! then
  2910. dw_child.setfocus()
  2911. dw_child.scrolltorow(1)
  2912. dw_child.SetColumn ('brief')
  2913. return 1
  2914. else
  2915. if key = KeyEnter! Then //
  2916. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2917. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2918. Return 1
  2919. end If
  2920. end if
  2921. end if
  2922. end event
  2923. event rowfocuschanged;
  2924. IF not dw_edit_mode then
  2925. if currentrow >0 THEN
  2926. dw_pageretr.SETROW(currentrow)
  2927. dw_pageretr.ScrollToRow(currentrow)
  2928. dw_pageretr.selectrow(0,false)
  2929. dw_pageretr.selectrow(currentrow,true)
  2930. end if
  2931. // parent.triggerevent('retrieve_childdw')
  2932. end if
  2933. //if currentrow>0 and not dw_edit_mode then
  2934. // if dw_uc.object.flag[currentrow]=1 then
  2935. // cb_auditing.enabled=false
  2936. // cb_delet.enabled=false
  2937. // cb_edit.enabled=false
  2938. // cb_addzy.enabled=true
  2939. // else
  2940. // cb_auditing.enabled=true
  2941. // cb_delet.enabled=true
  2942. // cb_edit.enabled=true
  2943. // cb_addzy.enabled=false
  2944. // end if
  2945. //else
  2946. // cb_auditing.enabled=false
  2947. // cb_delet.enabled=false
  2948. // cb_edit.enabled=false
  2949. // cb_addzy.enabled=false
  2950. //end if
  2951. end event
  2952. event rowfocuschanging;if dw_edit_mode then return 1
  2953. end event
  2954. event itemchanged;if not dw_edit_mode then return
  2955. if row <= 0 then return
  2956. if dwo.name <> 'credtype' then return
  2957. dw_uc.accepttext()
  2958. dw_uc.setredraw(false)
  2959. string ls_credtype,arg_msg
  2960. long ls_yearmon
  2961. ls_yearmon = il_dft_cmonth
  2962. ls_credtype = dw_uc.object.credtype[row]
  2963. if sys_option_credno_save = 0 then
  2964. dw_uc.object.credno[row] = uo_credence_ins.get_new_credno(0,ls_credtype,ls_yearmon,arg_msg)
  2965. if trim(arg_msg)<>'' then messagebox('提示',arg_msg)
  2966. end if
  2967. dw_uc.setcolumn("creddate")
  2968. dw_uc.setredraw(true)
  2969. end event
  2970. type cb_auto_create from uo_imflatbutton within w_credence_edit_popup
  2971. boolean visible = false
  2972. integer x = 3049
  2973. integer y = 456
  2974. integer width = 229
  2975. integer height = 104
  2976. integer taborder = 310
  2977. boolean bringtotop = true
  2978. string text = "自动建"
  2979. end type
  2980. event clicked;cb_add.triggerevent(clicked!)
  2981. end event
  2982. type ln_5 from line within w_credence_edit_popup
  2983. long linecolor = 33554432
  2984. integer linethickness = 4
  2985. integer beginy = 360
  2986. integer endx = 1001
  2987. integer endy = 360
  2988. end type
  2989. type ln_6 from line within w_credence_edit_popup
  2990. long linecolor = 16777215
  2991. integer linethickness = 4
  2992. integer beginy = 364
  2993. integer endx = 1001
  2994. integer endy = 364
  2995. end type
  2996. type st_mxdscrp from statictext within w_credence_edit_popup
  2997. integer x = 14
  2998. integer y = 292
  2999. integer width = 2962
  3000. integer height = 52
  3001. boolean bringtotop = true
  3002. integer textsize = -9
  3003. integer weight = 400
  3004. fontcharset fontcharset = gb2312charset!
  3005. fontpitch fontpitch = variable!
  3006. string facename = "宋体"
  3007. long textcolor = 33554432
  3008. long backcolor = 67108864
  3009. boolean enabled = false
  3010. boolean focusrectangle = false
  3011. end type
  3012. type cb_dft from commandbutton within w_credence_edit_popup
  3013. integer x = 695
  3014. integer y = 180
  3015. integer width = 146
  3016. integer height = 84
  3017. integer taborder = 270
  3018. boolean bringtotop = true
  3019. integer textsize = -9
  3020. integer weight = 400
  3021. fontcharset fontcharset = gb2312charset!
  3022. fontpitch fontpitch = variable!
  3023. string facename = "宋体"
  3024. string text = "设置"
  3025. end type
  3026. event clicked;s_edit_index_tran s_rst
  3027. OPEN(w_credence_edit_popup_dft)
  3028. s_rst = Message.PowerObjectParm
  3029. IF s_rst.d_long = 0 THEN RETURN
  3030. il_dft_cmonth = s_rst.b_long
  3031. ii_if_dft_reldate = s_rst.c_long
  3032. idt_dft_reldate = s_rst.b_datetime
  3033. wf_text()
  3034. end event
  3035. type st_dft_reldate from statictext within w_credence_edit_popup
  3036. integer x = 5
  3037. integer y = 224
  3038. integer width = 654
  3039. integer height = 48
  3040. boolean bringtotop = true
  3041. integer textsize = -9
  3042. integer weight = 400
  3043. fontcharset fontcharset = gb2312charset!
  3044. fontpitch fontpitch = variable!
  3045. string facename = "宋体"
  3046. long textcolor = 33554432
  3047. long backcolor = 82700779
  3048. string text = "默认相关日期"
  3049. boolean focusrectangle = false
  3050. end type
  3051. type ln_1 from line within w_credence_edit_popup
  3052. long linecolor = 33554432
  3053. integer linethickness = 4
  3054. integer beginy = 168
  3055. integer endx = 1001
  3056. integer endy = 168
  3057. end type
  3058. type ln_2 from line within w_credence_edit_popup
  3059. long linecolor = 16777215
  3060. integer linethickness = 4
  3061. integer beginy = 172
  3062. integer endx = 1001
  3063. integer endy = 172
  3064. end type
  3065. type ln_3 from line within w_credence_edit_popup
  3066. long linecolor = 33554432
  3067. integer linethickness = 4
  3068. integer beginy = 280
  3069. integer endx = 1001
  3070. integer endy = 280
  3071. end type
  3072. type ln_4 from line within w_credence_edit_popup
  3073. long linecolor = 16777215
  3074. integer linethickness = 4
  3075. integer beginy = 284
  3076. integer endx = 1001
  3077. integer endy = 284
  3078. end type
  3079. type r_bar from rectangle within w_credence_edit_popup
  3080. long linecolor = 16777215
  3081. long fillcolor = 1073741824
  3082. integer x = 3497
  3083. integer width = 73
  3084. integer height = 172
  3085. end type
  3086. event constructor;this.fillcolor = 14215660
  3087. this.linecolor = 14215660
  3088. this.x = -1
  3089. this.y = -1
  3090. this.height = ln_1.beginy - 5
  3091. end event