12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180 |
- $PBExportHeader$w_warebalc_view_new_bk.srw
- forward
- global type w_warebalc_view_new_bk from w_publ_easyq
- end type
- type tv_1 from uo_tv_mtrltype within w_warebalc_view_new_bk
- end type
- type st_2 from statictext within w_warebalc_view_new_bk
- end type
- type ddlb_storageid from uo_ddlb_storageid within w_warebalc_view_new_bk
- end type
- type cbx_1 from checkbox within w_warebalc_view_new_bk
- end type
- type cbx_inout from checkbox within w_warebalc_view_new_bk
- end type
- type tab_1 from tab within w_warebalc_view_new_bk
- end type
- type tabpage_1 from userobject within tab_1
- end type
- type dw_inout from u_dw_rbtnfilter within tabpage_1
- end type
- type em_3 from editmask within tabpage_1
- end type
- type em_4 from editmask within tabpage_1
- end type
- type cb_iomx_retrieve from uo_imflatbutton within tabpage_1
- end type
- type ddlb_billtype from dropdownlistbox within tabpage_1
- end type
- type st_7 from statictext within tabpage_1
- end type
- type st_6 from statictext within tabpage_1
- end type
- type tabpage_1 from userobject within tab_1
- dw_inout dw_inout
- em_3 em_3
- em_4 em_4
- cb_iomx_retrieve cb_iomx_retrieve
- ddlb_billtype ddlb_billtype
- st_7 st_7
- st_6 st_6
- end type
- type tabpage_2 from userobject within tab_1
- end type
- type dw_out_noaudit from u_dw_rbtnfilter within tabpage_2
- end type
- type tabpage_2 from userobject within tab_1
- dw_out_noaudit dw_out_noaudit
- end type
- type tab_1 from tab within w_warebalc_view_new_bk
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- end type
- type cb_other from uo_imflatbutton within w_warebalc_view_new_bk
- end type
- type sle_usual_query from u_sleedit within w_warebalc_view_new_bk
- end type
- type st_8 from statictext within w_warebalc_view_new_bk
- end type
- type st_1 from statictext within w_warebalc_view_new_bk
- end type
- type em_month from editmask within w_warebalc_view_new_bk
- end type
- type st_lastbalcdate from statictext within w_warebalc_view_new_bk
- end type
- type ddlb_1 from dropdownlistbox within w_warebalc_view_new_bk
- end type
- type cb_balc from uo_imflatbutton within w_warebalc_view_new_bk
- end type
- end forward
- global type w_warebalc_view_new_bk from w_publ_easyq
- string title = "仓库结存表"
- event ue_retrieve_info ( )
- event retrieve_pageretr ( )
- event ue_mtrl_info ( )
- event ue_retrieve_inoutmx ( )
- event ue_usual_query_filt ( )
- event ue_usual_query_retr ( )
- event ue_cmp_mtrlware ( )
- event ue_cmp_amt2 ( )
- event ue_cmp ( )
- event ue_update_inware_mtrlwareid ( )
- tv_1 tv_1
- st_2 st_2
- ddlb_storageid ddlb_storageid
- cbx_1 cbx_1
- cbx_inout cbx_inout
- tab_1 tab_1
- cb_other cb_other
- sle_usual_query sle_usual_query
- st_8 st_8
- st_1 st_1
- em_month em_month
- st_lastbalcdate st_lastbalcdate
- ddlb_1 ddlb_1
- cb_balc cb_balc
- end type
- global w_warebalc_view_new_bk w_warebalc_view_new_bk
- type variables
- Long cur_storageid = -1
- Long cur_storageid_arr[]
- DateTime balcdate //结存日期
- Int cur_mtrlorigin = -1 //当前显示物料来源
- String ls_handtype = ''
- string ls_mtrltype = ''
- long ins_if_info = 0
- integer cur_billtype_in = -1
- integer cur_billtype_out = -1
- end variables
- forward prototypes
- public subroutine wf_hidecol ()
- public function window getparentwindow ()
- end prototypes
- event ue_retrieve_info();if ddlb_1.text = '分类统计表' then return
- Long ll_row
- Long ll_mtrlid
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- ll_mtrlid = 0
- ELSE
- ll_mtrlid = dw_1.Object.u_mtrldef_mtrlid[ll_row]
- END IF
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- END IF
- end event
- event retrieve_pageretr();
- Int rtr_zeronoallocqty
- IF cbx_1.Checked THEN
- rtr_zeronoallocqty = -1
- ELSE
- rtr_zeronoallocqty = 0
- END IF
- dw_1.Retrieve(cur_storageid_arr,ls_handtype,ls_mtrltype,cur_mtrlorigin,publ_operator)
- IF dw_1.RowCount() > 0 AND dw_1.GetRow() = 0 THEN dw_1.SetRow(1)
- //查询最后结存日期
- DateTime ldt_lastbalcdate
- SELECT max( balcdate)
- INTO :ldt_lastbalcdate
- FROM u_warebalc
- WHERE (storageid = :cur_storageid OR :cur_storageid = -1)
- And balcdateint <> 0;
- IF sqlca.SQLCode <> 0 THEN
- SetNull(ldt_lastbalcdate)
- END IF
- IF IsNull(ldt_lastbalcdate) THEN
- st_lastbalcdate.Text = '没有结存记录'
- ELSE
- st_lastbalcdate.Text = '最后结存日期:'+String(ldt_lastbalcdate, 'yyyy-mm-dd')
- END IF
- SetPointer(Arrow!)
- end event
- event ue_mtrl_info();if ddlb_1.text = '分类统计表' then return
- Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('提示','请选择物料',information!,OK!)
- RETURN
- END IF
- Long ll_mtrlid
- ll_mtrlid = dw_1.Object.u_mtrldef_mtrlid[ll_row]
- IF IsValid(w_mtrl_info) THEN
- w_mtrl_info.WindowState = Normal!
- w_mtrl_info.ins_mtrlid = ll_mtrlid
- w_mtrl_info.wf_retrieve(ll_mtrlid)
- ELSE
- OpenWithParm(w_mtrl_info,ll_mtrlid)
- END IF
- end event
- event ue_retrieve_inoutmx();//Long ll_row
- //Long ll_storageid,ll_mtrlid, ll_mtrlwareid
- //String ls_status,ls_woodcode,ls_pcode
- //String ls_plancode,ls_mtrlcuscode,ls_location
- //Long ll_sptid
- //DateTime ld_fdate,ld_edate,ld_showsale_data
- //Int li_storagetype
- //
- //ll_row = dw_1.GetRow()
- //
- //
- //tab_1.tabpage_1.dw_inout.setredraw(false)
- //tab_1.tabpage_1.dw_inout.setfilter('')
- //tab_1.tabpage_1.dw_inout.filter()
- //
- //tab_1.tabpage_2.dw_out_noaudit.setredraw(false)
- //tab_1.tabpage_2.dw_out_noaudit.setfilter('')
- //tab_1.tabpage_2.dw_out_noaudit.filter()
- //
- //IF ll_row <= 0 THEN
- // tab_1.tabpage_1.dw_inout.Reset()
- // tab_1.tabpage_2.dw_out_noaudit.Reset()
- //ELSE
- // ld_fdate = DateTime(Date(tab_1.tabpage_1.em_3.Text),Time(0))
- // ld_edate = DateTime(Date(tab_1.tabpage_1.em_4.Text),Time('23:59:59'))
- //
- // IF ld_fdate < sys_showsaledata_mindt THEN
- // ld_showsale_data = sys_showsaledata_mindt
- // ELSE
- // ld_showsale_data = ld_fdate
- // END IF
- //
- // ll_mtrlwareid = dw_1.Object.u_mtrlware_mtrlwareid[ll_row]
- // ll_storageid = dw_1.Object.u_mtrlware_storageid[ll_row]
- // ll_mtrlid = dw_1.Object.u_mtrldef_mtrlid[ll_row]
- // ls_status = dw_1.Object.u_mtrlware_status[ll_row]
- // ls_woodcode = dw_1.Object.u_mtrlware_woodcode[ll_row]
- // ls_pcode = dw_1.Object.u_mtrlware_pcode[ll_row]
- // ls_plancode = dw_1.Object.u_mtrlware_plancode[ll_row]
- // ll_sptid = dw_1.Object.u_mtrlware_sptid[ll_row]
- //
- // tab_1.tabpage_1.dw_inout.Retrieve(ll_storageid,ll_mtrlid,ld_fdate,ld_edate,ls_status,ls_woodcode,ls_pcode,ld_showsale_data,ls_plancode,ll_sptid, cur_billtype_in, cur_billtype_out)
- // tab_1.tabpage_2.dw_out_noaudit.Retrieve(ll_mtrlwareid)
- //END IF
- tab_1.tabpage_1.dw_inout.setredraw(true)
- tab_1.tabpage_2.dw_out_noaudit.setredraw(true)
- end event
- event ue_usual_query_filt();String obj_expr = ''
- IF ddlb_1.Text = '明细统计表' or ddlb_1.text='汇总统计表' THEN
-
- IF Trim(sle_usual_query.Text) <> '' THEN
- IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- obj_expr = obj_expr+' ( u_mtrldef_mtrlcode LIKE "%'+Trim(sle_usual_query.Text)+'%") '
- obj_expr = obj_expr+' or ( u_mtrldef_mtrlname LIKE "%'+Trim(sle_usual_query.Text)+'%") '
- ELSE
- obj_expr = obj_expr+' ( u_mtrldef_mtrlcode LIKE "'+Trim(sle_usual_query.Text)+'") '
- obj_expr = obj_expr+' or ( u_mtrldef_mtrlname LIKE "'+Trim(sle_usual_query.Text)+'") '
- END IF
- END IF
- ELSE
- IF Trim(sle_usual_query.Text) <> '' THEN
- IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- obj_expr = obj_expr+' ( u_mtrltype_mtrltype LIKE "%'+Trim(sle_usual_query.Text)+'%") '
- ELSE
- obj_expr = obj_expr+' ( u_mtrltype_mtrltype LIKE "'+Trim(sle_usual_query.Text)+'") '
- END IF
- END IF
- END IF
- dw_1.SetFilter(obj_expr)
- dw_1.SetRedraw(FALSE)
- dw_1.Filter()
- IF dw_1.RowCount() >= 1 THEN
- dw_1.SelectRow(0,FALSE)
- dw_1.SelectRow(1,TRUE)
- END IF
- dw_1.SetRedraw(TRUE)
- end event
- event ue_usual_query_retr();//String ls_querystrpart = ''
- //ls_newselect = Lower(ori_oldselect)
- //IF Trim(sle_usual_query.Text) <> '' THEN
- // IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- // ls_querystrpart = ls_querystrpart + "u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
- // ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
- // ELSE
- // ls_querystrpart = ls_querystrpart + " (u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
- // ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '"+Trim(sle_usual_query.Text)+"')"
- // END IF
- //
- // IF Pos(ls_newselect," where ") <> 0 THEN
- // ls_newselect = ls_newselect+" AND ("+ls_querystrpart+')'
- // ELSE
- // ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
- // END IF
- //END IF
- //wf_retrieveuc(dw_pageretr,ls_newselect,1)
- //THIS.TriggerEvent('retrieve_pageretr')
- //
- end event
- event ue_cmp_mtrlware();//按库存数重算本期期初
- IF Not f_power_ind(1507) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- //IF Not dw_pageretr.DataObject = 'dw_warebalc_view' THEN
- // MessageBox('系统提示','必须在客户产品统计表中才能执行本功能')
- // RETURN
- //END IF
- IF MessageBox (publ_operator,"是否确定要执行按库存数重算结存功能?",Question!,YesNo! ) = 2 THEN RETURN
- IF cur_storageid = -1 THEN
- MessageBox('系统提示','请先选择仓库')
- RETURN
- END IF
- Long rslt = 1
- String arg_msg
- datastore ds_warebalc
- ds_warebalc = Create datastore
- ds_warebalc.DataObject = 'dw_warebalc_view'
- ds_warebalc.SetTransObject(sqlca)
- ds_warebalc.Retrieve(cur_storageid_arr,'','',-1,publ_operator)
- // //清空筛选内容
- //ds_warebalc.SetFilter('')
- //ds_warebalc.Filter()
- //ds_warebalc.Retrieve(cur_storageid_arr,'','',-1,publ_operator)
- Long ll_i
- Decimal ld_newcost // 最新成本价
- Decimal ld_bgqty,ld_bgamt,ld_incqty,ld_incamt,ld_desqty,ld_desamt
- Decimal ld_balcqty,ld_balcamt
- Long ll_mtrlid
- String ls_status,ls_pcode,ls_woodcode
- String ls_mtrlcode
- Decimal ld_noallocqty,ld_wareamt,ld_noallocaddqty
- Decimal ld_noallocqty_sum,ld_wareamt_sum,ld_noallocaddqty_sum,ld_incaddqty,ld_desaddqty
- Long ll_sptid_cusid,ll_sptid
- Open(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- //结存查库存
- w_sys_wait_jdt.wf_accepttol(ds_warebalc.RowCount())
- FOR ll_i = 1 To ds_warebalc.RowCount()
-
- ll_mtrlid = ds_warebalc.Object.u_mtrldef_mtrlid[ll_i]
- ls_mtrlcode = ds_warebalc.Object.u_mtrldef_mtrlcode[ll_i]
- ls_status = ds_warebalc.Object.u_warebalc_status[ll_i]
- ls_woodcode = ds_warebalc.Object.u_warebalc_woodcode[ll_i]
- ls_pcode = ds_warebalc.Object.u_warebalc_pcode[ll_i]
- ll_sptid_cusid = ds_warebalc.Object.u_warebalc_sptid_cusid[ll_i]
- w_sys_wait_jdt.st_msg.Text = " 正在结存重算:"+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+"..." //进度信息
- w_sys_wait_jdt.wf_inc(ll_i)
-
- SELECT isnull(sum(noallocqty),0),
- isnull(sum(wareamt),0),
- isnull(sum(noallocaddqty),0)
- INTO :ld_noallocqty,
- :ld_wareamt,
- :ld_noallocaddqty
- FROM u_mtrlware
- WHERE mtrlid = :ll_mtrlid
- AND storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- And sptid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- IF sqlca.SQLCode = 100 THEN
- ld_noallocqty = 0
- ld_wareamt = 0
- ELSE
- rslt = 0
- arg_msg = '查询库存资料失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
- END IF
-
- UPDATE u_warebalc
- SET balcqty = :ld_noallocqty,
- balcaddqty = :ld_noallocaddqty,
- balcamt = :ld_wareamt,
- bgqty = :ld_noallocqty + desqty - incqty,
- bgamt = :ld_wareamt + desamt - incamt,
- bgaddqty = :ld_noallocaddqty + desaddqty - incaddqty
- WHERE mtrlid = :ll_mtrlid
- AND balcdateint = 0
- AND Storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- And sptid_cusid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
-
- END IF
-
- ld_noallocqty_sum += ld_noallocqty
- ld_wareamt_sum += ld_wareamt
- ld_noallocaddqty_sum += ld_noallocaddqty
- NEXT
- //库存计结存
- Long cnt,ll_scid
- datastore ds_mtrlware
- ds_mtrlware = Create datastore
- ds_mtrlware.DataObject = 'ds_warebalc_view_cmpl_mtrlware_to_balc'
- ds_mtrlware.SetTransObject(sqlca)
- ds_mtrlware.Retrieve(cur_storageid)
- ds_mtrlware.AcceptText()
- IF ld_noallocqty_sum <> ds_mtrlware.Object.sumqty[1] Or &
- ld_wareamt_sum <> ds_mtrlware.Object.sumamt[1] Or &
- ld_noallocaddqty_sum <> ds_mtrlware.Object.sumaddqty[1] THEN
-
- SELECT scid INTO :ll_scid
- FROM u_storage
- Where storageid = :cur_storageid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询仓库所属分部失败,操作取消'
- GOTO ext
- END IF
-
- w_sys_wait_jdt.wf_accepttol(ds_mtrlware.RowCount())
-
- FOR ll_i = 1 To ds_mtrlware.RowCount()
- ll_mtrlid = 0
- ls_mtrlcode = ''
- ls_status = ''
- ls_woodcode = ''
- ls_pcode = ''
- ld_noallocqty = 0
- ld_wareamt = 0
- ll_sptid = 0
- cnt = 0
-
- ls_mtrlcode = ds_mtrlware.Object.u_mtrldef_mtrlcode[ll_i]
- ll_mtrlid = ds_mtrlware.Object.mtrlid[ll_i]
-
- ls_status = ds_mtrlware.Object.status[ll_i]
- ls_woodcode = ds_mtrlware.Object.woodcode[ll_i]
- ls_pcode = ds_mtrlware.Object.pcode[ll_i]
- ld_noallocqty = ds_mtrlware.Object.qty[ll_i]
- ld_noallocaddqty = ds_mtrlware.Object.addqty[ll_i]
- ld_wareamt = ds_mtrlware.Object.amt[ll_i]
- ll_sptid = ds_mtrlware.Object.u_mtrlware_sptid[ll_i]
-
- w_sys_wait_jdt.st_msg.Text = " 正在库存重算:"+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+"..." //进度信息
- w_sys_wait_jdt.wf_inc(ll_i)
-
-
- SELECT count(*) INTO :cnt
- FROM u_warebalc
- WHERE mtrlid = :ll_mtrlid
- AND balcdateint = 0
- AND Storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- And sptid_cusid = :ll_sptid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
-
- IF cnt > 0 THEN CONTINUE
-
- SELECT CASE when sum(Round(u_inwaremx.qty * u_inwaremx.cost,2)) Is Null THEN 0 ELSE sum(Round(u_inwaremx.qty * u_inwaremx.cost,2)) END ,
- CASE when sum(u_inwaremx.qty) Is Null THEN 0 ELSE sum(u_inwaremx.qty) END,
- CASE when sum(u_inwaremx.addqty) Is Null THEN 0 ELSE sum(u_inwaremx.addqty) END
- Into :ld_incamt,:ld_incqty,:ld_incaddqty
- From u_inwaremx,u_inware
- Where u_inwaremx.scid = u_inware.scid
- And u_inwaremx.inwareid = u_inware.inwareid
- And u_inware.storageid = :cur_storageid
- And u_inware.balcdateint = 0
- And u_inwaremx.mtrlid = :ll_mtrlid
- And u_inwaremx.status = :ls_status
- And u_inwaremx.woodcode = :ls_woodcode
- And u_inwaremx.pcode = :ls_pcode
- And u_inwaremx.sptid_cusid = :ll_sptid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询进仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
-
- SELECT CASE when sum(u_outwaremx.costamt) Is Null THEN 0 ELSE sum(u_outwaremx.costamt) END ,
- CASE when sum(u_outwaremx.qty) Is Null THEN 0 ELSE sum(u_outwaremx.qty) END ,
- CASE when sum(u_outwaremx.addqty) Is Null THEN 0 ELSE sum(u_outwaremx.addqty) END
- Into :ld_desamt,:ld_desqty,:ld_desaddqty
- From u_outwaremx,u_outware
- Where u_outwaremx.scid = u_outware.scid
- And u_outwaremx.outwareid = u_outware.outwareid
- And u_outware.storageid = :cur_storageid
- And u_outware.balcdateint = 0
- And u_outwaremx.mtrlid = :ll_mtrlid
- And u_outwaremx.status = :ls_status
- And u_outwaremx.woodcode = :ls_woodcode
- And u_outwaremx.pcode = :ls_pcode
- And u_outwaremx.sptid = :ll_sptid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询出仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
-
- INSERT INTO u_warebalc
- (scid,
- balcdateint,
- storageid,
- mtrlid,
- status,
- woodcode,
- pcode,
- bgqty,
- bgamt,
- incqty,
- incamt,
- desqty,
- desamt,
- balcqty,
- balcamt,
- sptid_cusid,
- bgaddqty,
- balcaddqty,
- incaddqty,
- desaddqty
- )
- VALUES
- (:ll_scid,0,
- :cur_storageid,
- :ll_mtrlid,
- :ls_status,
- :ls_woodcode,
- :ls_pcode,
- :ld_noallocqty + :ld_desqty - :ld_incqty,
- :ld_wareamt + :ld_desamt - :ld_incamt,
- :ld_incqty,
- :ld_incamt,
- :ld_desqty,
- :ld_desamt,
- :ld_noallocqty,
- :ld_wareamt,
- :ll_sptid,
- :ld_noallocaddqty + :ld_desaddqty - :ld_incaddqty,
- :ld_noallocaddqty,
- :ld_incqty,
- :ld_desaddqty);
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '新加结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
- NEXT
- END IF
- //CLOSE(w_sys_wait_jdt)
- //COMMIT;
- //MessageBox('系统提示','重算成功!')
- //THIS.TriggerEvent('retrieve_pageretr')
- ext:
- Destroy ds_warebalc
- Destroy ds_mtrlware
- Close(w_sys_wait_jdt)
- IF rslt = 0 THEN
- ROLLBACK;
- MessageBox('Error',arg_msg)
- RETURN
- ELSE
- COMMIT;
- MessageBox('系统提示','重算成功!')
- This.TriggerEvent('retrieve_pageretr')
- END IF
- end event
- event ue_cmp_amt2();//按上期结存重算本期结余
- IF Not f_power_ind(1507) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- //IF Not dw_pageretr.DataObject = 'dw_warebalc_view' THEN
- // MessageBox('系统提示','必须在客户产品统计表中才能执行本功能')
- // RETURN
- //END IF
- IF cur_storageid = -1 THEN
- MessageBox('系统提示','请先选择仓库')
- RETURN
- END IF
- Long rslt = 1
- String arg_msg
- Long cnt
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_mtrlware
- WHERE u_mtrlware.storageid = :cur_storageid
- AND ( u_mtrlware.plancode <> '' OR sptid <> 0 )
- AND u_mtrlware.noallocqty <> 0
- And u_mtrlware.mtrlid In (SELECT mtrlid From u_warebalc Where storageid = :cur_storageid And balcdateint = 0);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','查询仓库物料使用了批号库存失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF cnt > 0 THEN
- MessageBox('系统提示','仓库物料使用了批号库存,不能重算')
- RETURN
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_outware,u_outwaremx
- WHERE u_outware.storageid = :cur_storageid
- AND u_outware.scid = u_outwaremx.scid
- AND u_outware.outwareid = u_outwaremx.outwareid
- AND u_outware.flag = 1
- AND u_outware.balcdateint = 0
- AND u_outwaremx.plancode <> ''
- And u_outwaremx.mtrlid In (SELECT mtrlid From u_warebalc Where storageid = :cur_storageid And balcdateint = 0);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','查询仓库物料出仓使用了批号库存失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF cnt > 0 THEN
- MessageBox('系统提示','仓库物料出仓使用了批号库存,不能重算')
- RETURN
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_inware,u_inwaremx
- WHERE u_inware.storageid = :cur_storageid
- AND u_inware.scid = u_inwaremx.scid
- AND u_inware.inwareid = u_inwaremx.inwareid
- AND u_inware.flag = 1
- AND u_inware.balcdateint = 0
- AND u_inwaremx.plancode <> ''
- And u_inwaremx.mtrlid In (SELECT mtrlid From u_warebalc Where storageid = :cur_storageid And balcdateint = 0);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','查询仓库物料进仓使用了批号库存失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF cnt > 0 THEN
- MessageBox('系统提示','仓库物料进仓使用了批号库存,不能重算')
- RETURN
- END IF
- IF MessageBox (publ_operator,"是否确定要执行按上期结存重算本期结余功能?",Question!,YesNo! ) = 2 THEN RETURN
- //IF cur_storageid = -1 THEN
- // MessageBox('系统提示','请先选择仓库')
- // RETURN
- //END IF
- datastore ds_warebalc
- ds_warebalc = Create datastore
- ds_warebalc.DataObject = 'dw_warebalc_view'
- ds_warebalc.SetTransObject(sqlca)
- ds_warebalc.Retrieve(cur_storageid_arr,'','',-1,publ_operator)
- // //清空筛选内容
- //ds_warebalc.SetFilter('')
- //ds_warebalc.Filter()
- //ds_warebalc.Retrieve(cur_storageid_arr,'','',cur_mtrlorigin,publ_operator)
- Long ll_lastbalcdateint
- Long ll_i
- Decimal ld_newcost // 最新成本价
- Decimal ld_balcqty_last,ld_balcamt_last,ld_inamt,ld_inqty,ld_outamt,ld_outqty
- Decimal ld_ubalcqty_last,ld_uinqty,ld_uoutqty
- Decimal ld_bgqty,ld_bgamt,ld_incqty,ld_incamt,ld_desqty,ld_desamt
- Decimal ld_balcqty,ld_balcamt
- Long ll_mtrlid
- String ls_status,ls_pcode,ls_woodcode
- String ls_mtrlcode,ls_msg
- Long ll_sptid_cusid
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_warebalc
- Where storageid = :cur_storageid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询历史结存失败,操作取消'
- GOTO ext
- END IF
- IF cnt > 0 THEN
- SELECT max(balcdateint) INTO :ll_lastbalcdateint
- FROM u_warebalc
- Where storageid = :cur_storageid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询上次结存失败,操作取消'
- GOTO ext
- END IF
- ELSE
- ll_lastbalcdateint = -1
- END IF
- UPDATE u_mtrlware
- SET noallocqty = 0,wareamt = 0
- Where storageid = : cur_storageid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '清除库存数量,金额失败,操作取消'
- GOTO ext
- END IF
- Open(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- w_sys_wait_jdt.wf_accepttol(ds_warebalc.RowCount())
- FOR ll_i = 1 To ds_warebalc.RowCount()
-
- ld_bgqty = ds_warebalc.Object.u_mtrldef_bgqty[ll_i]
- ld_bgamt = ds_warebalc.Object.u_mtrldef_bgamt[ll_i]
- ld_incqty = ds_warebalc.Object.u_mtrldef_incqty[ll_i]
- ld_incamt = ds_warebalc.Object.u_mtrldef_incamt[ll_i]
- ld_desqty = ds_warebalc.Object.u_mtrldef_desqty[ll_i]
- ld_desamt = ds_warebalc.Object.u_mtrldef_desamt[ll_i]
- ls_status = ds_warebalc.Object.u_warebalc_status[ll_i]
- ls_woodcode = ds_warebalc.Object.u_warebalc_woodcode[ll_i]
- ls_pcode = ds_warebalc.Object.u_warebalc_pcode[ll_i]
- ls_mtrlcode = ds_warebalc.Object.u_mtrldef_mtrlcode[ll_i]
- ll_mtrlid = ds_warebalc.Object.u_mtrldef_mtrlid[ll_i]
- ll_sptid_cusid = ds_warebalc.Object.u_warebalc_sptid_cusid[ll_i]
-
-
- // if ll_mtrlid = 9159 then
- // ll_mtrlid = 9159
- // end if
- w_sys_wait_jdt.st_msg.Text = " 正在重算:"+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+"..." //进度信息
- w_sys_wait_jdt.wf_inc(ll_i)
-
- IF IsNull(ld_bgqty) THEN ld_bgqty = 0
- IF IsNull(ld_incqty) THEN ld_incqty = 0
- IF IsNull(ld_bgamt) THEN ld_bgamt = 0
- IF IsNull(ld_incamt) THEN ld_incamt = 0
- IF IsNull(ld_desqty) THEN ld_desqty = 0
- IF IsNull(ld_desamt) THEN ld_desamt = 0
-
-
- //查期初
- IF ld_bgqty > 0 And ll_lastbalcdateint > 0 THEN
- SELECT balcqty,balcamt
- INTO :ld_balcqty_last,:ld_balcamt_last
- FROM u_warebalc
- WHERE storageid = :cur_storageid
- AND mtrlid = :ll_mtrlid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- AND balcdateint = :ll_lastbalcdateint
- And sptid_cusid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询上月结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
-
- IF ld_balcqty_last <> ld_bgqty THEN ld_bgqty = ld_balcqty_last
- IF ld_balcamt_last <> ld_bgamt THEN ld_bgamt = ld_balcamt_last
- ELSE
- ld_bgqty = 0
- ld_bgamt = 0
-
- END IF
-
- //查进仓
- SELECT isnull(sum(u_inwaremx.qty),0),isnull(sum(u_inwaremx.uqty),0),isnull(sum(round(u_inwaremx.cost * u_inwaremx.qty,2)),0)
- INTO :ld_inqty,:ld_uinqty,:ld_inamt
- FROM u_inware,u_inwaremx
- WHERE u_inware.scid = u_inwaremx.scid
- AND u_inware.inwareid = u_inwaremx.inwareid
- AND u_inwaremx.mtrlid = :ll_mtrlid
- AND u_inwaremx.status = :ls_status
- AND u_inwaremx.woodcode = :ls_woodcode
- AND u_inwaremx.pcode = :ls_pcode
- AND u_inware.storageid = :cur_storageid
- AND u_inware.balcdateint = 0
- AND u_inware.flag = 1
- And u_inwaremx.sptid_cusid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询本月进仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
-
- IF ld_incqty <> ld_inqty THEN ld_incqty = ld_inqty
- IF ld_incamt <> ld_inamt THEN ld_incamt = ld_inamt
-
-
-
-
- //查出仓
- SELECT isnull(sum(u_outwaremx.qty),0),isnull(sum(u_outwaremx.uqty),0),isnull(sum(round(u_outwaremx.costamt,2)),0)
- INTO :ld_outqty,:ld_uoutqty,:ld_outamt
- FROM u_outware,u_outwaremx
- WHERE u_outware.scid = u_outwaremx.scid
- AND u_outware.outwareid = u_outwaremx.outwareid
- AND u_outwaremx.mtrlid = :ll_mtrlid
- AND u_outwaremx.status = :ls_status
- AND u_outwaremx.woodcode = :ls_woodcode
- AND u_outwaremx.pcode = :ls_pcode
- AND u_outware.storageid = :cur_storageid
- AND u_outware.balcdateint = 0
- AND u_outware.flag = 1
- And u_outwaremx.sptid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询本月出仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
-
- IF ld_desqty <> ld_outqty THEN ld_desqty = ld_outqty
- IF ld_desamt <> ld_outamt THEN ld_desamt = ld_outamt
-
-
-
- IF IsNull(ld_bgqty) THEN ld_bgqty = 0
- IF IsNull(ld_bgamt) THEN ld_bgamt = 0
- IF IsNull(ld_incqty) THEN ld_incqty = 0
- IF IsNull(ld_incamt) THEN ld_incamt = 0
- IF IsNull(ld_desqty) THEN ld_desqty = 0
- IF IsNull(ld_desamt) THEN ld_desamt = 0
-
-
- IF ld_bgqty + ld_incqty <> 0 THEN
- ld_newcost = Round((ld_bgamt + ld_incamt) / (ld_bgqty + ld_incqty),10)
- ELSE
- IF ld_desqty <> 0 THEN
- ld_newcost = Round(ld_desamt / ld_desqty, 10)
- ELSE
- ld_newcost = 0
- END IF
- END IF
-
- IF ld_newcost < 0 THEN ld_newcost = 0
-
- //更新期间出金额,结存金额
- UPDATE u_warebalc
- SET bgqty = :ld_bgqty,
- bgamt = :ld_bgamt,
- incqty = :ld_incqty,
- incamt = :ld_incamt,
- desqty = :ld_desqty,
- desamt = round(:ld_desqty * :ld_newcost,2),
- balcqty = :ld_bgqty + :ld_incqty - :ld_desqty,
- balcamt = round((:ld_bgqty + :ld_incqty - :ld_desqty) * :ld_newcost,2)
- WHERE mtrlid = :ll_mtrlid
- AND balcdateint = 0
- AND Storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- And sptid_cusid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
-
- UPDATE u_mtrlware
- SET cost = :ld_newcost,
- noallocqty = :ld_bgqty + :ld_incqty - :ld_desqty ,
- wareamt = round((:ld_bgqty + :ld_incqty - :ld_desqty) * :ld_newcost,2)
- WHERE mtrlid = :ll_mtrlid
- AND Storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- AND plancode = ''
- And sptid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新库存金额失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
-
- UPDATE u_outwaremx
- SET u_outwaremx.cost = :ld_newcost,
- u_outwaremx.costamt = round(u_outwaremx.qty * :ld_newcost,2)
- FROM u_outwaremx INNER JOIN
- u_outware ON u_outwaremx.scid = u_outware.scid AND
- u_outwaremx.outwareid = u_outware.outwareid
- WHERE u_outwaremx.mtrlid = :ll_mtrlid
- AND u_outware.storageid = :cur_storageid
- AND u_outwaremx.status = :ls_status
- AND u_outwaremx.woodcode = :ls_woodcode
- AND u_outwaremx.pcode = :ls_pcode
- AND u_outware.balcflag = 0
- And u_outwaremx.sptid = :ll_sptid_cusid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新未结存的出仓单金额失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+','+sqlca.SQLErrText
- GOTO ext
- END IF
- NEXT
- ext:
- Destroy ds_warebalc
- Close(w_sys_wait_jdt)
- IF rslt = 0 THEN
- ROLLBACK;
- MessageBox('Error',arg_msg)
- RETURN
- ELSE
- COMMIT;
- MessageBox('系统提示','重算成功!')
- This.TriggerEvent('retrieve_pageretr')
- END IF
- end event
- event ue_cmp();//超级重算
- IF Not f_power_ind(1507) THEN
- MessageBox(publ_operator,'你没有使用权限!')
- RETURN
- END IF
- //IF NOT dw_pageretr.DataObject = 'dw_warebalc_view' THEN
- // MessageBox('系统提示','必须在客户产品统计表中才能执行本功能')
- // RETURN
- //END IF
- IF MessageBox (publ_operator,"是否确定要执行超级重算结存功能?",Question!,YesNo! ) = 2 THEN RETURN
- IF cur_storageid = -1 THEN
- MessageBox('系统提示','请先选择仓库')
- RETURN
- END IF
- //// //清空筛选内容
- //dw_pageretr.SetFilter('')
- //dw_pageretr.Filter()
- //dw_pageretr.Retrieve(cur_storageid_arr,'','',-1,publ_operator)
- Long rslt = 1
- String arg_msg
- Long ll_i
- Decimal ld_newcost // 最新成本价
- Decimal ld_bgqty,ld_bgamt,ld_incqty,ld_incamt,ld_desqty,ld_desamt
- Decimal ld_balcqty,ld_balcamt
- Long ll_mtrlid
- String ls_status,ls_pcode,ls_woodcode
- String ls_mtrlcode
- Decimal ld_noallocqty,ld_wareamt
- Decimal ld_noallocqty_sum,ld_wareamt_sum
- Long ll_sptid
- Open(w_sys_wait_jdt) //初始化进度条
- w_sys_wait_jdt.Show()
- //
- ////结存查库存
- //库存计结存
- Long cnt,ll_scid
- datastore ds_mtrlware
- ds_mtrlware = Create datastore
- ds_mtrlware.DataObject = 'ds_warebalc_view_cmpl_mtrlware_to_balc2'
- ds_mtrlware.SetTransObject(sqlca)
- ds_mtrlware.Retrieve(cur_storageid)
- ds_mtrlware.AcceptText()
- //IF ld_noallocqty_sum <> ds_mtrlware.Object.sumqty[1] OR &
- // ld_wareamt_sum <> ds_mtrlware.Object.sumamt[1] THEN
- SELECT scid INTO :ll_scid
- FROM u_storage
- Where storageid = :cur_storageid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询仓库所属分部失败'
- GOTO ext
- END IF
- w_sys_wait_jdt.wf_accepttol(ds_mtrlware.RowCount())
- FOR ll_i = 1 To ds_mtrlware.RowCount()
- ll_mtrlid = 0
- ls_mtrlcode = ''
- ls_status = ''
- ls_woodcode = ''
- ls_pcode = ''
- ld_noallocqty = 0
- ld_wareamt = 0
- ll_sptid = 0
- cnt = 0
-
- ls_mtrlcode = ds_mtrlware.Object.u_mtrldef_mtrlcode[ll_i]
- ll_mtrlid = ds_mtrlware.Object.mtrlid[ll_i]
-
- ls_status = ds_mtrlware.Object.status[ll_i]
- ls_woodcode = ds_mtrlware.Object.woodcode[ll_i]
- ls_pcode = ds_mtrlware.Object.pcode[ll_i]
- ld_noallocqty = ds_mtrlware.Object.qty[ll_i]
- ld_wareamt = ds_mtrlware.Object.amt[ll_i]
- ll_sptid = ds_mtrlware.Object.u_mtrlware_sptid[ll_i]
- w_sys_wait_jdt.st_msg.Text = " 正在库存重算:"+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode+"..." //进度信息
- w_sys_wait_jdt.wf_inc(ll_i)
-
-
- SELECT sum(Round(u_inwaremx.qty * u_inwaremx.cost,2)) ,
- sum(u_inwaremx.qty)
- INTO :ld_incamt,:ld_incqty
- FROM u_inwaremx,u_inware
- WHERE u_inwaremx.scid = u_inware.scid
- AND u_inwaremx.inwareid = u_inware.inwareid
- AND u_inware.storageid = :cur_storageid
- AND u_inware.balcdateint = 0
- AND u_inwaremx.mtrlid = :ll_mtrlid
- AND u_inwaremx.status = :ls_status
- AND u_inwaremx.woodcode = :ls_woodcode
- AND u_inwaremx.pcode = :ls_pcode
- AND u_inwaremx.sptid_cusid = :ll_sptid
- And u_inware.flag = 1;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询进仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
-
- SELECT sum(u_outwaremx.costamt) ,
- sum(u_outwaremx.qty)
- INTO :ld_desamt,:ld_desqty
- FROM u_outwaremx,u_outware
- WHERE u_outwaremx.scid = u_outware.scid
- AND u_outwaremx.outwareid = u_outware.outwareid
- AND u_outware.storageid = :cur_storageid
- AND u_outware.balcdateint = 0
- AND u_outwaremx.mtrlid = :ll_mtrlid
- AND u_outwaremx.status = :ls_status
- AND u_outwaremx.woodcode = :ls_woodcode
- AND u_outwaremx.pcode = :ls_pcode
- AND u_outwaremx.sptid = :ll_sptid
- And u_outware.flag = 1;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询出仓失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
-
- IF IsNull(ld_desqty) THEN ld_desqty = 0
- IF IsNull(ld_incqty) THEN ld_incqty = 0
- IF IsNull(ld_desamt) THEN ld_desamt = 0
- IF IsNull(ld_incamt) THEN ld_incamt = 0
- UPDATE u_warebalc
- SET balcqty = :ld_noallocqty,
- balcamt = :ld_wareamt,
- bgqty = :ld_noallocqty + :ld_desqty - :ld_incqty,
- bgamt = :ld_wareamt + :ld_desamt - :ld_incamt,
- incqty = :ld_incqty,
- incamt = :ld_incamt,
- desqty = :ld_desqty,
- desamt = :ld_desamt
- WHERE mtrlid = :ll_mtrlid
- AND balcdateint = 0
- AND Storageid = :cur_storageid
- AND status = :ls_status
- AND woodcode = :ls_woodcode
- AND pcode = :ls_pcode
- And sptid_cusid = :ll_sptid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- ELSEIF sqlca.SQLNRows = 0 THEN
- INSERT INTO u_warebalc
- (scid,
- balcdateint,
- storageid,
- mtrlid,
- status,
- woodcode,
- pcode,
- bgqty,
- bgamt,
- incqty,
- incamt,
- desqty,
- desamt,
- balcqty,
- balcamt,
- sptid_cusid)
- VALUES
- (:sys_scid,0,
- :cur_storageid,
- :ll_mtrlid,
- :ls_status,
- :ls_woodcode,
- :ls_pcode,
- :ld_noallocqty + :ld_desqty - :ld_incqty,
- :ld_wareamt + :ld_desamt - :ld_incamt,
- :ld_incqty,
- :ld_incamt,
- :ld_desqty,
- :ld_desamt,
- :ld_noallocqty,
- :ld_wareamt,
- :ll_sptid);
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '新加结存失败,物料:'+ls_mtrlcode+','+sys_option_change_status+':'+ls_status+','+sys_option_change_woodcode+':'+ls_woodcode+','+sys_option_change_pcode+':'+ls_pcode
- GOTO ext
- END IF
- END IF
-
- NEXT
- //END IF
- ext:
- Destroy ds_mtrlware
- Close(w_sys_wait_jdt)
- IF rslt = 0 THEN
- ROLLBACK;
- MessageBox('Error',arg_msg)
- RETURN
- ELSE
- COMMIT;
- MessageBox('系统提示','重算成功!')
- This.TriggerEvent('retrieve_pageretr')
- END IF
- end event
- event ue_update_inware_mtrlwareid();UPDATE u_inwaremx
- SET mtrlwareid = u_mtrlware.mtrlwareid
- FROM u_inware INNER JOIN
- u_inwaremx ON u_inware.scid = u_inwaremx.scid AND
- u_inware.inwareid = u_inwaremx.inwareid INNER JOIN
- u_mtrlware ON u_inwaremx.scid = u_mtrlware.scid AND
- u_inwaremx.mtrlid = u_mtrlware.mtrlid AND
- u_inwaremx.plancode = u_mtrlware.plancode AND
- u_inwaremx.status = u_mtrlware.Status AND
- u_inwaremx.woodcode = u_mtrlware.woodcode AND
- u_inwaremx.pcode = u_mtrlware.pcode AND
- u_inwaremx.sptid_cusid = u_mtrlware.Sptid AND
- u_inware.storageid = u_mtrlware.storageid AND
- u_inware.Dxflag = u_mtrlware.Dxflag
- Where (u_inware.flag = 1) And (u_inwaremx.mtrlwareid = 0);
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- MessageBox('','失败')
- ELSE
- COMMIT;
- MessageBox('','成功')
- END IF
- end event
- public subroutine wf_hidecol ();s_hide_col s_col
- s_col.col_1 = 'u_mtrldef_bgamt'
- s_col.col_2 = 'u_mtrldef_incamt'
- s_col.col_3 = 'u_mtrldef_desamt'
- s_col.col_4 = 'u_mtrldef_balcamt'
- f_hide_col(123,dw_1,s_col)
- end subroutine
- public function window getparentwindow ();return this
- end function
- on w_warebalc_view_new_bk.create
- int iCurrent
- call super::create
- this.tv_1=create tv_1
- this.st_2=create st_2
- this.ddlb_storageid=create ddlb_storageid
- this.cbx_1=create cbx_1
- this.cbx_inout=create cbx_inout
- this.tab_1=create tab_1
- this.cb_other=create cb_other
- this.sle_usual_query=create sle_usual_query
- this.st_8=create st_8
- this.st_1=create st_1
- this.em_month=create em_month
- this.st_lastbalcdate=create st_lastbalcdate
- this.ddlb_1=create ddlb_1
- this.cb_balc=create cb_balc
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.tv_1
- this.Control[iCurrent+2]=this.st_2
- this.Control[iCurrent+3]=this.ddlb_storageid
- this.Control[iCurrent+4]=this.cbx_1
- this.Control[iCurrent+5]=this.cbx_inout
- this.Control[iCurrent+6]=this.tab_1
- this.Control[iCurrent+7]=this.cb_other
- this.Control[iCurrent+8]=this.sle_usual_query
- this.Control[iCurrent+9]=this.st_8
- this.Control[iCurrent+10]=this.st_1
- this.Control[iCurrent+11]=this.em_month
- this.Control[iCurrent+12]=this.st_lastbalcdate
- this.Control[iCurrent+13]=this.ddlb_1
- this.Control[iCurrent+14]=this.cb_balc
- end on
- on w_warebalc_view_new_bk.destroy
- call super::destroy
- destroy(this.tv_1)
- destroy(this.st_2)
- destroy(this.ddlb_storageid)
- destroy(this.cbx_1)
- destroy(this.cbx_inout)
- destroy(this.tab_1)
- destroy(this.cb_other)
- destroy(this.sle_usual_query)
- destroy(this.st_8)
- destroy(this.st_1)
- destroy(this.em_month)
- destroy(this.st_lastbalcdate)
- destroy(this.ddlb_1)
- destroy(this.cb_balc)
- end on
- event resize;call super::resize;IF cbx_inout.Checked THEN
- tab_1.Visible = TRUE
-
- dw_1.Width = THIS.Width - dw_1.X - 40
- dw_1.Height = THIS.Height - dw_1.Y - tab_1.Height - 150
-
- tv_1.Height = THIS.Height - tv_1.Y - 150
-
-
-
- tab_1.Width = THIS.Width - tab_1.X - 40
-
- tab_1.Y = dw_1.Y + dw_1.Height + 10
- tab_1.X = dw_1.X
- tab_1.tabpage_1.dw_inout.Height = tab_1.tabpage_1.Height - tab_1.tabpage_1.dw_inout.Y - 40
- tab_1.tabpage_1.dw_inout.Width = tab_1.tabpage_1.Width - tab_1.tabpage_1.dw_inout.X - 40
- tab_1.tabpage_2.dw_out_noaudit.Height = tab_1.tabpage_2.Height - tab_1.tabpage_2.dw_out_noaudit.Y - 40
- tab_1.tabpage_2.dw_out_noaudit.Width = tab_1.tabpage_2.Width - tab_1.tabpage_2.dw_out_noaudit.X - 40
- ELSE
- dw_1.Width = THIS.Width - dw_1.X - 40
- dw_1.Height = THIS.Height - dw_1.Y - 150
-
- tv_1.Height = THIS.Height - tv_1.Y - 150
-
- tab_1.Visible = FALSE
-
- END IF
- end event
- event ue_before_open;call super::ue_before_open;cbx_1.visible = false
- cbx_inout.visible = false
- ins_if_info = Long(f_ProfileString (sys_empid,This.ClassName(), "ins_if_info",'0'))
- IF ins_if_info = 1 THEN
- This.PostEvent('ue_mtrl_info')
- END IF
- end event
- event ue_before_openretrieve;call super::ue_before_openretrieve;tab_1.tabpage_1.dw_inout.settransobject(sqlca)
- tab_1.tabpage_2.dw_out_noaudit.settransobject(sqlca)
- end event
- event close;call super::close;IF IsValid(w_mtrl_info) THEN
- ins_if_info = 1
- ELSE
- ins_if_info = 0
- END IF
- f_SetProfileString (sys_empid,This.ClassName(),"ins_if_info",String(ins_if_info))
- end event
- type cb_func from w_publ_easyq`cb_func within w_warebalc_view_new_bk
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_warebalc_view_new_bk
- integer x = 1536
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_warebalc_view_new_bk
- integer x = 1234
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_warebalc_view_new_bk
- integer x = 978
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_warebalc_view_new_bk
- boolean bringtotop = true
- end type
- event cb_1::clicked;parent.triggerevent("retrieve_pageretr")
- end event
- type st_3 from w_publ_easyq`st_3 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 690
- integer y = 204
- end type
- type st_4 from w_publ_easyq`st_4 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 1381
- integer y = 204
- end type
- type em_1 from w_publ_easyq`em_1 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 882
- integer y = 188
- integer taborder = 120
- end type
- type em_2 from w_publ_easyq`em_2 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 1486
- integer y = 188
- integer taborder = 130
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_warebalc_view_new_bk
- integer x = 2071
- integer y = 8
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_warebalc_view_new_bk
- integer x = 1861
- integer y = 12
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_warebalc_view_new_bk
- integer x = 805
- integer y = 392
- integer width = 2400
- integer height = 988
- string dataobject = "dw_warebalc_view_sum"
- end type
- event dw_1::doubleclicked;call super::doubleclicked;IF dwo.Name = 'u_mtrlware_waredscrp' THEN
- Parent.TriggerEvent('ue_waredscrp_view')
- END IF
- end event
- event dw_1::rowfocuschanged;call super::rowfocuschanged;Parent.TriggerEvent('ue_retrieve_info')
- IF cbx_inout.Checked THEN
- Parent.TriggerEvent('ue_retrieve_inoutmx')
- END IF
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_warebalc_view_new_bk
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_warebalc_view_new_bk
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_warebalc_view_new_bk
- end type
- type st_cust from w_publ_easyq`st_cust within w_warebalc_view_new_bk
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_warebalc_view_new_bk
- boolean visible = true
- integer x = 1861
- integer y = 100
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 1298
- integer y = 188
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 1897
- integer y = 188
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_warebalc_view_new_bk
- boolean visible = false
- integer x = 2007
- integer y = 188
- end type
- type cb_help from w_publ_easyq`cb_help within w_warebalc_view_new_bk
- integer x = 1385
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_warebalc_view_new_bk
- integer x = 722
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_warebalc_view_new_bk
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_warebalc_view_new_bk
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_warebalc_view_new_bk
- end type
- type r_bar from w_publ_easyq`r_bar within w_warebalc_view_new_bk
- integer x = 2272
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_warebalc_view_new_bk
- integer beginy = 384
- integer endy = 384
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_warebalc_view_new_bk
- integer beginy = 388
- integer endy = 388
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_warebalc_view_new_bk
- boolean visible = false
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_warebalc_view_new_bk
- boolean visible = false
- end type
- type tv_1 from uo_tv_mtrltype within w_warebalc_view_new_bk
- integer y = 392
- integer width = 800
- integer height = 1808
- integer taborder = 130
- boolean bringtotop = true
- integer textsize = -9
- fontcharset fontcharset = gb2312charset!
- fontfamily fontfamily = anyfont!
- string facename = "宋体"
- end type
- event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype
- ls_mtrltype = THIS.uo_cur_info.mtrltype
- IF ls_handtype <> '' THEN
- ls_mtrltype = '%'+ls_handtype+'%'
- ls_handtype = ls_handtype+'%'
- ELSE
- ls_mtrltype = ""
- END IF
- PARENT.TriggerEvent('retrieve_pageretr')
- end event
- type st_2 from statictext within w_warebalc_view_new_bk
- integer x = 5
- integer y = 204
- integer width = 343
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "仓库:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ddlb_storageid from uo_ddlb_storageid within w_warebalc_view_new_bk
- integer x = 352
- integer y = 188
- integer width = 635
- integer height = 1232
- integer taborder = 130
- boolean bringtotop = true
- end type
- event constructor;call super::constructor;cur_storageid = this.uo_storageid
- cur_storageid_arr = this.uo_storageid_arr
- end event
- event selectionchanged;call super::selectionchanged;cur_storageid = this.uo_storageid
- cur_storageid_arr = this.uo_storageid_arr
- cb_1.triggerevent(clicked!)
- end event
- type cbx_1 from checkbox within w_warebalc_view_new_bk
- integer x = 2080
- integer y = 200
- integer width = 439
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 134217739
- string text = "显示 0 库存"
- end type
- event clicked;int if_zeromtrlware
- if this.checked then
- if_zeromtrlware=1
- else
- if_zeromtrlware=0
- end if
- f_SetProfileString (sys_empid,dw_1.DATAOBJECT, "if_zeromtrlware", string(if_zeromtrlware))
- parent.triggerevent("retrieve_pageretr")
- end event
- event constructor;
- int if_zeromtrlware
- if_zeromtrlware=integer(f_ProfileString (sys_empid,dw_1.DATAOBJECT, "if_zeromtrlware", '0'))
- if if_zeromtrlware =0 then
- this.checked=false
- else
- this.checked=true
- end if
- end event
- type cbx_inout from checkbox within w_warebalc_view_new_bk
- integer x = 2080
- integer y = 312
- integer width = 402
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "显示明细"
- end type
- event clicked;Int if_inout
- IF This.Checked THEN
- if_inout = 1
- ELSE
- if_inout = 0
- END IF
- f_SetProfileString (sys_empid,dw_1.DataObject, "if_inout", String(if_inout))
- Parent.TriggerEvent(Resize!)
- Parent.TriggerEvent("ue_retrieve_inoutmx")
- end event
- event constructor;Int if_inout
- if_inout = Integer(f_ProfileString (sys_empid,dw_1.DataObject, "if_inout", '0'))
- IF if_inout = 0 THEN
- This.Checked = False
- ELSE
- This.Checked = True
- END IF
- end event
- type tab_1 from tab within w_warebalc_view_new_bk
- event create ( )
- event destroy ( )
- integer x = 786
- integer y = 1228
- integer width = 2286
- integer height = 1056
- integer taborder = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 134217739
- boolean raggedright = true
- boolean focusonbuttondown = true
- integer selectedtab = 1
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- end type
- on tab_1.create
- this.tabpage_1=create tabpage_1
- this.tabpage_2=create tabpage_2
- this.Control[]={this.tabpage_1,&
- this.tabpage_2}
- end on
- on tab_1.destroy
- destroy(this.tabpage_1)
- destroy(this.tabpage_2)
- end on
- type tabpage_1 from userobject within tab_1
- event create ( )
- event destroy ( )
- integer x = 18
- integer y = 96
- integer width = 2249
- integer height = 944
- long backcolor = 134217739
- string text = "进出明细"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_inout dw_inout
- em_3 em_3
- em_4 em_4
- cb_iomx_retrieve cb_iomx_retrieve
- ddlb_billtype ddlb_billtype
- st_7 st_7
- st_6 st_6
- end type
- on tabpage_1.create
- this.dw_inout=create dw_inout
- this.em_3=create em_3
- this.em_4=create em_4
- this.cb_iomx_retrieve=create cb_iomx_retrieve
- this.ddlb_billtype=create ddlb_billtype
- this.st_7=create st_7
- this.st_6=create st_6
- this.Control[]={this.dw_inout,&
- this.em_3,&
- this.em_4,&
- this.cb_iomx_retrieve,&
- this.ddlb_billtype,&
- this.st_7,&
- this.st_6}
- end on
- on tabpage_1.destroy
- destroy(this.dw_inout)
- destroy(this.em_3)
- destroy(this.em_4)
- destroy(this.cb_iomx_retrieve)
- destroy(this.ddlb_billtype)
- destroy(this.st_7)
- destroy(this.st_6)
- end on
- type dw_inout from u_dw_rbtnfilter within tabpage_1
- integer y = 92
- integer taborder = 30
- string dataobject = "dw_rp_ware_mtrlware_inoutmx"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event clicked;call super::clicked;IF row > 0 THEN
- This.SelectRow(0, False)
- This.SetRow(row)
- This.SelectRow(row,True)
- END IF
- end event
- event doubleclicked;call super::doubleclicked;IF row > 0 THEN
- String ls_code,ls_relcode
- Long ll_scid
- Int li_thflag,li_billtype
-
- ll_scid = This.Object.u_outware_scid[row]
- ls_code = This.Object.code[row]
- f_open_win(ll_scid,ls_code)
- END IF
- end event
- type em_3 from editmask within tabpage_1
- integer x = 224
- integer y = 4
- integer width = 402
- integer height = 84
- integer taborder = 90
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "none"
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- event constructor;this.Text = String(Today(),'YYYY-MM')+'-01'
- end event
- type em_4 from editmask within tabpage_1
- integer x = 704
- integer y = 4
- integer width = 402
- integer height = 84
- integer taborder = 90
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "none"
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- event constructor;this.Text = String(Today(),'YYYY-MM-DD')
- end event
- type cb_iomx_retrieve from uo_imflatbutton within tabpage_1
- integer x = 1134
- integer y = 4
- integer width = 215
- integer height = 84
- integer taborder = 90
- string text = "刷新"
- integer picsize = 16
- end type
- event clicked;call super::clicked;getparentwindow().triggerevent("ue_retrieve_inoutmx")
- end event
- type ddlb_billtype from dropdownlistbox within tabpage_1
- integer x = 1381
- integer y = 4
- integer width = 827
- integer height = 976
- integer taborder = 40
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "全 部[0]"
- boolean sorted = false
- boolean vscrollbar = true
- string item[] = {"全 部[0]","全部进仓[0]","全部出仓{0}","采购进仓[1]","生产进仓[3]","外协进仓[4]","其它进仓[8]","盘盈进仓[9]","调拨进仓[12]","拆装进仓[15]","来料加工收料进仓[20]","库存配置调整单[22]","销售出仓{1}","领料出仓{3}","外协仓库出仓{4}","其它出仓{8}","盘亏出仓{9}","扣费品出仓{10}","调拨出仓{12}","拆装出仓{15}"}
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;string ls_billtype
- choose case index
- case 1
- cur_billtype_in = -1
- cur_billtype_out = -1
- case 2
- cur_billtype_in = -1
- cur_billtype_out = 0
- case 3
- cur_billtype_in = 0
- cur_billtype_out = -1
- case else
- ls_billtype = Mid ( this.text,pos(this.text,'[') + 1,len(this.text) - pos(this.text,'[') - 1 )
- if isnumber(ls_billtype) then
- cur_billtype_in=long(ls_billtype)
- else
- cur_billtype_in = 0
- end if
-
- ls_billtype = Mid ( this.text,pos(this.text,'{') + 1,len(this.text) - pos(this.text,'{') - 1 )
- if isnumber(ls_billtype) then
- cur_billtype_out=long(ls_billtype)
- else
- cur_billtype_out = 0
- end if
- end choose
-
- cb_iomx_retrieve.triggerevent(clicked!)
- end event
- type st_7 from statictext within tabpage_1
- integer x = 9
- integer y = 20
- integer width = 219
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "日期从:"
- boolean focusrectangle = false
- end type
- type st_6 from statictext within tabpage_1
- integer x = 631
- integer y = 20
- integer width = 73
- integer height = 48
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "至"
- boolean focusrectangle = false
- end type
- type tabpage_2 from userobject within tab_1
- integer x = 18
- integer y = 96
- integer width = 2249
- integer height = 944
- long backcolor = 134217739
- string text = "未审明细"
- long tabtextcolor = 33554432
- long tabbackcolor = 134217739
- long picturemaskcolor = 536870912
- dw_out_noaudit dw_out_noaudit
- end type
- on tabpage_2.create
- this.dw_out_noaudit=create dw_out_noaudit
- this.Control[]={this.dw_out_noaudit}
- end on
- on tabpage_2.destroy
- destroy(this.dw_out_noaudit)
- end on
- type dw_out_noaudit from u_dw_rbtnfilter within tabpage_2
- integer taborder = 40
- string dataobject = "dw_rp_ware_mtrlware_out_noaudit"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean rbutton_filter_use = true
- boolean rbutton_setposition_use = true
- boolean titleclick_sort_use = true
- end type
- event clicked;call super::clicked;IF row > 0 THEN
- This.SelectRow(0, False)
- This.SetRow(row)
- This.SelectRow(row,True)
- END IF
- end event
- event doubleclicked;call super::doubleclicked;IF row > 0 THEN
- String ls_code,ls_relcode
- Long ll_scid
- Int li_thflag,li_billtype
-
- ll_scid = This.Object.u_outware_scid[row]
- ls_code = This.Object.u_outware_outwarecode[row]
- f_open_win(ll_scid,ls_code)
- END IF
- end event
- type cb_other from uo_imflatbutton within w_warebalc_view_new_bk
- integer x = 466
- integer width = 256
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "辅助功能"
- string normalpicname = "other.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
- String menustr
- menustr = "Text=按上期结存重算本期结余~tEvent=ue_cmp_amt2"
- menustr = menustr + "|" + "Text=按库存数重算本期期初~tEvent=ue_cmp_mtrlware"
- menustr = menustr + "|" + "Text=超级重算~tEvent=ue_cmp"
- menustr = menustr + "|" + "Text=-"
- menustr = menustr + "|" + "Text=更新进仓单明细库存ID~tEvent=ue_update_inware_mtrlwareid"
- menustr = menustr + "|" + "Text=物料相关查询~tEvent=ue_mtrl_info"
- IF Len(Trim(menustr)) <> 0 THEN
- dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
- dmPopupMenu.mf_BuildMenu(THIS, menustr)
- dmPopupMenu.mf_PopMenu()
- DESTROY dmPopupMenu
- END IF
- end event
- type sle_usual_query from u_sleedit within w_warebalc_view_new_bk
- integer x = 352
- integer y = 272
- integer width = 635
- integer height = 92
- integer taborder = 100
- boolean bringtotop = true
- end type
- event modified;call super::modified;//IF retrieve_all or retrmode=0 THEN
- //// PARENT.TRIGGEREVENT("ue_usual_query_filt")
- //ELSE
- // PARENT.TRIGGEREVENT("ue_usual_query_RETR")
- //END IF
- end event
- event keyup;call super::keyup;IF NOT dw_edit_mode THEN
- If Key = KeyDownArrow! Then //
- dw_1.ScrollNextRow()
- End If
- If Key = KeyUPArrow! Then //
- dw_1.ScrollPriorRow()
- End If
- END IF
- end event
- event inputchanged;call super::inputchanged;//IF retrieve_all THEN
- PARENT.TRIGGEREVENT("ue_usual_query_filt")
- //END IF
- end event
- type st_8 from statictext within w_warebalc_view_new_bk
- integer y = 292
- integer width = 343
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "编码/名称含:"
- boolean focusrectangle = false
- end type
- type st_1 from statictext within w_warebalc_view_new_bk
- integer x = 1120
- integer y = 212
- integer width = 242
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "结存日期"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type em_month from editmask within w_warebalc_view_new_bk
- integer x = 1371
- integer y = 188
- integer width = 434
- integer height = 88
- integer taborder = 130
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "none"
- alignment alignment = center!
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- event constructor;this.text = string(today(),'yyyy-mm-dd')
- end event
- event rbuttondown;s_calender_arg s_calender
- s_calender.PointerX = THIS.PointerX()
- s_calender.PointerY = THIS.PointerY()
- s_calender.X = THIS.X
- s_calender.Y = THIS.Y
- OpenWithParm(w_calendar,s_calender)
- THIS.Text = String(id_date_selected)
- end event
- type st_lastbalcdate from statictext within w_warebalc_view_new_bk
- integer x = 1134
- integer y = 300
- integer width = 823
- integer height = 48
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "最后结存日期"
- boolean focusrectangle = false
- end type
- type ddlb_1 from dropdownlistbox within w_warebalc_view_new_bk
- integer x = 2427
- integer y = 32
- integer width = 745
- integer height = 1100
- integer taborder = 100
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "汇总统计表"
- boolean sorted = false
- boolean vscrollbar = true
- string item[] = {"汇总统计表","产品明细统计表","客户产品统计表","分类统计表","汇总统计表(设定售价)"}
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;dw_1.SetRedraw(False)
- dw_1.uf_save_profile_layout()
- IF this.Text = '客户产品统计表' THEN
- dw_1.DataObject = 'dw_warebalc_view'
- ELSEIF this.Text = '产品明细统计表' THEN
- dw_1.DataObject = 'dw_warebalc_view_sum_1'
- ELSEIF this.Text = '汇总统计表' THEN
- dw_1.DataObject = 'dw_warebalc_view_sum'
- ELSEIF this.Text = '分类统计表' THEN
- dw_1.DataObject = 'dw_warebalc_view_2'
- ELSEIF this.Text = '汇总统计表(设定售价)' THEN
- dw_1.DataObject = 'dw_warebalc_view_sum_saleprice'
- END IF
- dw_1.SetTransObject(sqlca)
- dw_1.ins_INIfile_name = sys_inifilename
- dw_1.ins_opemp = publ_operator
- dw_1.cardw_empid = sys_empid
- dw_1.cur_DataObject = dw_1.DataObject
- dw_1.uf_read_profile_layout()
- wf_hidecol()
- f_title_change(dw_1)
- dw_1.SetRedraw(True)
- cb_1.TriggerEvent(Clicked!)
- end event
- type cb_balc from uo_imflatbutton within w_warebalc_view_new_bk
- integer x = 302
- integer width = 165
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "结存"
- string normalpicname = "update2.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF NOT f_power_ind(75) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- IF cur_storageid = -1 THEN
- MessageBox("提示","请选择仓库结存",information!,ok!)
- RETURN
- END IF
- balcdate = DateTime(Date(em_month.Text),Time('23:59:59'))
- IF MessageBox ('询问',"是否确定要把当前日仓库进行结存操作吗?"+'~n'+&
- '结存时间: '+String(balcdate,'YYYY-MM-DD HH:MM:SS')+',结存过程中不能进行其它操作!',Question!,YesNo! ) = 2 THEN RETURN
- w_sys_wait.Show()
- String arg_msg = '',err_msg = ''
- uf_warebalc(1,0,cur_storageid,balcdate,arg_msg)
- w_sys_wait.Hide()
- MessageBox('提示',arg_msg,information!,ok!)
- cb_1.TriggerEvent(Clicked!)
- end event
|