w_mustpay.srw 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367
  1. $PBExportHeader$w_mustpay.srw
  2. forward
  3. global type w_mustpay from w_publ_pageretr
  4. end type
  5. type dw_mstpay from u_dw_rbtnfilter within w_mustpay
  6. end type
  7. type cbx_ifshowall from checkbox within w_mustpay
  8. end type
  9. type st_3 from statictext within w_mustpay
  10. end type
  11. type em_firstday from editmask within w_mustpay
  12. end type
  13. type st_4 from statictext within w_mustpay
  14. end type
  15. type em_endday from editmask within w_mustpay
  16. end type
  17. type cb_retrieve from uo_imflatbutton within w_mustpay
  18. end type
  19. type cb_2 from uo_imflatbutton within w_mustpay
  20. end type
  21. type cb_3 from uo_imflatbutton within w_mustpay
  22. end type
  23. type dw_mstpaymx from u_dw_rbtnfilter within w_mustpay
  24. end type
  25. type ddlb_1 from uo_ddlb_scid within w_mustpay
  26. end type
  27. type cb_autofinish from uo_imflatbutton within w_mustpay
  28. end type
  29. type cb_4 from uo_imflatbutton within w_mustpay
  30. end type
  31. type ddlb_2 from dropdownlistbox within w_mustpay
  32. end type
  33. type cb_reset from uo_imflatbutton within w_mustpay
  34. end type
  35. type st_6 from statictext within w_mustpay
  36. end type
  37. type ddlb_3 from dropdownlistbox within w_mustpay
  38. end type
  39. type st_2 from statictext within w_mustpay
  40. end type
  41. type st_5 from statictext within w_mustpay
  42. end type
  43. type cb_1 from uo_imflatbutton within w_mustpay
  44. end type
  45. type cbx_all from checkbox within w_mustpay
  46. end type
  47. type pb_em1 from picturebutton within w_mustpay
  48. end type
  49. type pb_em2 from picturebutton within w_mustpay
  50. end type
  51. type pb_2 from picturebutton within w_mustpay
  52. end type
  53. type cb_pay from uo_imflatbutton within w_mustpay
  54. end type
  55. type st_payamt from statictext within w_mustpay
  56. end type
  57. type st_mstpayamt from statictext within w_mustpay
  58. end type
  59. type st_balcamt from statictext within w_mustpay
  60. end type
  61. type ln_bar from line within w_mustpay
  62. end type
  63. type ln_bar2 from line within w_mustpay
  64. end type
  65. type r_bar from rectangle within w_mustpay
  66. end type
  67. type ln_1 from line within w_mustpay
  68. end type
  69. type ln_2 from line within w_mustpay
  70. end type
  71. type ln_5 from line within w_mustpay
  72. end type
  73. type ln_6 from line within w_mustpay
  74. end type
  75. type ln_3 from line within w_mustpay
  76. end type
  77. type ln_4 from line within w_mustpay
  78. end type
  79. type st_amtdisp from statictext within w_mustpay
  80. end type
  81. type cbx_1 from checkbox within w_mustpay
  82. end type
  83. end forward
  84. global type w_mustpay from w_publ_pageretr
  85. integer width = 3602
  86. integer height = 2300
  87. string title = "应付帐"
  88. boolean maxbox = true
  89. windowstate windowstate = maximized!
  90. event retrieve_pay ( )
  91. event retrieve_paymx ( )
  92. event ue_add ( )
  93. event ue_del ( )
  94. event ue_view_bill ( )
  95. event ue_pay ( )
  96. event ue_buybill_auto ( )
  97. event ue_dwchild_filter ( )
  98. event ue_rbbutton ( )
  99. event ue_create_buybill ( )
  100. event ue_create_sptamt ( )
  101. event ue_create_reissue_spt ( )
  102. event ue_buybill_auto_p ( )
  103. event ue_date1 ( )
  104. event ue_date2 ( )
  105. event ue_date3 ( )
  106. event ue_date4 ( )
  107. dw_mstpay dw_mstpay
  108. cbx_ifshowall cbx_ifshowall
  109. st_3 st_3
  110. em_firstday em_firstday
  111. st_4 st_4
  112. em_endday em_endday
  113. cb_retrieve cb_retrieve
  114. cb_2 cb_2
  115. cb_3 cb_3
  116. dw_mstpaymx dw_mstpaymx
  117. ddlb_1 ddlb_1
  118. cb_autofinish cb_autofinish
  119. cb_4 cb_4
  120. ddlb_2 ddlb_2
  121. cb_reset cb_reset
  122. st_6 st_6
  123. ddlb_3 ddlb_3
  124. st_2 st_2
  125. st_5 st_5
  126. cb_1 cb_1
  127. cbx_all cbx_all
  128. pb_em1 pb_em1
  129. pb_em2 pb_em2
  130. pb_2 pb_2
  131. cb_pay cb_pay
  132. st_payamt st_payamt
  133. st_mstpayamt st_mstpayamt
  134. st_balcamt st_balcamt
  135. ln_bar ln_bar
  136. ln_bar2 ln_bar2
  137. r_bar r_bar
  138. ln_1 ln_1
  139. ln_2 ln_2
  140. ln_5 ln_5
  141. ln_6 ln_6
  142. ln_3 ln_3
  143. ln_4 ln_4
  144. st_amtdisp st_amtdisp
  145. cbx_1 cbx_1
  146. end type
  147. global w_mustpay w_mustpay
  148. type variables
  149. uo_mustpay uo_pay
  150. long cur_id,cur_payid
  151. long cur_scid = 0
  152. long cur_scid_arr[]
  153. long ins_moneyid = -1
  154. Int finishflag = -1
  155. long cur_moneyid=0
  156. dec ins_mstpayamt=0
  157. dec ins_payamt=0
  158. end variables
  159. forward prototypes
  160. public subroutine wf_refresh_balc ()
  161. public function integer days_in_month (integer month, integer year)
  162. public function integer wf_dispamt ()
  163. public subroutine wf_initdisp ()
  164. end prototypes
  165. event retrieve_pay();long row,uc_relid=0,uc_scid,uc_moneyid
  166. string ls_cusname
  167. datetime firstdate,enddate
  168. row=dw_pageretr.getrow()
  169. if row>0 then
  170. uc_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[row]
  171. IF sys_option_scid_msttake_mstpay = 1 THEN
  172. uc_scid = dw_pageretr.Object.v_spt_balcamt_scid[row]
  173. ELSE
  174. uc_scid = cur_scid
  175. END IF
  176. uc_relid=dw_pageretr.object.sptid[row]
  177. ls_cusname=dw_pageretr.object.name[row]
  178. dw_mstpay.title=ls_cusname+'-应付帐'
  179. dw_mstpaymx.title=ls_cusname+'-应付帐明细'
  180. firstdate=datetime(date(em_firstday.text),time('00:00:00'))
  181. enddate=DATETIME(date(em_endday.TEXT),TIME('23:59:59'))
  182. dw_mstpay.SetRedraw (false)
  183. dw_mstpay.retrieve(uc_scid,uc_relid,firstdate,enddate,finishflag,uc_moneyid)
  184. if dw_mstpay.rowcount()>0 then
  185. dw_mstpay.selectrow(0,false)
  186. dw_mstpay.scrolltorow(1)
  187. dw_mstpay.selectrow(1,true)
  188. end if
  189. dw_mstpay.SetRedraw (true)
  190. else
  191. dw_mstpay.reset()
  192. end if
  193. cur_id=uc_relid
  194. cur_moneyid = uc_moneyid
  195. end event
  196. event retrieve_paymx();long row,uc_relid=0
  197. row=dw_mstpay.getrow()
  198. if row>0 then
  199. uc_relid=dw_mstpay.object.payid[row]
  200. dw_mstpaymx.SetRedraw (false)
  201. dw_mstpaymx.retrieve(uc_relid)
  202. dw_mstpaymx.SetRedraw (true)
  203. else
  204. dw_mstpaymx.reset()
  205. end if
  206. cur_payid=uc_relid
  207. end event
  208. event ue_add();IF NOT f_power_ind(134) THEN
  209. MessageBox('提示','你没有使用权限!',information!,ok!)
  210. RETURN
  211. END IF
  212. IF cur_id <= 0 THEN
  213. MessageBox('提示','请选择供应商',information!,ok!)
  214. RETURN
  215. END IF
  216. IF cur_scid < 0 THEN
  217. MessageBox('提示','请选择分部',information!,ok!)
  218. RETURN
  219. END IF
  220. s_edit_index_tran s_open_tran
  221. s_open_tran.b_long = cur_id
  222. s_open_tran.b_string = ''
  223. s_open_tran.b_decimal = 0
  224. s_open_tran.c_long = cur_scid
  225. s_open_tran.d_long = cur_moneyid
  226. OpenWithParm(w_mustpay_mod,s_open_tran)
  227. wf_refresh_balc()
  228. THIS.TriggerEvent('retrieve_pay')
  229. end event
  230. event ue_del();IF NOT f_power_ind(134) THEN
  231. MessageBox('提示','你没有使用权限!',information!,ok!)
  232. RETURN
  233. END IF
  234. Long payid,lirow
  235. String arg_msg
  236. lirow = dw_mstpay.GetRow()
  237. IF lirow = 0 THEN
  238. MessageBox('提示','请选定要删除的应付帐',information!,ok!)
  239. RETURN
  240. END IF
  241. IF MessageBox ("询问","是否确定要删除当前应付帐记录?",Question!,YesNo! ) = 2 THEN
  242. RETURN
  243. END IF
  244. //IF dw_mstpay.Object.finishflag[lirow] = 1 THEN
  245. // MessageBox('提示','选定的应付帐已结清,不能删除',information!,ok!)
  246. // RETURN
  247. //END IF
  248. payid = dw_mstpay.Object.payid[lirow]
  249. IF uo_pay.del_payrec (cur_scid,0,payid, cur_id, arg_msg,TRUE) = 0 THEN
  250. MessageBox("错误",arg_msg,stopsign!,ok!)
  251. RETURN
  252. END IF
  253. //日志
  254. Long ls_id,ls_curid
  255. String ls_code,ls_opemp
  256. ls_id = payid
  257. ls_curid = cur_id
  258. ls_code = dw_mstpay.Object.billcode[lirow]
  259. ls_opemp = dw_mstpay.Object.opemp[lirow]
  260. f_setsysoplog('应付帐','应付帐删除,ID:'+String(ls_id)+',客户ID:'+String(ls_curid)+',code:'+ls_code+',建立人:'+ls_opemp,arg_msg,TRUE)
  261. //--
  262. dw_mstpay.DeleteRow(lirow)
  263. dw_mstpay.TriggerEvent(RowFocusChanged!)
  264. wf_refresh_balc()
  265. THIS.TriggerEvent('retrieve_pay')
  266. MessageBox('提示','删除应付帐操作成功!',information!,ok!)
  267. end event
  268. event ue_view_bill();Long row
  269. row = dw_mstpay.GetRow()
  270. IF row <= 0 THEN RETURN
  271. IF row > 0 THEN
  272. String ls_code
  273. Long ll_scid
  274. Int li_buildtype
  275. Decimal ld_mstamt
  276. ll_scid = dw_mstpay.Object.scid[row]
  277. ls_code = dw_mstpay.Object.billcode[row]
  278. ld_mstamt = dw_mstpay.Object.mstpayamt[row]
  279. li_buildtype = dw_mstpay.Object.buildtype[row]
  280. IF li_buildtype = 0 THEN RETURN
  281. f_open_win(ll_scid,ls_code)
  282. // IF ld_mstamt < 0 THEN
  283. // IF Pos(ls_code,'CT') > 0 THEN
  284. // f_open_win('w_inware_buy_th',ll_scid,ls_code)
  285. // ELSEIF Pos(ls_code,'ST') > 0 THEN
  286. // f_open_win('w_inware_wfjg_th',ll_scid,ls_code)
  287. // ELSEIF Pos(ls_code,'SI') > 0 THEN
  288. // f_open_win('w_wfjg_in_th',ll_scid,ls_code)
  289. // ELSEIF Pos(ls_code,'FK') > 0 THEN
  290. // f_open_win('w_sptamt_edit',ll_scid,ls_code)
  291. // END IF
  292. // ELSE
  293. // IF Pos(ls_code,'CG') > 0 THEN
  294. // f_open_win('w_inware_buy',ll_scid,ls_code)
  295. // ELSEIF Pos(ls_code,'WT') > 0 THEN
  296. // f_open_win('w_inware_wfjg',ll_scid,ls_code)
  297. // ELSEIF Pos(ls_code,'WI') > 0 THEN
  298. // f_open_win('w_wfjg_in',ll_scid,ls_code)
  299. // ELSEIF Pos(ls_code,'FK') > 0 THEN
  300. // f_open_win('w_sptamt_edit',ll_scid,ls_code)
  301. // END IF
  302. // END IF
  303. END IF
  304. end event
  305. event ue_pay();if not f_power_ind(134) then
  306. messagebox('提示','你没有使用权限!',information!,ok!)
  307. return
  308. end if
  309. if cur_id <= 0 then
  310. messagebox('提示','请选择供应商',information!,ok!)
  311. return
  312. end if
  313. long ll_row
  314. ll_row = dw_mstpay.getrow()
  315. if ll_row <= 0 then
  316. messagebox('提示','请选择付款单据',information!,ok!)
  317. return
  318. end if
  319. s_edit_index_tran s_open_tran
  320. s_open_tran.b_long = cur_id
  321. s_open_tran.c_long = cur_scid
  322. s_open_tran.b_string = dw_mstpay.object.billcode[ll_row]
  323. s_open_tran.b_decimal = dw_mstpay.object.balcamt[ll_row]
  324. s_open_tran.d_long=cur_moneyid
  325. openwithparm(w_mustpay_mod,s_open_tran)
  326. wf_refresh_balc()
  327. this.triggerevent('retrieve_pay')
  328. end event
  329. event ue_buybill_auto();Long ll_rowcount
  330. Long ll_banktypeid
  331. DateTime ld_mxpaydate
  332. Int j
  333. ld_mxpaydate = DateTime(Today(),Time(0))
  334. dw_mstpay.AcceptText()
  335. ll_rowcount = dw_mstpay.RowCount()
  336. IF ll_rowcount <= 0 THEN RETURN
  337. datastore ds_mstpaymx
  338. ds_mstpaymx = CREATE datastore
  339. ds_mstpaymx.DataObject = "dw_buybillmx_index"
  340. ds_mstpaymx.SetTransObject(sqlca)
  341. ds_mstpaymx.Retrieve(0.1)
  342. IF ds_mstpaymx.RowCount() > 0 THEN
  343. FOR j = 1 TO ds_mstpaymx.RowCount()
  344. ds_mstpaymx.DeleteRow(j)
  345. NEXT
  346. END IF
  347. ds_mstpaymx.AcceptText()
  348. Int i
  349. Long ll_row
  350. Long ll_payamtcount = 0
  351. FOR i = 1 TO ll_rowcount
  352. IF dw_mstpay.Object.checkdata[i] = 0 THEN
  353. CONTINUE
  354. END IF
  355. IF dw_mstpay.Object.balcamt[i] < 0 and (dw_mstpay.Object.payamt[i]>0 or dw_mstpay.Object.mstpayamt[i]<0 ) THEN
  356. ll_payamtcount++
  357. ld_mxpaydate = dw_mstpay.Object.paydate[i]
  358. ll_banktypeid = dw_mstpay.Object.banktypeid[i]
  359. END IF
  360. // IF ll_payamtcount > 1 THEN
  361. // MessageBox('提示','预付款或已付款限制对数只能有一条',information!,ok!)
  362. // RETURN
  363. // END IF
  364. ll_row = ds_mstpaymx.InsertRow(0)
  365. ds_mstpaymx.Object.billcode[ll_row] = dw_mstpay.Object.billcode[i]
  366. ds_mstpaymx.Object.paydate[ll_row] = dw_mstpay.Object.paydate[i]
  367. ds_mstpaymx.Object.oriamt[ll_row] = dw_mstpay.Object.oriamt[i]
  368. ds_mstpaymx.Object.mainmstpayamt[ll_row] = dw_mstpay.Object.mstpayamt[i]
  369. ds_mstpaymx.Object.mainpayamt[ll_row] = dw_mstpay.Object.payamt[i]
  370. ds_mstpaymx.Object.payid[ll_row] = dw_mstpay.Object.payid[i]
  371. NEXT
  372. ds_mstpaymx.AcceptText()
  373. //生成相关号
  374. long ll_pay_i
  375. string ls_pay_i_billcode,ls_not_pay_i_billcode
  376. FOR i = 1 TO ds_mstpaymx.RowCount()
  377. if ds_mstpaymx.Object.mainmstpayamt[i] = 0 and ds_mstpaymx.Object.mainpayamt[i]<>0 then
  378. ll_pay_i = i
  379. ls_pay_i_billcode = ds_mstpaymx.Object.billcode[i]
  380. else
  381. ls_not_pay_i_billcode = ls_not_pay_i_billcode + trim(ds_mstpaymx.Object.billcode[i])+','
  382. end if
  383. next
  384. ls_not_pay_i_billcode = left(ls_not_pay_i_billcode,len(ls_not_pay_i_billcode) - 1 )
  385. ls_not_pay_i_billcode = Left(ls_not_pay_i_billcode, 255)
  386. FOR i = 1 TO ds_mstpaymx.RowCount()
  387. if i = ll_pay_i then
  388. ds_mstpaymx.object.relbillcode[i] = ls_not_pay_i_billcode
  389. else
  390. ds_mstpaymx.object.relbillcode[i] = ls_pay_i_billcode
  391. end if
  392. next
  393. //
  394. Decimal mstpayamt = 0,payamt = 0
  395. //第一次循环,分配应付,计算总可分配
  396. FOR i = 1 TO ds_mstpaymx.RowCount()
  397. IF mstpayamt > 0 THEN
  398. IF ds_mstpaymx.Object.mainmstpayamt[i] <= mstpayamt THEN
  399. ds_mstpaymx.Object.mstpayamt[i] = ds_mstpaymx.Object.mainmstpayamt[i]
  400. mstpayamt = mstpayamt - ds_mstpaymx.Object.mainmstpayamt[i]
  401. ELSE
  402. ds_mstpaymx.Object.mstpayamt[i] = mstpayamt
  403. mstpayamt = 0
  404. END IF
  405. END IF
  406. payamt = payamt - (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  407. ds_mstpaymx.Object.payamt[i] = (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  408. NEXT
  409. ds_mstpaymx.AcceptText()
  410. //第二次循环:根据可分配判断正负,修正相关结余(正-负、负-正)
  411. IF payamt < 0 THEN //不够分配
  412. FOR i = ds_mstpaymx.RowCount() TO 1 STEP - 1
  413. IF (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i]) <= 0 THEN CONTINUE
  414. IF ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i] + payamt < 0 THEN
  415. ds_mstpaymx.Object.payamt[i] = 0
  416. payamt = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  417. ELSE
  418. ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  419. payamt = 0
  420. END IF
  421. NEXT
  422. ELSE // 分配有剩
  423. FOR i = ds_mstpaymx.RowCount() TO 1 STEP - 1
  424. IF (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i]) >= 0 THEN CONTINUE //or ds_mstpaymx.Object.payamt[i]=0
  425. IF ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i] + payamt > 0 THEN
  426. ds_mstpaymx.Object.payamt[i] = 0
  427. payamt = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  428. //ds_mstpaymx.Object.payamt[i] =payamt
  429. ELSE
  430. ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
  431. payamt = 0
  432. END IF
  433. NEXT
  434. END IF
  435. ds_mstpaymx.AcceptText()
  436. uo_buybill uo_bill
  437. uo_bill = CREATE uo_buybill
  438. String arg_msg = ''
  439. IF uo_bill.newbegin() = 0 THEN
  440. MessageBox('错误',arg_msg,stopsign!,ok!)
  441. RETURN
  442. END IF
  443. uo_bill.opemp = publ_operator
  444. uo_bill.paydate = ld_mxpaydate
  445. uo_bill.relcode = ''
  446. uo_bill.inrep = publ_operator
  447. uo_bill.banktypeid = ll_banktypeid
  448. uo_bill.dscrp = ''
  449. uo_bill.sptid = cur_id
  450. uo_bill.mstpayamt = 0
  451. uo_bill.payamt = 0
  452. uo_bill.accountsid = 0
  453. uo_bill.itemid = 0
  454. uo_bill.buildtype=1
  455. uo_bill.moneyid=ins_moneyid
  456. FOR i = 1 TO ds_mstpaymx.RowCount()
  457. IF ds_mstpaymx.Object.mainmstpayamt[i] <> 0 OR ds_mstpaymx.Object.mainpayamt[i] <> 0 THEN
  458. IF uo_bill.acceptmx(ds_mstpaymx.Object.payid[i],&
  459. ds_mstpaymx.Object.billcode[i],&
  460. ds_mstpaymx.Object.mstpayamt[i],&
  461. ds_mstpaymx.Object.payamt[i],&
  462. ds_mstpaymx.Object.oriamt[i],&
  463. ds_mstpaymx.Object.mainmstpayamt[i],&
  464. ds_mstpaymx.Object.mainpayamt[i],&
  465. ds_mstpaymx.Object.relbillcode[i],&
  466. arg_msg) = 0 THEN
  467. MessageBox('错误',arg_msg,stopsign!,ok!)
  468. RETURN
  469. END IF
  470. END IF
  471. NEXT
  472. IF uo_bill.Save_ds(arg_msg,TRUE) = 0 THEN
  473. MessageBox('错误',arg_msg,stopsign!,ok!)
  474. return
  475. END IF
  476. IF sys_option_mustpay_auditing = 1 then
  477. IF uo_bill.auditing(uo_bill.buybillid,publ_operator,arg_msg,true)=0 then
  478. messagebox('错误',arg_msg,stopsign!,ok!)
  479. return
  480. END IF
  481. END IF
  482. MessageBox('提示','自动生成采购支出单成功,单据编号为'+uo_bill.buybillcode,information!,ok!)
  483. DESTROY uo_bill
  484. cb_retrieve.TriggerEvent(Clicked!)
  485. end event
  486. event ue_dwchild_filter();dw_mstpay.setfilter('')
  487. dw_mstpay.filter()
  488. end event
  489. event ue_rbbutton();dw_mstpay.event rbbutton( dw_mstpay.arg_ins_dwtype,dw_mstpay.arg_ins_dwname,dw_mstpay.arg_ins_dwdata,dw_mstpay.arg_ins_dwrow )
  490. end event
  491. event ue_create_buybill();//辅助建立供应商对数单
  492. if not f_power_ind(639) then
  493. messagebox('提示','你没有使用权限!',information!,ok!)
  494. return
  495. end if
  496. if cur_id <= 0 then
  497. messagebox('提示','请选择供应商',information!,ok!)
  498. return
  499. end if
  500. if cur_scid < 0 then
  501. messagebox('提示','请选择分部',information!,ok!)
  502. return
  503. end if
  504. s_edit_index_tran s_open_tran
  505. s_open_tran.b_long=cur_id
  506. s_open_tran.b_string = ''
  507. s_open_tran.b_decimal = 0
  508. s_open_tran.c_long = cur_scid
  509. openwithparm(w_buybill,s_open_tran)
  510. wf_refresh_balc()
  511. this.triggerevent('retrieve_pay')
  512. end event
  513. event ue_create_sptamt();//辅助建立供应商付款单
  514. IF Not f_power_ind(920) THEN
  515. MessageBox(publ_operator,"你没有权限")
  516. RETURN
  517. END IF
  518. IF cur_id <= 0 THEN
  519. MessageBox(publ_operator,'请选择供应商')
  520. RETURN
  521. END IF
  522. IF cur_scid < 0 THEN
  523. MessageBox(publ_operator,'请选择分部')
  524. RETURN
  525. END IF
  526. String ls_scname
  527. SELECT scname
  528. INTO :ls_scname
  529. FROM u_scdef
  530. Where scid = :cur_scid;
  531. IF sqlca.SQLCode <> 0 THEN
  532. MessageBox('系统提示','查询分部名称失败')
  533. RETURN
  534. END IF
  535. s_edit_index_tran s_open_tran
  536. s_open_tran.d_long = 1
  537. s_open_tran.c_long = cur_scid
  538. s_open_tran.d_string = ls_scname
  539. s_open_tran.e_long = cur_id
  540. OpenWithParm(w_sptamt_edit_response,s_open_tran)
  541. wf_refresh_balc()
  542. This.TriggerEvent('retrieve_pay')
  543. end event
  544. event ue_create_reissue_spt();//辅助建立供应商费用单
  545. IF Not f_power_ind(1021) THEN
  546. MessageBox(publ_operator,"你没有权限")
  547. RETURN
  548. END IF
  549. IF cur_id <= 0 THEN
  550. MessageBox(publ_operator,'请选择供应商')
  551. RETURN
  552. END IF
  553. IF cur_scid < 0 THEN
  554. MessageBox(publ_operator,'请选择分部')
  555. RETURN
  556. END IF
  557. String ls_scname
  558. SELECT scname
  559. INTO :ls_scname
  560. FROM u_scdef
  561. Where scid = :cur_scid;
  562. IF sqlca.SQLCode <> 0 THEN
  563. MessageBox('系统提示','查询分部名称失败')
  564. RETURN
  565. END IF
  566. s_edit_index_tran s_open_tran
  567. s_open_tran.d_long = 1
  568. s_open_tran.c_long = cur_scid
  569. s_open_tran.d_string = ls_scname
  570. s_open_tran.e_long = cur_id
  571. OpenWithParm(w_reissue_spt_response,s_open_tran)
  572. wf_refresh_balc()
  573. This.TriggerEvent('retrieve_pay')
  574. end event
  575. event ue_buybill_auto_p();IF Not f_power_ind(1546) THEN
  576. MessageBox('提示','你没有使用权限!',information!,ok!)
  577. RETURN
  578. END IF
  579. IF MessageBox('确认','是否对当前选择供应商自动对单?',question!,yesno!) = 2 THEN RETURN
  580. Long row
  581. DateTime enddate
  582. Long uc_scid,uc_moneyid,uc_sptid
  583. Long ll_i,ll_j,ll_k,i
  584. Long ll_pay_i
  585. String ls_pay_i_billcode,ls_not_pay_i_billcode
  586. Decimal ld_payamt
  587. DateTime ldt_paydate
  588. Long ll_banktypeid,ll_row
  589. String ls_mxdscrp
  590. Long ll_accountsid, ll_itemid
  591. Decimal payamt
  592. //DateTime ls_dsdate
  593. //String ls_dsdscrp
  594. String arg_msg_all
  595. String ls_sptname
  596. decimal lde_mstpayamt_tolbill, lde_payamt_tolbill, lde_payamt_mx
  597. datastore ds_mstpaymx
  598. ds_mstpaymx = Create datastore
  599. ds_mstpaymx.DataObject = "dw_buybillmx_index"
  600. uo_buybill uo_bill
  601. uo_bill = Create uo_buybill
  602. datastore ds_pay,ds_mstpay
  603. ds_pay = Create datastore
  604. ds_pay.DataObject = 'ds_mstpay_index_autobill'
  605. ds_pay.SetTransObject(sqlca)
  606. ds_mstpay = Create datastore
  607. ds_mstpay.DataObject = 'ds_mstpay_index_autobill_mst'
  608. ds_mstpay.SetTransObject(sqlca)
  609. row = dw_pageretr.Find('ch = 1',1,dw_pageretr.RowCount())
  610. IF row <= 0 THEN
  611. MessageBox('系统提示','请先选择供应商')
  612. RETURN
  613. END IF
  614. Open(w_autobill_date_ch)
  615. s_edit_index_tran s_tran_date
  616. s_tran_date = Message.PowerObjectParm
  617. IF s_tran_date.b_long = 0 THEN RETURN
  618. enddate = s_tran_date.b_datetime
  619. FOR ll_i = 1 To dw_pageretr.RowCount()
  620. IF dw_pageretr.Object.ch[ll_i] = 0 THEN CONTINUE
  621. uc_sptid = dw_pageretr.Object.sptid[ll_i]
  622. uc_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[ll_i]
  623. ls_sptname = dw_pageretr.Object.Name[ll_i]
  624. IF sys_option_scid_msttake_mstpay = 1 THEN
  625. uc_scid = dw_pageretr.Object.v_spt_balcamt_scid[ll_i]
  626. ELSE
  627. uc_scid = cur_scid
  628. END IF
  629. ds_pay.Retrieve(uc_scid,uc_sptid,enddate,uc_moneyid)
  630. ll_row = 0
  631. FOR ll_j = 1 To ds_pay.RowCount()
  632. IF ds_pay.Object.payamt[ll_j] - ds_pay.Object.mstpayamt[ll_j] = 0 THEN CONTINUE
  633. ls_pay_i_billcode = ''
  634. ls_not_pay_i_billcode = ''
  635. lde_mstpayamt_tolbill = 0
  636. lde_payamt_tolbill = 0
  637. // ld_payamt = 0
  638. //本次已付款
  639. ld_payamt = ds_pay.Object.payamt[ll_j] - ds_pay.Object.mstpayamt[ll_j]
  640. ldt_paydate = ds_pay.Object.paydate[ll_j]
  641. ll_banktypeid = ds_pay.Object.banktypeid[ll_j]
  642. ls_mxdscrp = ds_pay.Object.dscrp[ll_j]
  643. ll_accountsid = ds_pay.Object.u_bmstpay_accountsid[ll_j]
  644. ll_itemid = ds_pay.Object.u_bmstpay_itemid[ll_j]
  645. ls_pay_i_billcode = ds_pay.Object.billcode[ll_j]
  646. ds_mstpaymx.Reset()
  647. ll_row = ds_mstpaymx.InsertRow(0)
  648. ll_pay_i = ll_row
  649. ds_mstpaymx.Object.billcode[ll_row] = ds_pay.Object.billcode[ll_j]
  650. ds_mstpaymx.Object.paydate[ll_row] = ds_pay.Object.paydate[ll_j]
  651. ds_mstpaymx.Object.oriamt[ll_row] = ds_pay.Object.oriamt[ll_j]
  652. ds_mstpaymx.Object.mainmstpayamt[ll_row] = ds_pay.Object.mstpayamt[ll_j]
  653. ds_mstpaymx.Object.mainpayamt[ll_row] = ds_pay.Object.payamt[ll_j]
  654. ds_mstpaymx.Object.payid[ll_row] = ds_pay.Object.payid[ll_j]
  655. // ds_mstpaymx.Object.moneyid[ll_row] = ds_pay.Object.u_bmstpay_moneyid[ll_j]
  656. ds_mstpay.Retrieve(uc_scid,uc_sptid,enddate,uc_moneyid)
  657. FOR ll_k = 1 To ds_mstpay.RowCount()
  658. IF ld_payamt <= 0 THEN EXIT
  659. IF ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k] = 0 THEN CONTINUE
  660. if ld_payamt > ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k] then
  661. lde_payamt_mx = ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k]
  662. ld_payamt = ld_payamt - lde_payamt_mx
  663. else
  664. lde_payamt_mx = ld_payamt
  665. ld_payamt = 0
  666. end if
  667. ll_row = ds_mstpaymx.InsertRow(0)
  668. ds_mstpaymx.Object.billcode[ll_row] = ds_mstpay.Object.billcode[ll_k]
  669. ds_mstpaymx.Object.paydate[ll_row] = ds_mstpay.Object.paydate[ll_k]
  670. ds_mstpaymx.Object.oriamt[ll_row] = ds_mstpay.Object.oriamt[ll_k]
  671. ds_mstpaymx.Object.mainmstpayamt[ll_row] = ds_mstpay.Object.mstpayamt[ll_k]
  672. ds_mstpaymx.Object.mainpayamt[ll_row] = ds_mstpay.Object.payamt[ll_k]
  673. ds_mstpaymx.Object.payid[ll_row] = ds_mstpay.Object.payid[ll_k]
  674. // ds_mstpaymx.Object.moneyid[ll_row] = ds_mstpay.Object.u_bmstpay_moneyid[ll_k]
  675. ds_mstpaymx.Object.mstpayamt[ll_row] = 0
  676. //明细分配已付
  677. ds_mstpaymx.Object.payamt[ll_row] = lde_payamt_mx
  678. ls_not_pay_i_billcode += ds_mstpay.Object.billcode[ll_k] + ','
  679. lde_payamt_tolbill += lde_payamt_mx
  680. NEXT
  681. //总分配已收
  682. lde_mstpayamt_tolbill = ds_mstpaymx.Object.mainpayamt[ll_pay_i] - ds_mstpaymx.Object.mainmstpayamt[ll_pay_i] - ld_payamt
  683. ds_mstpaymx.Object.payamt[ll_pay_i] = 0 - lde_mstpayamt_tolbill
  684. // FOR i = 1 To ds_mstpaymx.RowCount()
  685. // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] < 0 THEN
  686. // ll_pay_i = i
  687. // ls_pay_i_billcode = ds_mstpaymx.Object.billcode[i]
  688. // ELSE
  689. // ls_not_pay_i_billcode = ls_not_pay_i_billcode + Trim(ds_mstpaymx.Object.billcode[i])+','
  690. // END IF
  691. // NEXT
  692. ls_not_pay_i_billcode = Left(ls_not_pay_i_billcode,Len(ls_not_pay_i_billcode) - 1 )
  693. ls_not_pay_i_billcode = left(ls_not_pay_i_billcode,250)
  694. ls_pay_i_billcode = left(ls_pay_i_billcode,250)
  695. FOR i = 1 To ds_mstpaymx.RowCount()
  696. IF i = ll_pay_i THEN
  697. ds_mstpaymx.Object.relbillcode[i] = ls_not_pay_i_billcode
  698. ELSE
  699. ds_mstpaymx.Object.relbillcode[i] = ls_pay_i_billcode
  700. END IF
  701. NEXT
  702. // payamt = 0
  703. // FOR i = 1 To ds_mstpaymx.RowCount()
  704. // payamt = payamt - (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  705. // ds_mstpaymx.Object.payamt[i] = (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  706. // NEXT
  707. // ds_mstpaymx.AcceptText()
  708. //
  709. // //第二次循环:根据可分配判断正负,修正相关结余(正-负、负-正)
  710. // IF payamt < 0 THEN //不够分配
  711. // FOR i = ds_mstpaymx.RowCount() To 1 Step - 1
  712. //
  713. // If (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i]) <= 0 THEN CONTINUE
  714. //
  715. // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] + payamt < 0 THEN
  716. // ds_mstpaymx.Object.payamt[i] = 0
  717. // payamt = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  718. // ELSE
  719. // ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  720. // payamt = 0
  721. // END IF
  722. // NEXT
  723. // ELSE // 分配有剩
  724. // FOR i = ds_mstpaymx.RowCount() To 1 Step - 1
  725. // If (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i]) >= 0 THEN CONTINUE
  726. //
  727. // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] + payamt > 0 THEN
  728. // ds_mstpaymx.Object.payamt[i] = 0
  729. // payamt = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  730. // ELSE
  731. // ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
  732. // payamt = 0
  733. // END IF
  734. // NEXT
  735. // END IF
  736. ds_mstpaymx.AcceptText()
  737. // ls_dsdate = ldt_paydate
  738. // ls_dsdscrp = ls_mxdscrp
  739. String arg_msg = ''
  740. IF uo_bill.newbegin() = 0 THEN
  741. arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
  742. GOTO _next_spt
  743. END IF
  744. uo_bill.opemp = publ_operator
  745. uo_bill.paydate = ldt_paydate
  746. uo_bill.relcode = ''
  747. uo_bill.inrep = publ_operator
  748. uo_bill.banktypeid = ll_banktypeid
  749. uo_bill.dscrp = ''
  750. uo_bill.sptid = uc_sptid
  751. uo_bill.mstpayamt = lde_mstpayamt_tolbill
  752. uo_bill.payamt = lde_payamt_tolbill
  753. uo_bill.accountsid = ll_accountsid
  754. uo_bill.itemid = ll_itemid
  755. uo_bill.buildtype = 1
  756. uo_bill.moneyid = uc_moneyid
  757. FOR i = 1 To ds_mstpaymx.RowCount()
  758. IF ds_mstpaymx.Object.mstpayamt[i] <> 0 Or ds_mstpaymx.Object.payamt[i] <> 0 THEN
  759. IF uo_bill.acceptmx(ds_mstpaymx.Object.payid[i],&
  760. ds_mstpaymx.Object.billcode[i],&
  761. ds_mstpaymx.Object.mstpayamt[i],&
  762. ds_mstpaymx.Object.payamt[i],&
  763. ds_mstpaymx.Object.oriamt[i],&
  764. ds_mstpaymx.Object.mstpayamt[i],&
  765. ds_mstpaymx.Object.payamt[i],&
  766. ds_mstpaymx.Object.relbillcode[i],&
  767. arg_msg) = 0 THEN
  768. arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
  769. GOTO _next_spt
  770. END IF
  771. END IF
  772. NEXT
  773. IF uo_bill.Save_ds(arg_msg,True) = 0 THEN
  774. arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
  775. GOTO _next_spt
  776. END IF
  777. IF sys_option_mustpay_auditing = 1 then
  778. IF uo_bill.auditing(uo_bill.buybillid,publ_operator,arg_msg,true)=0 then
  779. arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'审核失败,'+arg_msg +'~r~n'
  780. GOTO _next_spt
  781. END IF
  782. END IF
  783. //已收款没有被对完,即代表没有应收款再对,跳出功能.
  784. IF ld_payamt > 0 THEN EXIT
  785. NEXT
  786. _next_spt:
  787. NEXT
  788. Destroy uo_bill
  789. Destroy ds_pay
  790. Destroy ds_mstpay
  791. IF Trim(arg_msg_all) <> '' THEN
  792. OpenWithParm(w_message_err,arg_msg_all)
  793. else
  794. MessageBox('系统提示','自动对数操作完成')
  795. END IF
  796. cb_retrieve.TriggerEvent(Clicked!)
  797. end event
  798. event ue_date1();//IF THIS.Text = "本日" THEN
  799. em_firstday.text = string(today(),"yyyy-mm-dd")
  800. em_endday.text = string(today(),"yyyy-mm-dd")
  801. //ELSEIF THIS.Text = "本周" THEN
  802. // int li_DayNum
  803. // li_DayNum = DayNumber(today())
  804. // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  805. // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  806. //ELSEIF THIS.Text = "本月" THEN
  807. // int li_Month, li_Year, li_Days
  808. // li_Month = Month(today())
  809. // li_Year = Year(today())
  810. // li_Days = days_in_month(li_Month, li_Year)
  811. // em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  812. // em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  813. //END IF
  814. end event
  815. event ue_date2();//IF THIS.Text = "本日" THEN
  816. // em_firstday.text = string(today(),"yyyy-mm-dd")
  817. // em_endday.text = string(today(),"yyyy-mm-dd")
  818. //ELSEIF THIS.Text = "本周" THEN
  819. int li_DayNum
  820. li_DayNum = DayNumber(today())
  821. em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  822. em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  823. //ELSEIF THIS.Text = "本月" THEN
  824. // int li_Month, li_Year, li_Days
  825. // li_Month = Month(today())
  826. // li_Year = Year(today())
  827. // li_Days = days_in_month(li_Month, li_Year)
  828. // em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  829. // em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  830. //END IF
  831. end event
  832. event ue_date3();//IF THIS.Text = "本日" THEN
  833. // em_firstday.text = string(today(),"yyyy-mm-dd")
  834. // em_endday.text = string(today(),"yyyy-mm-dd")
  835. //ELSEIF THIS.Text = "本周" THEN
  836. // int li_DayNum
  837. // li_DayNum = DayNumber(today())
  838. // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  839. // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  840. //ELSEIF THIS.Text = "本月" THEN
  841. int li_Month, li_Year, li_Days
  842. li_Month = Month(today())
  843. li_Year = Year(today())
  844. li_Days = days_in_month(li_Month, li_Year)
  845. em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  846. em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  847. //END IF
  848. end event
  849. event ue_date4();//IF THIS.Text = "本日" THEN
  850. // em_firstday.text = string(today(),"yyyy-mm-dd")
  851. // em_endday.text = string(today(),"yyyy-mm-dd")
  852. //ELSEIF THIS.Text = "本周" THEN
  853. // int li_DayNum
  854. // li_DayNum = DayNumber(today())
  855. // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
  856. // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
  857. //ELSEIF THIS.Text = "本月" THEN
  858. Int li_Month, li_Year, li_Days
  859. li_Month = Month(Today())
  860. li_Year = Year(Today())
  861. IF li_Month = 1 THEN
  862. li_Month = 12
  863. li_Year = li_Year - 1
  864. ELSE
  865. li_Month -= 1
  866. END IF
  867. li_Days = days_in_month(li_Month, li_Year)
  868. em_firstday.Text = String(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
  869. em_endday.Text = String(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
  870. //END IF
  871. end event
  872. public subroutine wf_refresh_balc ();
  873. Long li_row
  874. Long ll_sptid,ll_scid,ll_moneyid
  875. Decimal li_new_balc
  876. li_row = dw_pageretr.GetRow()
  877. IF li_row <= 0 THEN RETURN
  878. ll_sptid = dw_pageretr.Object.sptid[li_row]
  879. ll_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[li_row]
  880. IF sys_option_scid_msttake_mstpay = 1 THEN
  881. ll_scid = dw_pageretr.Object.v_spt_balcamt_scid [li_row]
  882. ELSE
  883. ll_scid = -1
  884. END IF
  885. SELECT sum(v_spt_balcamt.spt_balcamt)
  886. INTO :li_new_balc
  887. FROM v_spt_balcamt
  888. WHERE ( v_spt_balcamt.sptid = :ll_sptid )
  889. And ( v_spt_balcamt.moneyid = :ll_moneyid )
  890. And ( v_spt_balcamt.scid = :ll_scid OR :ll_scid = -1);
  891. IF sqlca.SQLCode <> 0 THEN RETURN
  892. IF IsNull(li_new_balc) THEN li_new_balc = 0.00
  893. dw_pageretr.Object.v_spt_balcamt_spt_balcamt[li_row] = li_new_balc
  894. dw_pageretr.Object.amt[li_row] = round(li_new_balc * dw_pageretr.Object.rate[li_row],2)
  895. end subroutine
  896. public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of
  897. //days in 11 of the 12 months. February is, of course, the problem.
  898. //In a leap year February has 29 days, otherwise 28.
  899. Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31}
  900. // Get the number of days per month for a non leap year.
  901. li_DaysInMonth = li_Days[Month]
  902. // Check for a leap year.
  903. If Month = 2 Then
  904. // If the year is a leap year, change the number of days.
  905. // Leap Year Calculation:
  906. // Year divisible by 4, but not by 100, unless it is also divisible by 400
  907. If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then
  908. li_DaysInMonth = 29
  909. End If
  910. End If
  911. //Return the number of days in the relevant month
  912. Return li_DaysInMonth
  913. end function
  914. public function integer wf_dispamt ();Int rslt = 0
  915. Long row
  916. dw_mstpay.AcceptText()
  917. row = dw_mstpay.GetRow()
  918. IF row > 0 And dw_mstpay.GetColumnName( ) = 'checkdata' THEN
  919. IF dw_mstpay.Object.checkdata[row] = 0 THEN
  920. ins_mstpayamt = ins_mstpayamt+dw_mstpay.Object.mstpayamt[row]
  921. ins_payamt = ins_payamt+dw_mstpay.Object.payamt[row]
  922. ELSE
  923. ins_mstpayamt = ins_mstpayamt - dw_mstpay.Object.mstpayamt[row]
  924. ins_payamt = ins_payamt - dw_mstpay.Object.payamt[row]
  925. END IF
  926. st_mstpayamt.Text = '应收金额:'+String(ins_mstpayamt,'####0.##')
  927. st_payamt.Text = '已收金额:'+String(ins_payamt,'####0.##')
  928. st_balcamt.Text = '结余金额:'+String(ins_mstpayamt - ins_payamt,'####0.##')
  929. IF ins_mstpayamt > ins_payamt THEN
  930. st_balcamt.TextColor = RGB(253,13,31)
  931. ELSE
  932. st_balcamt.TextColor = RGB(0,0,0)
  933. END IF
  934. ELSE
  935. wf_initdisp()
  936. END IF
  937. RETURN rslt
  938. end function
  939. public subroutine wf_initdisp ();ins_mstpayamt = 0
  940. ins_payamt = 0
  941. st_mstpayamt.Text = '应付金额:0'
  942. st_payamt.Text = '已付金额:0'
  943. st_balcamt.Text = '结余金额:0'
  944. end subroutine
  945. on w_mustpay.create
  946. int iCurrent
  947. call super::create
  948. this.dw_mstpay=create dw_mstpay
  949. this.cbx_ifshowall=create cbx_ifshowall
  950. this.st_3=create st_3
  951. this.em_firstday=create em_firstday
  952. this.st_4=create st_4
  953. this.em_endday=create em_endday
  954. this.cb_retrieve=create cb_retrieve
  955. this.cb_2=create cb_2
  956. this.cb_3=create cb_3
  957. this.dw_mstpaymx=create dw_mstpaymx
  958. this.ddlb_1=create ddlb_1
  959. this.cb_autofinish=create cb_autofinish
  960. this.cb_4=create cb_4
  961. this.ddlb_2=create ddlb_2
  962. this.cb_reset=create cb_reset
  963. this.st_6=create st_6
  964. this.ddlb_3=create ddlb_3
  965. this.st_2=create st_2
  966. this.st_5=create st_5
  967. this.cb_1=create cb_1
  968. this.cbx_all=create cbx_all
  969. this.pb_em1=create pb_em1
  970. this.pb_em2=create pb_em2
  971. this.pb_2=create pb_2
  972. this.cb_pay=create cb_pay
  973. this.st_payamt=create st_payamt
  974. this.st_mstpayamt=create st_mstpayamt
  975. this.st_balcamt=create st_balcamt
  976. this.ln_bar=create ln_bar
  977. this.ln_bar2=create ln_bar2
  978. this.r_bar=create r_bar
  979. this.ln_1=create ln_1
  980. this.ln_2=create ln_2
  981. this.ln_5=create ln_5
  982. this.ln_6=create ln_6
  983. this.ln_3=create ln_3
  984. this.ln_4=create ln_4
  985. this.st_amtdisp=create st_amtdisp
  986. this.cbx_1=create cbx_1
  987. iCurrent=UpperBound(this.Control)
  988. this.Control[iCurrent+1]=this.dw_mstpay
  989. this.Control[iCurrent+2]=this.cbx_ifshowall
  990. this.Control[iCurrent+3]=this.st_3
  991. this.Control[iCurrent+4]=this.em_firstday
  992. this.Control[iCurrent+5]=this.st_4
  993. this.Control[iCurrent+6]=this.em_endday
  994. this.Control[iCurrent+7]=this.cb_retrieve
  995. this.Control[iCurrent+8]=this.cb_2
  996. this.Control[iCurrent+9]=this.cb_3
  997. this.Control[iCurrent+10]=this.dw_mstpaymx
  998. this.Control[iCurrent+11]=this.ddlb_1
  999. this.Control[iCurrent+12]=this.cb_autofinish
  1000. this.Control[iCurrent+13]=this.cb_4
  1001. this.Control[iCurrent+14]=this.ddlb_2
  1002. this.Control[iCurrent+15]=this.cb_reset
  1003. this.Control[iCurrent+16]=this.st_6
  1004. this.Control[iCurrent+17]=this.ddlb_3
  1005. this.Control[iCurrent+18]=this.st_2
  1006. this.Control[iCurrent+19]=this.st_5
  1007. this.Control[iCurrent+20]=this.cb_1
  1008. this.Control[iCurrent+21]=this.cbx_all
  1009. this.Control[iCurrent+22]=this.pb_em1
  1010. this.Control[iCurrent+23]=this.pb_em2
  1011. this.Control[iCurrent+24]=this.pb_2
  1012. this.Control[iCurrent+25]=this.cb_pay
  1013. this.Control[iCurrent+26]=this.st_payamt
  1014. this.Control[iCurrent+27]=this.st_mstpayamt
  1015. this.Control[iCurrent+28]=this.st_balcamt
  1016. this.Control[iCurrent+29]=this.ln_bar
  1017. this.Control[iCurrent+30]=this.ln_bar2
  1018. this.Control[iCurrent+31]=this.r_bar
  1019. this.Control[iCurrent+32]=this.ln_1
  1020. this.Control[iCurrent+33]=this.ln_2
  1021. this.Control[iCurrent+34]=this.ln_5
  1022. this.Control[iCurrent+35]=this.ln_6
  1023. this.Control[iCurrent+36]=this.ln_3
  1024. this.Control[iCurrent+37]=this.ln_4
  1025. this.Control[iCurrent+38]=this.st_amtdisp
  1026. this.Control[iCurrent+39]=this.cbx_1
  1027. end on
  1028. on w_mustpay.destroy
  1029. call super::destroy
  1030. destroy(this.dw_mstpay)
  1031. destroy(this.cbx_ifshowall)
  1032. destroy(this.st_3)
  1033. destroy(this.em_firstday)
  1034. destroy(this.st_4)
  1035. destroy(this.em_endday)
  1036. destroy(this.cb_retrieve)
  1037. destroy(this.cb_2)
  1038. destroy(this.cb_3)
  1039. destroy(this.dw_mstpaymx)
  1040. destroy(this.ddlb_1)
  1041. destroy(this.cb_autofinish)
  1042. destroy(this.cb_4)
  1043. destroy(this.ddlb_2)
  1044. destroy(this.cb_reset)
  1045. destroy(this.st_6)
  1046. destroy(this.ddlb_3)
  1047. destroy(this.st_2)
  1048. destroy(this.st_5)
  1049. destroy(this.cb_1)
  1050. destroy(this.cbx_all)
  1051. destroy(this.pb_em1)
  1052. destroy(this.pb_em2)
  1053. destroy(this.pb_2)
  1054. destroy(this.cb_pay)
  1055. destroy(this.st_payamt)
  1056. destroy(this.st_mstpayamt)
  1057. destroy(this.st_balcamt)
  1058. destroy(this.ln_bar)
  1059. destroy(this.ln_bar2)
  1060. destroy(this.r_bar)
  1061. destroy(this.ln_1)
  1062. destroy(this.ln_2)
  1063. destroy(this.ln_5)
  1064. destroy(this.ln_6)
  1065. destroy(this.ln_3)
  1066. destroy(this.ln_4)
  1067. destroy(this.st_amtdisp)
  1068. destroy(this.cbx_1)
  1069. end on
  1070. event resize;call super::resize;ln_bar.endx = this.width
  1071. ln_bar2.endx = this.width
  1072. ln_1.endx = this.width
  1073. ln_2.endx = this.width
  1074. r_bar.width = this.width
  1075. long w_width,w_height
  1076. w_width = 3600
  1077. w_height = 2300
  1078. if newwidth < w_width then this.width = w_width
  1079. if newheight < w_height then this.height = w_height
  1080. dw_pageretr.height=this.height - (w_height - 1785)
  1081. dw_mstpay.height=this.height - (w_height - 1104)
  1082. dw_mstpay.width=this.width - (w_width - 2082)
  1083. dw_mstpaymx.width=this.width - (w_width - 2082)
  1084. dw_mstpaymx.y=this.height - (w_height - 1500)
  1085. end event
  1086. event open;call super::open;uo_pay= create uo_mustpay
  1087. em_firstday.text=string(today(),'yyyy-mm')+'-01'
  1088. em_endday.text=string(today(),'yyyy-mm-dd')
  1089. cb_retrieve.triggerevent(clicked!)
  1090. end event
  1091. event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  1092. Boolean cb_func_enabled,cb_retrieve_enabled
  1093. cb_nextpage_enabled = cb_nextpage.Enabled
  1094. cb_retrieveall_enabled = cb_retrieveall.Enabled
  1095. cb_func_enabled = cb_func.Enabled
  1096. cb_nextpage.Enabled = FALSE
  1097. cb_retrieveall.Enabled = FALSE
  1098. cb_func.Enabled = FALSE
  1099. SetPointer(HourGlass!)
  1100. Int ls_ifshowall
  1101. IF cbx_ifshowall.Checked THEN
  1102. ls_ifshowall = 0
  1103. ELSE
  1104. ls_ifshowall = 1
  1105. END IF
  1106. IF sys_option_scid_msttake_mstpay = 1 THEN
  1107. dw_pageretr.Retrieve(ls_ifshowall,cur_scid_arr,sys_user_spttype,ins_moneyid)
  1108. ELSE
  1109. dw_pageretr.Retrieve(ls_ifshowall,sys_user_spttype,ins_moneyid)
  1110. END IF
  1111. IF dw_pageretr.RowCount() > 0 AND dw_pageretr.GetRow() = 0 THEN dw_pageretr.SetRow(1)
  1112. SetPointer(Arrow!)
  1113. THIS.TriggerEvent('retrieve_pay')
  1114. THIS.TriggerEvent("retrieve_paymx")
  1115. wf_refresh_balc()
  1116. cb_nextpage.Enabled = cb_nextpage_enabled
  1117. cb_retrieveall.Enabled = cb_retrieveall_enabled
  1118. cb_func.Enabled = cb_func_enabled
  1119. end event
  1120. event ue_before_open;call super::ue_before_open;IF sys_option_scid_msttake_mstpay = 1 THEN
  1121. dw_pageretr.DataObject = 'dw_mstpay_spt_index'
  1122. ELSE
  1123. dw_pageretr.DataObject = 'dw_mstpay_spt_index_not_scid'
  1124. END IF
  1125. dw_pageretr.TriggerEvent(Constructor!)
  1126. em_pagerowno.TriggerEvent(Constructor!)
  1127. dw_mstpay.SetTransObject(sqlca)
  1128. dw_mstpaymx.SetTransObject(sqlca)
  1129. if_ue_retr=true
  1130. if_ue_filter=true
  1131. if_ue_sort=true
  1132. end event
  1133. event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
  1134. ls_newselect = Lower(ori_oldselect)
  1135. //messagebox("",string(sle_usual_query.Text))
  1136. IF Trim(sle_usual_query.Text) <> '' THEN
  1137. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  1138. ls_querystrpart = "(u_spt.sptcode like '%"+Trim(sle_usual_query.Text)+"%') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%')"
  1139. ELSE
  1140. ls_querystrpart = "(u_spt.sptcode like '"+Trim(sle_usual_query.Text)+"') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%') "
  1141. END IF
  1142. IF Pos(ls_newselect," where ") <> 0 and Pos(ls_newselect," group by")<>0 THEN
  1143. ls_newselect = ls_newselect+"having ("+ls_querystrpart+')'
  1144. ELSEIF Pos(ls_newselect," where ") <> 0 THEN
  1145. ls_newselect = ls_newselect+"AND ("+ls_querystrpart+')'
  1146. ELSE
  1147. ls_newselect = ls_newselect+"where ("+ls_querystrpart+')'
  1148. END IF
  1149. //messagebox("",ls_newselect)
  1150. END IF
  1151. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  1152. THIS.TriggerEvent('retrieve_pageretr')
  1153. end event
  1154. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  1155. if trim(sle_usual_query.text)<>'' then
  1156. if pos(trim(sle_usual_query.text),'%')=0 then
  1157. //obj_expr=obj_expr+'( sptcode like "%'+trim(sle_usual_query.text)+'%" )'
  1158. obj_expr=obj_expr+"(u_spt.sptcode like '%"+Trim(sle_usual_query.Text)+"%') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%')"
  1159. else
  1160. //obj_expr=obj_expr+'( sptcode like "'+trim(sle_usual_query.text)+'" )'
  1161. obj_expr=obj_expr+"(u_spt.sptcode like '"+Trim(sle_usual_query.Text)+"') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%') "
  1162. end if
  1163. end if
  1164. dw_pageretr.setfilter(obj_expr)
  1165. dw_pageretr.setredraw(false)
  1166. dw_pageretr.filter()
  1167. if dw_pageretr.rowcount()>=1 then
  1168. dw_pageretr.selectrow(0,false)
  1169. dw_pageretr.selectrow(1,true)
  1170. end if
  1171. dw_pageretr.setredraw(true)
  1172. end event
  1173. event user_key;call super::user_key;IF KeyDown(KeyF1!) THEN
  1174. this.TriggerEvent("ue_help")
  1175. end if
  1176. end event
  1177. type cb_func from w_publ_pageretr`cb_func within w_mustpay
  1178. integer x = 151
  1179. integer y = 0
  1180. integer width = 151
  1181. integer height = 164
  1182. end type
  1183. type cb_exit from w_publ_pageretr`cb_exit within w_mustpay
  1184. integer x = 1344
  1185. integer y = 0
  1186. integer width = 151
  1187. integer height = 164
  1188. integer picsize = 16
  1189. toolbaralignment pic_align = alignattop!
  1190. boolean border = false
  1191. end type
  1192. type sle_usual_query from w_publ_pageretr`sle_usual_query within w_mustpay
  1193. integer x = 343
  1194. integer y = 192
  1195. integer width = 549
  1196. integer height = 84
  1197. end type
  1198. event sle_usual_query::modified;//messagebox("","123")
  1199. IF retrieve_all or retrmode=0 THEN
  1200. // PARENT.TRIGGEREVENT("ue_usual_query_filt")
  1201. ELSE
  1202. PARENT.TRIGGEREVENT("ue_usual_query_RETR")
  1203. END IF
  1204. end event
  1205. type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_mustpay
  1206. integer x = 1851
  1207. integer width = 142
  1208. integer height = 164
  1209. string normalpicname = "p1.ico"
  1210. integer picsize = 16
  1211. toolbaralignment pic_align = alignattop!
  1212. boolean border = false
  1213. end type
  1214. type em_pagerowno from w_publ_pageretr`em_pagerowno within w_mustpay
  1215. integer x = 1559
  1216. integer y = 44
  1217. integer width = 288
  1218. end type
  1219. type dw_pageretr from w_publ_pageretr`dw_pageretr within w_mustpay
  1220. integer y = 388
  1221. integer width = 1467
  1222. integer height = 1612
  1223. string title = "供应商摘要"
  1224. string dataobject = "dw_mstpay_spt_index"
  1225. end type
  1226. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;cb_retrieve.triggerevent(clicked!)
  1227. wf_initdisp()
  1228. end event
  1229. event dw_pageretr::clicked;call super::clicked;IF dwo.Name = "ch" THEN
  1230. THIS.SetTabOrder("ch" , 10)
  1231. ELSE
  1232. THIS.SetTabOrder("ch" , 0)
  1233. END IF
  1234. end event
  1235. type st_1 from w_publ_pageretr`st_1 within w_mustpay
  1236. integer x = 18
  1237. integer y = 212
  1238. integer width = 343
  1239. string text = "编号/名称含"
  1240. alignment alignment = center!
  1241. end type
  1242. type cb_nextpage from w_publ_pageretr`cb_nextpage within w_mustpay
  1243. integer x = 1993
  1244. integer width = 64
  1245. integer height = 164
  1246. integer picsize = 16
  1247. toolbaralignment pic_align = alignattop!
  1248. boolean border = false
  1249. end type
  1250. type dw_mstpay from u_dw_rbtnfilter within w_mustpay
  1251. integer x = 1472
  1252. integer y = 388
  1253. integer width = 2062
  1254. integer height = 940
  1255. integer taborder = 20
  1256. boolean bringtotop = true
  1257. boolean titlebar = true
  1258. string title = "供应商应付帐"
  1259. string dataobject = "dw_mstpay_index"
  1260. boolean maxbox = true
  1261. boolean hscrollbar = true
  1262. boolean vscrollbar = true
  1263. boolean resizable = true
  1264. boolean border = false
  1265. boolean livescroll = false
  1266. borderstyle borderstyle = stylebox!
  1267. boolean rbutton_filter_use = true
  1268. boolean titleclick_sort_use = true
  1269. end type
  1270. event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row)
  1271. end event
  1272. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
  1273. THIS.SelectRow(0,FALSE)
  1274. THIS.SelectRow(currentrow,TRUE)
  1275. PARENT.TriggerEvent("retrieve_paymx")
  1276. end event
  1277. event rbuttondown;call super::rbuttondown;//String str_clickedobjecttype
  1278. //String column_name,column_text_name
  1279. //Long FindRow, FindPage
  1280. //boolean lb_title = false
  1281. //IF titleclick_sort_use THEN
  1282. // str_clickedobjecttype = Left(dwo.TYPE,4)
  1283. //
  1284. // IF str_clickedobjecttype = 'text' THEN
  1285. // column_text_name = dwo.Name
  1286. //
  1287. // IF Len(column_text_name) >= 3 AND Right(column_text_name,2) = '_t' THEN
  1288. // column_name = Left(column_text_name,Len(column_text_name) - 2)
  1289. // ELSE
  1290. // GOTO cend
  1291. // END IF
  1292. //
  1293. // IF Left(Describe(column_name+'.type'),4) <> 'colu' AND &
  1294. // Left(Describe(column_name+'.type'),4) <> 'comp' THEN
  1295. // RETURN
  1296. // END IF
  1297. // IF curDW_sortstr = column_name+' A ' THEN
  1298. // curDW_sortstr = column_name+' D '
  1299. // ELSE
  1300. // curDW_sortstr = column_name+' A '
  1301. // END IF
  1302. // lb_title = true
  1303. // ELSE
  1304. // curDW_sortstr = ''
  1305. // END IF
  1306. //
  1307. // IF curDW_sortstr <> '' THEN
  1308. // THIS.SetSort(curDW_sortstr)
  1309. // THIS.SetRedraw (FALSE)
  1310. // THIS.Sort()
  1311. // THIS.SetRedraw (TRUE)
  1312. // END IF
  1313. //END IF
  1314. //
  1315. //cend:
  1316. //if lb_title then return
  1317. //IF row > 0 THEN THIS.SetRow(row)
  1318. //
  1319. //arg_ins_xpos = xpos
  1320. //arg_ins_ypos = ypos +50
  1321. //arg_ins_dwname = dwo.Name
  1322. //arg_ins_dwrow = row
  1323. //arg_ins_dwtype = dwo.TYPE
  1324. //String ls_name
  1325. //ls_name = THIS.GetColumnName( )
  1326. //IF row > 0 AND arg_ins_dwtype <> 'datawindow' THEN
  1327. // arg_ins_dwdata = String(dwo.primary[row])
  1328. //END IF
  1329. //
  1330. //
  1331. //m_mstpay m_print
  1332. //m_print = CREATE m_mstpay
  1333. //m_print.m_0.PopMenu(THIS.X + THIS.PointerX() + 50,THIS.Y + THIS.PointerY() + 50)
  1334. end event
  1335. event dwnkey;call super::dwnkey;parent.postevent('user_key')
  1336. end event
  1337. event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_view_bill')
  1338. end event
  1339. event itemchanged;call super::itemchanged;wf_dispamt()
  1340. end event
  1341. type cbx_ifshowall from checkbox within w_mustpay
  1342. integer x = 901
  1343. integer y = 208
  1344. integer width = 608
  1345. integer height = 60
  1346. boolean bringtotop = true
  1347. integer textsize = -9
  1348. integer weight = 400
  1349. fontcharset fontcharset = gb2312charset!
  1350. fontpitch fontpitch = variable!
  1351. string facename = "宋体"
  1352. long textcolor = 33554432
  1353. long backcolor = 134217739
  1354. string text = "只显示有欠款供应商"
  1355. boolean checked = true
  1356. end type
  1357. event clicked;parent.triggerevent('retrieve_pageretr')
  1358. end event
  1359. type st_3 from statictext within w_mustpay
  1360. integer x = 2226
  1361. integer y = 292
  1362. integer width = 201
  1363. integer height = 60
  1364. boolean bringtotop = true
  1365. integer textsize = -9
  1366. integer weight = 400
  1367. fontcharset fontcharset = gb2312charset!
  1368. fontpitch fontpitch = variable!
  1369. string facename = "宋体"
  1370. long textcolor = 33554432
  1371. long backcolor = 134217739
  1372. boolean enabled = false
  1373. string text = "日期从:"
  1374. alignment alignment = right!
  1375. boolean focusrectangle = false
  1376. end type
  1377. type em_firstday from editmask within w_mustpay
  1378. integer x = 2418
  1379. integer y = 276
  1380. integer width = 384
  1381. integer height = 92
  1382. integer taborder = 110
  1383. boolean bringtotop = true
  1384. integer textsize = -9
  1385. integer weight = 400
  1386. fontcharset fontcharset = gb2312charset!
  1387. fontpitch fontpitch = variable!
  1388. string facename = "宋体"
  1389. long textcolor = 33554432
  1390. borderstyle borderstyle = stylelowered!
  1391. maskdatatype maskdatatype = datemask!
  1392. string mask = "yyyy-mm-dd"
  1393. boolean spin = true
  1394. end type
  1395. event rbuttondown;s_calender_arg s_calender
  1396. s_calender.PointerX = THIS.PointerX()
  1397. s_calender.PointerY = THIS.PointerY()
  1398. s_calender.X = THIS.X
  1399. s_calender.Y = THIS.Y
  1400. OpenWithParm(w_calendar,s_calender)
  1401. THIS.Text = String(id_date_selected)
  1402. end event
  1403. type st_4 from statictext within w_mustpay
  1404. integer x = 2903
  1405. integer y = 292
  1406. integer width = 105
  1407. integer height = 60
  1408. boolean bringtotop = true
  1409. integer textsize = -9
  1410. integer weight = 400
  1411. fontcharset fontcharset = gb2312charset!
  1412. fontpitch fontpitch = variable!
  1413. string facename = "宋体"
  1414. long textcolor = 33554432
  1415. long backcolor = 134217739
  1416. boolean enabled = false
  1417. string text = "到:"
  1418. alignment alignment = right!
  1419. boolean focusrectangle = false
  1420. end type
  1421. type em_endday from editmask within w_mustpay
  1422. integer x = 3008
  1423. integer y = 276
  1424. integer width = 384
  1425. integer height = 92
  1426. integer taborder = 120
  1427. boolean bringtotop = true
  1428. integer textsize = -9
  1429. integer weight = 400
  1430. fontcharset fontcharset = gb2312charset!
  1431. fontpitch fontpitch = variable!
  1432. string facename = "宋体"
  1433. long textcolor = 33554432
  1434. borderstyle borderstyle = stylelowered!
  1435. maskdatatype maskdatatype = datemask!
  1436. string mask = "yyyy-mm-dd"
  1437. boolean spin = true
  1438. end type
  1439. event rbuttondown;s_calender_arg s_calender
  1440. s_calender.PointerX = THIS.PointerX()
  1441. s_calender.PointerY = THIS.PointerY()
  1442. s_calender.X = THIS.X
  1443. s_calender.Y = THIS.Y
  1444. OpenWithParm(w_calendar,s_calender)
  1445. THIS.Text = String(id_date_selected)
  1446. end event
  1447. type cb_retrieve from uo_imflatbutton within w_mustpay
  1448. integer width = 151
  1449. integer height = 164
  1450. integer taborder = 50
  1451. boolean bringtotop = true
  1452. string text = "刷新"
  1453. string normalpicname = "refresh.bmp"
  1454. integer picsize = 16
  1455. toolbaralignment pic_align = alignattop!
  1456. boolean border = false
  1457. end type
  1458. event clicked;call super::clicked;parent.triggerevent('retrieve_pay')
  1459. parent.triggerevent("retrieve_paymx")
  1460. wf_refresh_balc()
  1461. wf_initdisp()
  1462. //wf_dispamt()
  1463. end event
  1464. type cb_2 from uo_imflatbutton within w_mustpay
  1465. integer x = 306
  1466. integer width = 192
  1467. integer height = 164
  1468. integer taborder = 60
  1469. boolean bringtotop = true
  1470. string text = "新建&A"
  1471. string normalpicname = "new.bmp"
  1472. integer picsize = 16
  1473. toolbaralignment pic_align = alignattop!
  1474. boolean border = false
  1475. end type
  1476. event clicked;call super::clicked;parent.triggerevent('ue_add')
  1477. end event
  1478. type cb_3 from uo_imflatbutton within w_mustpay
  1479. integer x = 494
  1480. integer width = 192
  1481. integer height = 164
  1482. integer taborder = 60
  1483. boolean bringtotop = true
  1484. string text = "删除&D"
  1485. string normalpicname = "delete.bmp"
  1486. integer picsize = 16
  1487. toolbaralignment pic_align = alignattop!
  1488. boolean border = false
  1489. end type
  1490. event clicked;call super::clicked;parent.triggerevent('ue_del')
  1491. end event
  1492. type dw_mstpaymx from u_dw_rbtnfilter within w_mustpay
  1493. integer x = 1472
  1494. integer y = 1324
  1495. integer width = 2062
  1496. integer height = 672
  1497. integer taborder = 50
  1498. boolean bringtotop = true
  1499. boolean titlebar = true
  1500. string title = "应付帐明细帐"
  1501. string dataobject = "dw_mstpaymx_index"
  1502. boolean maxbox = true
  1503. boolean hscrollbar = true
  1504. boolean vscrollbar = true
  1505. boolean resizable = true
  1506. boolean border = false
  1507. borderstyle borderstyle = stylebox!
  1508. end type
  1509. type ddlb_1 from uo_ddlb_scid within w_mustpay
  1510. integer x = 343
  1511. integer y = 292
  1512. integer width = 549
  1513. integer height = 768
  1514. integer taborder = 40
  1515. boolean bringtotop = true
  1516. end type
  1517. event selectionchanged;call super::selectionchanged;
  1518. cur_scid = THIS.uo_scid
  1519. cur_scid_arr = THIS.uo_scid_arr
  1520. IF sys_option_scid_msttake_mstpay = 1 THEN
  1521. PARENT.TriggerEvent('retrieve_pageretr')
  1522. END IF
  1523. cb_retrieve.TriggerEvent(Clicked!)
  1524. end event
  1525. event constructor;call super::constructor;cur_scid = THIS.uo_scid
  1526. cur_scid_arr = THIS.uo_scid_arr
  1527. this.text='[0]总部'
  1528. end event
  1529. type cb_autofinish from uo_imflatbutton within w_mustpay
  1530. integer x = 1152
  1531. integer width = 192
  1532. integer height = 164
  1533. integer taborder = 50
  1534. boolean bringtotop = true
  1535. string text = "对单&F"
  1536. string normalpicname = "update.bmp"
  1537. integer picsize = 16
  1538. toolbaralignment pic_align = alignattop!
  1539. boolean border = false
  1540. end type
  1541. event clicked;call super::clicked;parent.triggerevent('ue_buybill_auto')
  1542. end event
  1543. type cb_4 from uo_imflatbutton within w_mustpay
  1544. boolean visible = false
  1545. integer x = 1152
  1546. integer width = 192
  1547. integer height = 164
  1548. integer taborder = 30
  1549. boolean bringtotop = true
  1550. string text = "查单据"
  1551. string normalpicname = "find2.bmp"
  1552. integer picsize = 16
  1553. toolbaralignment pic_align = alignattop!
  1554. boolean border = false
  1555. end type
  1556. event clicked;call super::clicked;parent.triggerevent('ue_view_bill')
  1557. end event
  1558. type ddlb_2 from dropdownlistbox within w_mustpay
  1559. integer x = 1714
  1560. integer y = 292
  1561. integer width = 507
  1562. integer height = 284
  1563. integer taborder = 40
  1564. boolean bringtotop = true
  1565. integer textsize = -9
  1566. integer weight = 400
  1567. fontcharset fontcharset = gb2312charset!
  1568. fontpitch fontpitch = variable!
  1569. string facename = "宋体"
  1570. long textcolor = 33554432
  1571. string text = "[全部]"
  1572. boolean sorted = false
  1573. string item[] = {"未结清","已结清","[全部]"}
  1574. borderstyle borderstyle = stylelowered!
  1575. end type
  1576. event selectionchanged;IF Index = 1 THEN
  1577. finishflag = 0
  1578. ELSEIF Index = 2 THEN
  1579. finishflag = 1
  1580. ELSEIF Index = 3 THEN
  1581. finishflag = -1
  1582. END IF
  1583. cb_retrieve.TriggerEvent(Clicked!)
  1584. end event
  1585. type cb_reset from uo_imflatbutton within w_mustpay
  1586. boolean visible = false
  1587. integer x = 1344
  1588. integer width = 242
  1589. integer height = 164
  1590. integer taborder = 60
  1591. boolean bringtotop = true
  1592. string text = "支出单&S"
  1593. string normalpicname = "update.bmp"
  1594. integer picsize = 16
  1595. toolbaralignment pic_align = alignattop!
  1596. boolean border = false
  1597. end type
  1598. event clicked;call super::clicked;if not f_power_ind(639) then
  1599. messagebox('提示','你没有使用权限!',information!,ok!)
  1600. return
  1601. end if
  1602. if cur_id <= 0 then
  1603. messagebox('提示','请选择供应商',information!,ok!)
  1604. return
  1605. end if
  1606. if cur_scid < 0 then
  1607. messagebox('提示','请选择分部',information!,ok!)
  1608. return
  1609. end if
  1610. s_edit_index_tran s_open_tran
  1611. s_open_tran.b_long=cur_id
  1612. s_open_tran.b_string = ''
  1613. s_open_tran.b_decimal = 0
  1614. s_open_tran.c_long = cur_scid
  1615. openwithparm(w_buybill,s_open_tran)
  1616. wf_refresh_balc()
  1617. parent.triggerevent('retrieve_pay')
  1618. end event
  1619. type st_6 from statictext within w_mustpay
  1620. integer x = 1559
  1621. integer y = 212
  1622. integer width = 133
  1623. integer height = 48
  1624. boolean bringtotop = true
  1625. integer textsize = -9
  1626. integer weight = 400
  1627. fontcharset fontcharset = gb2312charset!
  1628. fontpitch fontpitch = variable!
  1629. string facename = "宋体"
  1630. long textcolor = 33554432
  1631. long backcolor = 134217739
  1632. string text = "币种"
  1633. alignment alignment = center!
  1634. boolean focusrectangle = false
  1635. end type
  1636. type ddlb_3 from dropdownlistbox within w_mustpay
  1637. integer x = 1714
  1638. integer y = 192
  1639. integer width = 507
  1640. integer height = 380
  1641. integer taborder = 50
  1642. boolean bringtotop = true
  1643. integer textsize = -9
  1644. integer weight = 400
  1645. fontcharset fontcharset = gb2312charset!
  1646. fontpitch fontpitch = variable!
  1647. string facename = "宋体"
  1648. long textcolor = 33554432
  1649. boolean sorted = false
  1650. borderstyle borderstyle = stylelowered!
  1651. end type
  1652. event constructor;Long ll_moneyid,i
  1653. String ls_name
  1654. DECLARE getmx CURSOR FOR
  1655. SELECT moneyid,Name FROM cw_currency Order By moneyid ;
  1656. OPEN getmx;
  1657. DO WHILE sqlca.SQLCode = 0
  1658. FETCH getmx INTO :ll_moneyid,:ls_name ;
  1659. IF sqlca.SQLCode <> 0 THEN EXIT
  1660. THIS.AddItem(ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']')
  1661. i++
  1662. if i=1 then
  1663. this.text=ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']'
  1664. ins_moneyid=ll_moneyid
  1665. end if
  1666. LOOP
  1667. CLOSE getmx;
  1668. THIS.AddItem('全部'+Fill(' ',50)+'['+String(-1)+']')
  1669. end event
  1670. event selectionchanged; ins_moneyid=Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
  1671. parent.triggerevent('retrieve_pageretr')
  1672. cb_retrieve.triggerevent(clicked!)
  1673. end event
  1674. type st_2 from statictext within w_mustpay
  1675. integer x = 1559
  1676. integer y = 308
  1677. integer width = 133
  1678. integer height = 48
  1679. boolean bringtotop = true
  1680. integer textsize = -9
  1681. integer weight = 400
  1682. fontcharset fontcharset = gb2312charset!
  1683. fontpitch fontpitch = variable!
  1684. string facename = "宋体"
  1685. long textcolor = 33554432
  1686. long backcolor = 134217739
  1687. string text = "状态"
  1688. alignment alignment = center!
  1689. boolean focusrectangle = false
  1690. end type
  1691. type st_5 from statictext within w_mustpay
  1692. integer x = 210
  1693. integer y = 304
  1694. integer width = 133
  1695. integer height = 48
  1696. boolean bringtotop = true
  1697. integer textsize = -9
  1698. integer weight = 400
  1699. fontcharset fontcharset = gb2312charset!
  1700. fontpitch fontpitch = variable!
  1701. string facename = "宋体"
  1702. long textcolor = 33554432
  1703. long backcolor = 134217739
  1704. string text = "分部"
  1705. alignment alignment = right!
  1706. boolean focusrectangle = false
  1707. end type
  1708. type cb_1 from uo_imflatbutton within w_mustpay
  1709. integer x = 878
  1710. integer width = 274
  1711. integer height = 164
  1712. integer taborder = 70
  1713. boolean bringtotop = true
  1714. string text = "辅助功能"
  1715. string normalpicname = "other.bmp"
  1716. integer picsize = 16
  1717. toolbaralignment pic_align = alignattop!
  1718. boolean border = false
  1719. end type
  1720. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1721. String menustr
  1722. menustr = "Text=查单据~tEvent=ue_view_bill"
  1723. menustr = menustr + "|" + "Text=-"
  1724. menustr = menustr + "|" + "Text=对单~tEvent=ue_buybill_auto"
  1725. menustr = menustr + "|" + "Text=自动对单~tEvent=ue_buybill_auto_p"
  1726. menustr = menustr + "|" + "Text=-"
  1727. menustr = menustr + "|" + "Text=辅助建立供应商对数单~tEvent=ue_create_buybill"
  1728. menustr = menustr + "|" + "Text=辅助建立供应商付款单~tEvent=ue_create_sptamt"
  1729. menustr = menustr + "|" + "Text=辅助建立供应商费用单~tEvent=ue_create_reissue_spt"
  1730. IF Len(Trim(menustr)) <> 0 THEN
  1731. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1732. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1733. dmPopupMenu.mf_PopMenu()
  1734. DESTROY dmPopupMenu
  1735. END IF
  1736. end event
  1737. type cbx_all from checkbox within w_mustpay
  1738. integer y = 300
  1739. integer width = 229
  1740. integer height = 60
  1741. boolean bringtotop = true
  1742. integer textsize = -9
  1743. integer weight = 400
  1744. fontcharset fontcharset = gb2312charset!
  1745. fontpitch fontpitch = variable!
  1746. string facename = "宋体"
  1747. long textcolor = 33554432
  1748. long backcolor = 134217739
  1749. string text = "全选"
  1750. end type
  1751. event clicked;Long i
  1752. dw_pageretr.SetRedraw(FALSE)
  1753. IF THIS.Checked THEN
  1754. FOR i = 1 TO dw_pageretr.RowCount()
  1755. dw_pageretr.Object.ch[i] = 1
  1756. NEXT
  1757. ELSE
  1758. FOR i = 1 TO dw_pageretr.RowCount()
  1759. dw_pageretr.Object.ch[i] = 0
  1760. NEXT
  1761. END IF
  1762. dw_pageretr.SetRedraw(TRUE)
  1763. end event
  1764. type pb_em1 from picturebutton within w_mustpay
  1765. integer x = 2802
  1766. integer y = 276
  1767. integer width = 101
  1768. integer height = 92
  1769. integer taborder = 30
  1770. boolean bringtotop = true
  1771. integer textsize = -9
  1772. integer weight = 400
  1773. fontcharset fontcharset = gb2312charset!
  1774. fontpitch fontpitch = variable!
  1775. string facename = "宋体"
  1776. string picturename = "date.BMP"
  1777. alignment htextalign = left!
  1778. end type
  1779. event clicked;em_firstday.triggerevent(rbuttondown!)
  1780. end event
  1781. type pb_em2 from picturebutton within w_mustpay
  1782. integer x = 3392
  1783. integer y = 276
  1784. integer width = 101
  1785. integer height = 92
  1786. integer taborder = 40
  1787. boolean bringtotop = true
  1788. integer textsize = -9
  1789. integer weight = 400
  1790. fontcharset fontcharset = gb2312charset!
  1791. fontpitch fontpitch = variable!
  1792. string facename = "宋体"
  1793. string picturename = "date.BMP"
  1794. alignment htextalign = left!
  1795. end type
  1796. event clicked;em_endday.triggerevent(rbuttondown!)
  1797. end event
  1798. type pb_2 from picturebutton within w_mustpay
  1799. integer x = 3493
  1800. integer y = 276
  1801. integer width = 101
  1802. integer height = 92
  1803. integer taborder = 50
  1804. boolean bringtotop = true
  1805. integer textsize = -9
  1806. integer weight = 400
  1807. fontcharset fontcharset = gb2312charset!
  1808. fontpitch fontpitch = variable!
  1809. string facename = "宋体"
  1810. string picturename = "date1.BMP"
  1811. alignment htextalign = left!
  1812. end type
  1813. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1814. string menustr
  1815. menustr="Text=本日~tEvent=ue_date1"
  1816. menustr = menustr + "|" + "Text=本周~tEvent=ue_date2"
  1817. menustr = menustr + "|" + "Text=本月~tEvent=ue_date3"
  1818. menustr = menustr + "|" + "Text=上月~tEvent=ue_date4"
  1819. if len(trim(menustr))<>0 then
  1820. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1821. dmPopupMenu.mf_BuildMenu(This, menustr)
  1822. dmPopupMenu.mf_PopMenu()
  1823. Destroy dmPopupMenu
  1824. end if
  1825. end event
  1826. type cb_pay from uo_imflatbutton within w_mustpay
  1827. integer x = 690
  1828. integer width = 192
  1829. integer height = 164
  1830. integer taborder = 70
  1831. boolean bringtotop = true
  1832. string text = "付款&A"
  1833. string normalpicname = "audit.bmp"
  1834. integer picsize = 16
  1835. toolbaralignment pic_align = alignattop!
  1836. boolean border = false
  1837. end type
  1838. event clicked;call super::clicked;parent.triggerevent('ue_pay')
  1839. end event
  1840. type st_payamt from statictext within w_mustpay
  1841. integer x = 2674
  1842. integer y = 20
  1843. integer width = 562
  1844. integer height = 60
  1845. boolean bringtotop = true
  1846. integer textsize = -9
  1847. integer weight = 400
  1848. fontcharset fontcharset = gb2312charset!
  1849. fontpitch fontpitch = variable!
  1850. string facename = "宋体"
  1851. string text = "已付金额:12345678.90"
  1852. boolean focusrectangle = false
  1853. end type
  1854. event constructor;this.backcolor = 14215660
  1855. end event
  1856. type st_mstpayamt from statictext within w_mustpay
  1857. integer x = 2098
  1858. integer y = 20
  1859. integer width = 562
  1860. integer height = 60
  1861. boolean bringtotop = true
  1862. integer textsize = -9
  1863. integer weight = 400
  1864. fontcharset fontcharset = gb2312charset!
  1865. fontpitch fontpitch = variable!
  1866. string facename = "宋体"
  1867. string text = "应付金额:12345678.90"
  1868. boolean focusrectangle = false
  1869. end type
  1870. event constructor;this.backcolor = 14215660
  1871. end event
  1872. type st_balcamt from statictext within w_mustpay
  1873. integer x = 2103
  1874. integer y = 96
  1875. integer width = 869
  1876. integer height = 60
  1877. boolean bringtotop = true
  1878. integer textsize = -9
  1879. integer weight = 700
  1880. fontcharset fontcharset = gb2312charset!
  1881. fontpitch fontpitch = variable!
  1882. string facename = "宋体"
  1883. string text = "结余金额:12345678.90"
  1884. boolean focusrectangle = false
  1885. end type
  1886. event constructor;this.backcolor = 14215660
  1887. end event
  1888. type ln_bar from line within w_mustpay
  1889. long linecolor = 268435456
  1890. integer linethickness = 4
  1891. integer beginy = 176
  1892. integer endx = 3429
  1893. integer endy = 176
  1894. end type
  1895. type ln_bar2 from line within w_mustpay
  1896. long linecolor = 16777215
  1897. integer linethickness = 4
  1898. integer beginy = 180
  1899. integer endx = 3429
  1900. integer endy = 180
  1901. end type
  1902. type r_bar from rectangle within w_mustpay
  1903. long linecolor = 16777215
  1904. long fillcolor = 1073741824
  1905. integer x = 3200
  1906. integer width = 73
  1907. integer height = 172
  1908. end type
  1909. event constructor;this.fillcolor = 14215660
  1910. this.linecolor = 14215660
  1911. this.x = -1
  1912. this.y = -1
  1913. this.height = ln_bar2.beginy - 5
  1914. end event
  1915. type ln_1 from line within w_mustpay
  1916. long linecolor = 268435456
  1917. integer linethickness = 4
  1918. integer beginy = 380
  1919. integer endx = 3429
  1920. integer endy = 380
  1921. end type
  1922. type ln_2 from line within w_mustpay
  1923. long linecolor = 16777215
  1924. integer linethickness = 4
  1925. integer beginy = 380
  1926. integer endx = 3429
  1927. integer endy = 380
  1928. end type
  1929. type ln_5 from line within w_mustpay
  1930. long linecolor = 268435456
  1931. integer beginx = 1522
  1932. integer endx = 1522
  1933. integer endy = 176
  1934. end type
  1935. type ln_6 from line within w_mustpay
  1936. long linecolor = 16777215
  1937. integer beginx = 1527
  1938. integer endx = 1527
  1939. integer endy = 180
  1940. end type
  1941. type ln_3 from line within w_mustpay
  1942. long linecolor = 16777215
  1943. integer linethickness = 4
  1944. integer beginx = 1527
  1945. integer beginy = 176
  1946. integer endx = 1527
  1947. integer endy = 380
  1948. end type
  1949. type ln_4 from line within w_mustpay
  1950. long linecolor = 268435456
  1951. integer linethickness = 4
  1952. integer beginx = 1522
  1953. integer beginy = 176
  1954. integer endx = 1522
  1955. integer endy = 380
  1956. end type
  1957. type st_amtdisp from statictext within w_mustpay
  1958. integer x = 2085
  1959. integer y = 12
  1960. integer width = 1157
  1961. integer height = 160
  1962. integer textsize = -9
  1963. integer weight = 400
  1964. fontcharset fontcharset = gb2312charset!
  1965. fontpitch fontpitch = variable!
  1966. string facename = "宋体"
  1967. long textcolor = 33554432
  1968. boolean border = true
  1969. boolean focusrectangle = false
  1970. end type
  1971. event constructor;this.backcolor = 14215660
  1972. end event
  1973. type cbx_1 from checkbox within w_mustpay
  1974. integer x = 2240
  1975. integer y = 204
  1976. integer width = 229
  1977. integer height = 60
  1978. boolean bringtotop = true
  1979. integer textsize = -9
  1980. integer weight = 400
  1981. fontcharset fontcharset = gb2312charset!
  1982. fontpitch fontpitch = variable!
  1983. string facename = "宋体"
  1984. long textcolor = 33554432
  1985. long backcolor = 134217739
  1986. string text = "全选"
  1987. end type
  1988. event clicked;Long i
  1989. dw_mstpay.SetRedraw(FALSE)
  1990. IF THIS.Checked THEN
  1991. FOR i = 1 TO dw_mstpay.RowCount()
  1992. IF dw_mstpay.Object.finishflag[i]=0 then
  1993. dw_mstpay.Object.checkdata[i] = 1
  1994. end if
  1995. NEXT
  1996. ELSE
  1997. FOR i = 1 TO dw_mstpay.RowCount()
  1998. dw_mstpay.Object.checkdata[i] = 0
  1999. NEXT
  2000. END IF
  2001. dw_mstpay.SetRedraw(TRUE)
  2002. end event