12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247 |
- $PBExportHeader$w_quote_receive_ljfieb.srw
- forward
- global type w_quote_receive_ljfieb from w_publ_base
- end type
- type dw_uc from datawindow within w_quote_receive_ljfieb
- end type
- type dw_child from u_dw_rbtnfilter within w_quote_receive_ljfieb
- end type
- type mle_1 from multilineedit within w_quote_receive_ljfieb
- end type
- type st_1 from statictext within w_quote_receive_ljfieb
- end type
- type st_2 from statictext within w_quote_receive_ljfieb
- end type
- type sle_scname from singlelineedit within w_quote_receive_ljfieb
- end type
- type cb_accept from uo_imflatbutton within w_quote_receive_ljfieb
- end type
- type cb_feedback from uo_imflatbutton within w_quote_receive_ljfieb
- end type
- type cb_reject from uo_imflatbutton within w_quote_receive_ljfieb
- end type
- type mle_2 from multilineedit within w_quote_receive_ljfieb
- end type
- type st_3 from statictext within w_quote_receive_ljfieb
- end type
- type cbx_audit from checkbox within w_quote_receive_ljfieb
- end type
- type cb_1 from uo_imflatbutton within w_quote_receive_ljfieb
- end type
- type ln_bar from line within w_quote_receive_ljfieb
- end type
- type ln_bar2 from line within w_quote_receive_ljfieb
- end type
- type ln_1 from line within w_quote_receive_ljfieb
- end type
- type ln_2 from line within w_quote_receive_ljfieb
- end type
- type r_bar from rectangle within w_quote_receive_ljfieb
- end type
- end forward
- global type w_quote_receive_ljfieb from w_publ_base
- integer width = 3611
- integer height = 2380
- string title = "供应商报价单"
- boolean minbox = false
- windowtype windowtype = response!
- windowstate windowstate = maximized!
- event ue_quote ( )
- dw_uc dw_uc
- dw_child dw_child
- mle_1 mle_1
- st_1 st_1
- st_2 st_2
- sle_scname sle_scname
- cb_accept cb_accept
- cb_feedback cb_feedback
- cb_reject cb_reject
- mle_2 mle_2
- st_3 st_3
- cbx_audit cbx_audit
- cb_1 cb_1
- ln_bar ln_bar
- ln_bar2 ln_bar2
- ln_1 ln_1
- ln_2 ln_2
- r_bar r_bar
- end type
- global w_quote_receive_ljfieb w_quote_receive_ljfieb
- type variables
- Transaction tr_eb_sqlca
- s_packet_ljfieb s_inscust
- long ins_scid
- string ins_sn
- uo_spt_price_change uo_price
- uo_ljfieb uo_fieb
- long ins_sendid,ins_receid
- string ins_sendsccode,ins_reccesccode
- string ins_RelatedCode
- datetime ins_addtime
- string ins_adduser
- end variables
- forward prototypes
- public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg)
- public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
- public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
- public function integer wf_add_quote (integer arg_type, integer arg_ifaudit)
- end prototypes
- public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg);Int rslt = 1
- String ls_cuscode
- Long uc_row
- Long ll_i, ll_rowcnt,ll_row
- Long ll_moneyid,ll_banktypeid
- Decimal ls_1stnewprice,ls_1stzqrate
- dw_uc.Retrieve(arg_sn)
- dw_child.Retrieve(arg_sn)
- uc_row = dw_uc.GetRow()
- IF uc_row <= 0 THEN
- rslt = 0
- arg_msg = '没有对应的单据信息'
- GOTO ext
- END IF
- SELECT CusCode
- INTO :ls_cuscode
- FROM LJFIEB_CusComm
- Where CusCommID = :arg_sendcuscommid Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- ls_cuscode = ''
- END IF
- IF Trim(ls_cuscode) = '' THEN
- rslt = 0
- arg_msg = '供应商信息不明确,请检查'
- GOTO ext
- END IF
- Long ll_sptid
- String ls_sptcode, ls_sptname
- string ls_sptmtrlcode,ls_mtrlcode_my,ls_mtrlname_my,ls_mtrlmode_my
- long ll_mtrlid
- SELECT sptid, sptcode, name
- INTO :ll_sptid,:ls_sptcode,:ls_sptname
- FROM u_spt
- WHERE commcode = :ls_cuscode
- And commsccode = :arg_sendsccode Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询供应商信息失败,请检查通信设置是否正确,'+sqlca.SQLErrText
- GOTO ext
- END IF
- dw_uc.Object.sptid[uc_row] = ll_sptid
- dw_uc.Object.sptCode[uc_row] = ls_sptcode
- dw_uc.Object.sptname[uc_row] = ls_sptname
- FOR ll_i = 1 To dw_child.RowCount()
- ls_sptmtrlcode = dw_child.Object.mtrlcode[ll_i]
-
- SELECT u_sptmtrlname.mtrlid,
- u_mtrldef.mtrlcode,
- u_mtrldef.mtrlname,
- u_mtrldef.mtrlmode
- INTO :ll_mtrlid,
- :ls_mtrlcode_my,
- :ls_mtrlname_my,
- :ls_mtrlmode_my
- FROM u_sptmtrlname INNER JOIN
- u_mtrldef ON u_sptmtrlname.mtrlid = u_mtrldef.mtrlid
- WHERE u_sptmtrlname.sptid = :ll_sptid
- And u_sptmtrlname.sptmtrlcode = :ls_sptmtrlcode using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '第'+string(ll_i)+'行,查询本地产品信息失败,'+sqlca.sqlerrtext
- GOTO ext
- END IF
-
- dw_child.Object.mtrlcode_my[ll_i] = ls_mtrlcode_my
- dw_child.Object.mtrlname_my[ll_i] = ls_mtrlname_my
- dw_child.Object.mtrlmode_my[ll_i] = ls_mtrlmode_my
- dw_child.Object.mtrlid_my[ll_i] = ll_mtrlid
-
- NEXT
- ext:
- RETURN rslt
- end function
- public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
- IF arg_moneyid = 0 THEN
- rslt = 0
- arg_msg = '请先选择币种'
- GOTO ext
- END IF
- IF IsNull(arg_cusid) THEN arg_cusid = 0
- IF arg_cusid = 0 THEN
- rslt = 0
- arg_msg = "请选择销售客户!"
- GOTO ext
- END IF
- SELECT u_cus_price.fprice_bj,u_cus_price.zqrate_bj
- INTO :arg_price,:arg_rebate
- FROM u_cus_price
- WHERE ( u_cus_price.cusid = :arg_cusid ) AND
- ( u_cus_price.mtrlid = :arg_mtrlid ) AND
- ( u_cus_price.status = :arg_status ) AND
- ( u_cus_price.pcode = :arg_pcode ) AND
- ( u_cus_price.woodcode = :arg_woodcode ) and
- ( u_cus_price.moneyid = :arg_moneyid);
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "没有最新销售价!"
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- arg_price = 0
- arg_rebate = 0
- END IF
- RETURN rslt
- end function
- public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
- IF arg_moneyid = 0 THEN
- rslt = 0
- arg_msg = '请先选择币种'
- GOTO ext
- END IF
- IF IsNull(arg_cusid) THEN arg_cusid = 0
- IF arg_cusid = 0 THEN
- rslt = 0
- arg_msg = "请选择销售客户!"
- GOTO ext
- END IF
- SELECT u_cus_price.fprice,u_cus_price.zqrate
- INTO :arg_price,:arg_rebate
- FROM u_cus_price
- WHERE ( u_cus_price.cusid = :arg_cusid ) AND
- ( u_cus_price.mtrlid = :arg_mtrlid ) AND
- ( u_cus_price.status = :arg_status ) AND
- ( u_cus_price.pcode = :arg_pcode ) AND
- ( u_cus_price.woodcode = :arg_woodcode ) and
- ( u_cus_price.moneyid = :arg_moneyid);
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "没有最新销售价!"
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- arg_price = 0
- arg_rebate = 0
- END IF
- RETURN rslt
- end function
- public function integer wf_add_quote (integer arg_type, integer arg_ifaudit);String arg_msg
- Long uc_row
- DateTime server_dt
- Long i
- Long ll_mtrlid
- String ls_mtrlcode
- Long ll_mess
- String ls_relquotecode
- Long ll_moneyid
- String ls_moneyname
- String ls_status,ls_code,ls_woodcode,ls_pcode
- Decimal ld_price
- Long ll_billid
- Boolean lb_ifcommit
- uc_row = dw_uc.GetRow()
- IF uc_row <= 0 THEN
- MessageBox('系统提示','没有可保存的内容')
- RETURN 0
- END IF
- dw_uc.AcceptText()
- dw_child.AcceptText()
- IF arg_type = 1 THEN
- SELECT Top 1 getdate() Into :server_dt From u_user Using sqlca;
- //取得系统时间,借用操作员表
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error',"查询操作失败,日期 ")
- RETURN 0
- END IF
-
- ls_moneyname = dw_uc.Object.moneyname[uc_row]
-
- SELECT moneyid
- INTO :ll_moneyid
- FROM cw_currency
- Where Name = :ls_moneyname Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询币种信息失败,'+sqlca.SQLErrText)
- RETURN 0
- END IF
-
- IF uo_price.newbegin() = 0 THEN
- MessageBox('Error!',arg_msg)
- RETURN 0
- END IF
-
- uo_price.billdate = server_dt // 发生时间
- uo_price.inrep = publ_operator
- uo_price.dscrp = dw_uc.Object.dscrp[uc_row] //备注
- uo_price.sptid = dw_uc.Object.sptid[uc_row] //
- uo_price.moneyid = ll_moneyid
- uo_price.billtype = 2
-
- FOR i = 1 To dw_child.RowCount()
- IF dw_child.Object.mtrlcode_my[i] <> '' THEN
- ls_mtrlcode = dw_child.Object.mtrlcode_my[i]
-
- SELECT mtrlid INTO :ll_mtrlid
- FROM u_mtrldef
- Where mtrlcode = :ls_mtrlcode Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- ll_mess = MessageBox('Error','第'+String(i)+'行,查询产品信息失败,是否忽略?',question!,yesno!)
- IF ll_mess = 1 THEN
- CONTINUE
- ELSEIF ll_mess = 2 THEN
- RETURN 0
- END IF
- END IF
-
- IF uo_price.acceptmx(i,&
- dw_child.Object.mtrlid_my[i],&
- dw_child.Object.mtrlcode_my[i],&
- dw_child.Object.unit[i],&
- 0,&
- dw_child.Object.price[i],&
- 1,&
- 1,&
- dw_child.Object.status[i],&
- dw_child.Object.woodcode[i],&
- dw_child.Object.pcode[i],&
- dw_child.Object.mtrlname[i],&
- dw_child.Object.mxdscrp[i],&
- arg_msg) = 0 THEN
- MessageBox('Error!',arg_msg)
- RETURN 0
- END IF
- END IF
- NEXT
-
- IF arg_ifaudit = 1 THEN
- lb_ifcommit = False
- ELSE
- lb_ifcommit = True
- END IF
-
- IF uo_price.Save(arg_msg,lb_ifcommit) = 0 THEN
- MessageBox('Error!',arg_msg)
- RETURN 0
- END IF
-
- IF arg_ifaudit = 1 THEN
- IF uo_price.getinfo(uo_price.billid,arg_msg) = 0 THEN
- MessageBox('error!',arg_msg)
- RETURN 0
- END IF
- IF uo_price.auditing(True,arg_msg) = 0 THEN
- MessageBox('error!',arg_msg)
- RETURN 0
- END IF
- END IF
-
- ls_relquotecode = uo_price.billcode
-
- ELSE
- ls_code = dw_uc.Object.fiebrelcode[uc_row]
-
- IF Trim(ls_code) = '' THEN
- MessageBox('系统提示','没有相关供应商询价单')
- RETURN 0
- END IF
-
-
- SELECT billid
- INTO :ll_billid
- FROM u_spt_price_change
- Where billcode = :ls_code Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询供应商询价单状态失败,'+sqlca.SQLErrText)
- RETURN 0
- END IF
-
- FOR i = 1 To dw_child.RowCount()
- ll_mtrlid = dw_child.Object.mtrlid_my[i]
- ls_status = dw_child.Object.status[i]
- ls_woodcode = dw_child.object.woodcode[i]
- ls_pcode = dw_child.object.pcode[i]
- ld_price = dw_child.Object.price[i]
-
- UPDATE u_spt_price_changemx
- SET price = :ld_price
- WHERE mtrlid = :ll_mtrlid
- AND status = :ls_status
- and woodcode = :ls_woodcode
- and pcode = :ls_pcode
- And billid = :ll_billid Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK Using sqlca;
- MessageBox('Error','第'+String(i)+'行,更新相关询价单明细失败,'+sqlca.SQLErrText)
- RETURN 0
- END IF
-
- NEXT
- IF uo_price.getinfo(ll_billid,arg_msg) = 0 THEN
- MessageBox('error!',arg_msg)
- RETURN 0
- END IF
- IF uo_price.auditing(false,arg_msg) = 0 THEN
- MessageBox('error!',arg_msg)
- RETURN 0
- END IF
-
- ls_relquotecode = ls_code
-
- COMMIT Using sqlca;
-
- END IF
- UPDATE LJFIEB_tempquote
- SET fiebrelcode = :ls_relquotecode,
- flag = 1,
- ConfirmTime = getdate(),
- ConfirmUser = :publ_operator
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- ROLLBACK Using tr_eb_sqlca;
- MessageBox('Error','更新客户询价单相关报价单号失败,'+tr_eb_sqlca.SQLErrText)
- RETURN 0
- END IF
- dw_uc.Object.fiebrelcode[uc_row] = ls_relquotecode
- dw_uc.Object.flag[uc_row] = 1
- //更新本地通信记录
- UPDATE LJFIEB_packet
- SET status = 6,
- Complete = 1,
- ConfirmTime = getdate(),
- ConfirmUser = :publ_operator
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- ROLLBACK Using tr_eb_sqlca;
- MessageBox('Error','更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
- RETURN 0
- END IF
- RETURN 1
- end function
- on w_quote_receive_ljfieb.create
- int iCurrent
- call super::create
- this.dw_uc=create dw_uc
- this.dw_child=create dw_child
- this.mle_1=create mle_1
- this.st_1=create st_1
- this.st_2=create st_2
- this.sle_scname=create sle_scname
- this.cb_accept=create cb_accept
- this.cb_feedback=create cb_feedback
- this.cb_reject=create cb_reject
- this.mle_2=create mle_2
- this.st_3=create st_3
- this.cbx_audit=create cbx_audit
- this.cb_1=create cb_1
- this.ln_bar=create ln_bar
- this.ln_bar2=create ln_bar2
- this.ln_1=create ln_1
- this.ln_2=create ln_2
- this.r_bar=create r_bar
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_uc
- this.Control[iCurrent+2]=this.dw_child
- this.Control[iCurrent+3]=this.mle_1
- this.Control[iCurrent+4]=this.st_1
- this.Control[iCurrent+5]=this.st_2
- this.Control[iCurrent+6]=this.sle_scname
- this.Control[iCurrent+7]=this.cb_accept
- this.Control[iCurrent+8]=this.cb_feedback
- this.Control[iCurrent+9]=this.cb_reject
- this.Control[iCurrent+10]=this.mle_2
- this.Control[iCurrent+11]=this.st_3
- this.Control[iCurrent+12]=this.cbx_audit
- this.Control[iCurrent+13]=this.cb_1
- this.Control[iCurrent+14]=this.ln_bar
- this.Control[iCurrent+15]=this.ln_bar2
- this.Control[iCurrent+16]=this.ln_1
- this.Control[iCurrent+17]=this.ln_2
- this.Control[iCurrent+18]=this.r_bar
- end on
- on w_quote_receive_ljfieb.destroy
- call super::destroy
- destroy(this.dw_uc)
- destroy(this.dw_child)
- destroy(this.mle_1)
- destroy(this.st_1)
- destroy(this.st_2)
- destroy(this.sle_scname)
- destroy(this.cb_accept)
- destroy(this.cb_feedback)
- destroy(this.cb_reject)
- destroy(this.mle_2)
- destroy(this.st_3)
- destroy(this.cbx_audit)
- destroy(this.cb_1)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- destroy(this.ln_1)
- destroy(this.ln_2)
- destroy(this.r_bar)
- end on
- event open;call super::open;tr_eb_sqlca = sys_email_sqlca // 电子商务连接
- IF sys_email_sqlca.DBHandle() = 0 THEN
- MessageBox('Error','电子商务数据库连接失败,请检查')
- RETURN
- END IF
- dw_uc.settransobject(tr_eb_sqlca)
- dw_child.settransobject(tr_eb_sqlca)
- uo_price = CREATE uo_spt_price_change
- uo_price.commit_transaction = sqlca
- uo_fieb = Create uo_ljfieb
- uo_fieb.commit_transaction = tr_eb_sqlca
- s_inscust = Message.PowerObjectParm
- ins_sn = s_inscust.serialnum
- ins_sendid = s_inscust.sendcuscommid
- ins_receid = s_inscust.receivecuscommid
- ins_sendsccode = s_inscust.sendsccode
- ins_reccesccode = s_inscust.receivesccode
- ins_RelatedCode = s_inscust.RelatedCode
- ins_addtime = s_inscust.addtime
- ins_adduser = s_inscust.adduser
- String ls_sccode,ls_scname
- String arg_msg
- ls_sccode = s_inscust.receivesccode
- SELECT scid,scname
- INTO :ins_scid,:ls_scname
- FROM u_scdef
- Where sccode = :ls_sccode;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询分部信息失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- sle_scname.Text = ls_scname
- mle_1.Text = s_inscust.postscript
- mle_2.Text = s_inscust.remark
- long ll_status
- SELECT status INTO :ll_status
- FROM LJFIEB_packet
- Where serialnum = :ins_sn Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询通信数据失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- if ll_status <> 5 then
- cb_accept.enabled = false
- cb_reject.enabled = false
- end if
- IF wf_retrieve(ins_sn,ins_sendid,ins_sendsccode,arg_msg) = 0 THEN
- MessageBox('Error',arg_msg)
- RETURN
- END IF
- //更新对方状态-已打开
- string ls_SerialNum
- SELECT TOP 1 NEWID() INTO :ls_SerialNum
- From u_user Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- return
- END IF
- IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
- IF ls_SerialNum = '' THEN
- return
- END IF
- IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,5,'打开消息','','',ins_sn,'',0,arg_msg,True) = 0 THEN
- return
- END IF
- end event
- event resize;call super::resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- r_bar.width = this.width
- ln_1.endx = this.width
- ln_2.endx = this.width
- dw_child.width = this.WorkSpaceWidth() - 10
- mle_1.width = dw_child.width - dw_uc.width - 4
- mle_2.width = mle_1.width
- dw_child.height = this.workspaceheight() - dw_child.y - 30
- end event
- event close;call super::close;destroy uo_fieb
- destroy uo_price
- end event
- type cb_func from w_publ_base`cb_func within w_quote_receive_ljfieb
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_quote_receive_ljfieb
- integer x = 1426
- integer width = 183
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type dw_uc from datawindow within w_quote_receive_ljfieb
- integer y = 296
- integer width = 1966
- integer height = 764
- integer taborder = 30
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_quote_receive_ljfieb"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type dw_child from u_dw_rbtnfilter within w_quote_receive_ljfieb
- integer y = 1060
- integer width = 3584
- integer height = 1196
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "单据明细内容"
- string dataobject = "dw_quotemx_receive_ljfieb"
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- end type
- event rowfocuschanged;call super::rowfocuschanged; IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- this.setrow(currentrow)
- end event
- event clicked;call super::clicked; IF row <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(row,TRUE)
- this.setrow(row)
- end event
- event rbuttondown;call super::rbuttondown;Long ll_row,ll_column
- ll_row = This.GetRow()
- ll_column = This.GetColumn()
- IF ll_row <= 0 THEN RETURN
- IF ll_column <= 0 THEN RETURN
- IF Left( This.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
- s_calender_arg s_calender
-
- s_calender.PointerX = This.PointerX()
- s_calender.PointerY = This.PointerY()
- s_calender.X = This.X + Parent.X
- s_calender.Y = This.Y + Parent.Y
-
- OpenWithParm(w_calendar,s_calender)
- This.SetItem(ll_row,ll_column,id_date_selected)
- END IF
- end event
- type mle_1 from multilineedit within w_quote_receive_ljfieb
- integer x = 1975
- integer y = 364
- integer width = 1595
- integer height = 344
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean vscrollbar = true
- boolean autovscroll = true
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type st_1 from statictext within w_quote_receive_ljfieb
- integer x = 1979
- integer y = 300
- integer width = 142
- integer height = 56
- 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_2 from statictext within w_quote_receive_ljfieb
- integer x = 23
- integer y = 204
- integer width = 155
- 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 sle_scname from singlelineedit within w_quote_receive_ljfieb
- integer x = 210
- integer y = 188
- integer width = 443
- integer height = 84
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_accept from uo_imflatbutton within w_quote_receive_ljfieb
- integer width = 494
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "更新供应商询价单"
- string normalpicname = "ok.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF Not f_power_ind(3168) THEN
- MessageBox(publ_operator,sys_msg_pow)
- RETURN
- END IF
- String ls_code
- Long ll_row,cnt,ll_i,ll_cntmx
- String ls_msg
- Int li_flag,li_iffail = 0,li_returnflag
- Long ll_mtrlid,ll_billid
- String ls_status,ls_woodcode,ls_pcode
- Decimal ld_price
- ll_row = dw_uc.GetRow()
- IF ll_row <= 0 THEN RETURN
- IF dw_child.RowCount() <= 0 THEN
- MessageBox('系统提示','没有明细内容,无法更新')
- RETURN
- END IF
- IF MessageBox('询问','确定更新相关供应商询价单吗?',question!,yesno!) = 2 THEN RETURN
- ls_code = dw_uc.Object.fiebrelcode[ll_row]
- IF Trim(ls_code) = '' THEN
- // MessageBox('系统提示','没有相关供应商询价单')
- // RETURN
- li_iffail = 2
- GOTO deal
- END IF
- SELECT count(*)
- INTO :cnt
- FROM u_spt_price_change
- Where Billcode = :ls_code Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询供应商询价单信息失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF cnt <> 1 THEN
- ls_msg = '无法查询相关供应商询价单,可能已被删除'
- li_iffail = 1
- ELSE
- SELECT billid,flag
- INTO :ll_billid,:li_flag
- FROM u_spt_price_change
- Where Billcode = :ls_code Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询供应商询价单状态失败,'+sqlca.SQLErrText)
- RETURN
- END IF
-
- IF li_flag = 1 THEN
- ls_msg = '相关供应商询价单已审核'
- li_iffail = 1
- GOTO deal
- END IF
-
- //检查明细是否匹配
- FOR ll_i = 1 To dw_child.RowCount()
- ll_mtrlid = dw_child.Object.mtrlid_my[ll_i]
- ls_status = dw_child.Object.status[ll_i]
- ls_woodcode = dw_child.object.woodcode[ll_i]
- ls_pcode = dw_child.object.pcode[ll_i]
- ld_price = dw_child.Object.price[ll_i]
-
- ll_cntmx = 0
-
- SELECT count(*) INTO :ll_cntmx
- FROM u_spt_price_changemx
- WHERE billid = :ll_billid
- AND mtrlid = :ll_mtrlid
- And status = :ls_status
- and woodcode = :ls_woodcode
- and pcode = :ls_pcode Using sqlca;
- IF sqlca.SQLCode <> 0 THEN ll_cntmx = 0
-
- IF ll_cntmx = 0 THEN
- ls_msg = '相关供应商询价单与供应商报价单明细出现不匹配现象'
- li_iffail = 1
- END IF
- NEXT
- END IF
- //出现异常,让用户选择处理方式
- deal:
- Int li_ifaudit
- IF cbx_audit.Checked THEN
- li_ifaudit = 1
- ELSE
- li_ifaudit = 0
- END IF
- IF li_iffail = 1 THEN
- OpenWithParm(w_sptprice_deal_ljfieb,ls_msg)
-
- li_returnflag = Message.DoubleParm
-
- IF li_returnflag = 0 THEN
- RETURN
- ELSEIF li_returnflag = 1 THEN
- //重新建立新的单据
- IF wf_add_quote(1,li_ifaudit) = 0 THEN RETURN
- END IF
- ELSEIF li_iffail = 2 THEN
- //没有询价,供应商直接报价,不询问直接新建询价单
- IF wf_add_quote(1,li_ifaudit) = 0 THEN RETURN
- ELSE
- //直接更新
- IF wf_add_quote(0,li_ifaudit) = 0 THEN RETURN
-
- END IF
- String arg_msg
- String ls_SerialNum
- SELECT TOP 1 NEWID() INTO :ls_SerialNum
- From u_user Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK Using sqlca;
- MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
- IF ls_SerialNum = '' THEN
- MessageBox('Error','错误的发送序列号')
- RETURN
- END IF
- IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,6,'安排报价','','',ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
- MessageBox('系统提示','发送确认指令失败 '+arg_msg)
- RETURN
- END IF
- MessageBox('系统提示','操作成功!')
- Close(Parent)
- end event
- type cb_feedback from uo_imflatbutton within w_quote_receive_ljfieb
- integer x = 494
- integer width = 494
- integer height = 164
- integer taborder = 10
- boolean bringtotop = true
- string text = "相关供应商询价单"
- string normalpicname = "open.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;Long ll_row
- String ls_code
- Long cnt
- ll_row = dw_uc.GetRow()
- IF ll_row <= 0 THEN RETURN
- ls_code = dw_uc.Object.fiebrelcode[ll_row]
- IF Trim(ls_code) = '' THEN
- MessageBox('系统提示','没有相关供应商询价单')
- RETURN
- END IF
- SELECT count(*)
- INTO :cnt
- FROM u_spt_price_change
- Where Billcode = :ls_code Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询销售报价单信息失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF cnt = 0 THEN
- MessageBox('询问','无法查询相关销售报价单,可能已被删除')
- RETURN
- ELSE
- f_open_win(ins_scid,ls_code)
- END IF
- end event
- type cb_reject from uo_imflatbutton within w_quote_receive_ljfieb
- integer x = 987
- integer width = 219
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "拒绝"
- string normalpicname = "DELETE.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF Not f_power_ind(3169) THEN
- MessageBox(publ_operator,sys_msg_pow)
- RETURN
- END IF
- String arg_summary,arg_postscript,arg_remark
- String arg_msg
- String ls_SerialNum
- SELECT TOP 1 NEWID() INTO :ls_SerialNum
- From u_user Using sqlca;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK Using sqlca;
- MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
- RETURN
- END IF
- IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
- IF ls_SerialNum = '' THEN
- MessageBox('Error','错误的发送序列号')
- RETURN
- END IF
- s_packet_ljfieb s_pack,s_return
- //s_pack.summary = '拒绝订单:'+ins_RelatedCode
- OpenWithParm(w_dscrp_edit_ljfieb,s_pack)
- s_return = Message.PowerObjectParm
- IF s_return.returnflag <> 1 THEN RETURN
- //arg_summary = s_return.summary
- arg_postscript = s_return.postscript
- arg_remark = s_return.remark
- UPDATE LJFIEB_tempquote
- SET flag = 2
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- ROLLBACK Using tr_eb_sqlca;
- MessageBox('Error','更新供应商报价单状态失败,'+tr_eb_sqlca.SQLErrText)
- RETURN 0
- END IF
- //更新本地通信记录
- UPDATE LJFIEB_packet
- SET status = 10,
- Complete = 1
- Where SerialNum = :ins_sn Using tr_eb_sqlca;
- IF tr_eb_sqlca.SQLCode <> 0 THEN
- ROLLBACK Using tr_eb_sqlca;
- MessageBox('Error', '更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
- RETURN
- END IF
- IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,11,arg_summary,arg_postscript,arg_remark,ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
- MessageBox('系统提示','发送确认指令失败 '+arg_msg)
- RETURN
- END IF
- MessageBox('系统提示','操作成功')
- Close(Parent)
- end event
- type mle_2 from multilineedit within w_quote_receive_ljfieb
- integer x = 1975
- integer y = 788
- integer width = 1595
- integer height = 264
- integer taborder = 50
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean vscrollbar = true
- boolean autovscroll = true
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type st_3 from statictext within w_quote_receive_ljfieb
- integer x = 1984
- integer y = 728
- integer width = 178
- 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 cbx_audit from checkbox within w_quote_receive_ljfieb
- integer x = 722
- integer y = 196
- integer width = 795
- 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 constructor;IF Not (f_power_ind(115) Or f_power_ind(426)) THEN
- This.Visible = False
- This.Checked = False
- ELSE
- This.Visible = True
- Int if_audit
- if_audit = Integer(f_ProfileString (sys_empid,'w_quote_receive_ljfieb', "if_audit", '0'))
- IF if_audit = 0 THEN
- This.Checked = False
- ELSE
- This.Checked = True
- END IF
- END IF
- end event
- event clicked;Int if_audit
- IF This.Checked THEN
- if_audit = 1
- ELSE
- if_audit = 0
- END IF
- f_SetProfileString (sys_empid,'w_quote_receive_ljfieb', "if_audit", String(if_audit))
- end event
- type cb_1 from uo_imflatbutton within w_quote_receive_ljfieb
- integer x = 1207
- integer width = 219
- integer height = 164
- integer taborder = 40
- 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;openwithparm(w_mtrl_receive_ljfieb, '')
- string arg_msg
- IF wf_retrieve(ins_sn,ins_sendid,ins_sendsccode,arg_msg) = 0 THEN
- MessageBox('Error',arg_msg)
- RETURN
- END IF
- end event
- type ln_bar from line within w_quote_receive_ljfieb
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 172
- integer endx = 3200
- integer endy = 172
- end type
- type ln_bar2 from line within w_quote_receive_ljfieb
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = 9
- integer beginy = 176
- integer endx = 3273
- integer endy = 176
- end type
- type ln_1 from line within w_quote_receive_ljfieb
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 284
- integer endx = 3250
- integer endy = 284
- end type
- type ln_2 from line within w_quote_receive_ljfieb
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 288
- integer endx = 3282
- integer endy = 288
- end type
- type r_bar from rectangle within w_quote_receive_ljfieb
- long linecolor = 16777215
- integer linethickness = 4
- long fillcolor = 1073741824
- integer x = 3351
- integer width = 87
- integer height = 68
- end type
- event constructor;this.fillcolor = 14215660
- this.linecolor = 14215660
- this.x = -1
- this.y = -1
- this.height = ln_bar.beginy - 5
- end event
|