12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099 |
- $PBExportHeader$uo_quote.sru
- forward
- global type uo_quote from nonvisualobject
- end type
- type s_quotemx from structure within uo_quote
- end type
- end forward
- type s_quotemx from structure
- long mtrlid
- string mtrlcode
- long printid
- decimal { 10 } maxprice
- decimal { 10 } planprice
- string mxdscrp
- decimal { 10 } wfjgprice
- decimal { 10 } profit_margin
- decimal { 10 } sumprice
- decimal { 10 } sumprice_1
- decimal { 10 } outcost
- decimal { 10 } mancost
- decimal { 10 } mtrlcost
- string pfcode
- string status
- string woodcode
- string pcode
- decimal { 10 } qty
- decimal { 10 } qty1
- decimal { 5 } rebate
- string dscrp_text
- string mtrlname
- string mtrlmode
- string unit
- string mxdscrp2
- decimal { 10 } paintarea
- decimal { 10 } commonqty
- decimal { 10 } customqty
- decimal { 5 } taxrate
- decimal { 10 } fprice
- end type
- global type uo_quote from nonvisualobject
- end type
- global uo_quote uo_quote
- type variables
- PUBLIC PROTECTEDWRITE Long scid = 0
- PUBLIC PROTECTEDWRITE Long quoteID = 0
- PUBLIC PROTECTEDWRITE String quoteCode = ''
- PUBLIC PROTECTEDWRITE DateTime opdate
- PUBLIC PROTECTEDWRITE String operator = ''
- PUBLIC PROTECTEDWRITE String Permit_emp = ''//审核操作员
- public protectedwrite datetime moddate //修改时间,自动
- public protectedwrite string modemp //修改操作员
- public protectedwrite int flag=0 //审核标志
- public protectedwrite datetime auditingdate //审核时间
- Long custID = 0
- String Assign_emp
- DateTime quotedate
- String dscrp
- string relcode
- long moneyid
- int billtype
- datetime sendTime
- string sendUser,fiebrelcode
- decimal mrate
- Long audit_buildtype
- Transaction commit_transaction
- PRIVATE:
- s_quotemx quotemx[] //明细结构数组
- Long it_MXBT = 0 //明细结构数组末指针
- Boolean IT_NEWBEGIN = FALSE //新建标志
- Boolean IT_UPDATEBEGIN = FALSE//修改标志
- string uo_option_change_status,uo_option_change_woodcode,uo_option_change_pcode
- int uo_option_if_oa_quote,uo_option_quote_secaudit
- end variables
- forward prototypes
- public function integer p_reset ()
- public function integer p_clearmx ()
- public function integer newbegin (long arg_scid, ref string arg_msg)
- public function integer save (string arg_operator, ref string arg_msg, boolean arg_ifcommit)
- public function integer add_dscrp (long arg_scid, long arg_quoteid, string arg_newdescppart, ref string arg_msg, boolean arg_ifcommit)
- public function integer cancel (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit)
- public function integer p_getinfo (long arg_scid, long arg_quoteid, ref string arg_msg)
- public function integer updatebegin (long arg_scid, long arg_quoteid, ref string arg_msg)
- public function integer audit (long arg_scid, long arg_quoteid, string arg_emp, ref string arg_msg, boolean arg_ifcommit)
- public function integer cancelaudit (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit)
- public function integer uof_audit_mx (long arg_scid, long arg_quoteid, long arg_printid, integer arg_flag, string arg_opemp, ref string arg_msg, boolean arg_ifcommit)
- public function integer getinfo (long arg_scid, long arg_quoteid, ref string arg_msg)
- public function integer uof_update_suliao (long arg_scid, long arg_quoteid, long arg_printid, s_quotesuliao arg_s_sl, ref string arg_msg, boolean arg_ifcommit)
- public function integer sec_audit (long arg_scid, long arg_quoteid, string arg_emp, ref string arg_msg, boolean arg_ifcommit)
- public function integer cancelsecaudit (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit)
- public function integer uof_stop_mx (long arg_scid, long arg_quoteid, long arg_printid, integer arg_flag, string arg_opemp, ref string arg_msg, boolean arg_ifcommit)
- public function integer uof_update_mx (long arg_scid, long arg_quoteid, long arg_printid, decimal arg_sumprice, decimal arg_sumprice_1, decimal arg_profit_margin, decimal arg_mtrlcost, decimal arg_mancost, decimal arg_outcost, decimal arg_wfjgprice, decimal arg_paintarea, decimal arg_commonqty, decimal arg_customqty, string arg_pfcode, s_quote_rqmtrl arg_rqmtrl, s_quote_workprice arg_workprice, ref string arg_msg, boolean arg_ifcommit)
- public function integer acceptmx (long arg_mtrlid, string arg_mtrlcode, string arg_mtrlname, string arg_mtrlmode, string arg_unit, string arg_mxdscrp, ref string arg_msg, long arg_printid, decimal arg_sumprice, decimal arg_sumprice_1, string arg_status, string arg_woodcode, string arg_pcode, decimal arg_maxprice, decimal arg_planprice, decimal arg_profit_margin, decimal arg_wfjgprice, decimal arg_outcost, decimal arg_mancost, decimal arg_mtrlcost, decimal arg_qty, decimal arg_qty1, decimal arg_rebate, string arg_dscrp_text, string arg_mxdscrp2, decimal arg_paintarea, decimal arg_commonqty, decimal arg_customqty, decimal arg_taxrate)
- end prototypes
- public function integer p_reset ();
- quoteID = 0
- quoteCode = ''
- operator = ''
- sendUser = ''
- fiebrelcode = ''
- mrate = 0
- flag = 0 //审核标志
- custID = 0
- Assign_emp = ''
- dscrp = ''
- relcode = ''
- it_newbegin = FALSE
- it_updatebegin = FALSE
- //清除明细
- P_CLEARMX()
- RETURN 1
- end function
- public function integer p_clearmx ();//INT p_clearmx()
- //清除明细
- it_mxbt=0
- RETURN 1
- end function
- public function integer newbegin (long arg_scid, ref string arg_msg);//重置对象,设定业务类型与关联ID,准备建立新单
- //0 fail 1 success
- long rslt=1,CNT=0
- if arg_scid < 0 then
- arg_msg = '请选择分部'
- rslt = 0
- goto ext
- end if
- p_reset()
- it_newbegin=TRUE
- it_updatebegin=FALSE
- scid=arg_scid
- ext:
- if rslt = 0 then p_reset()
- return rslt
- end function
- public function integer save (string arg_operator, ref string arg_msg, boolean arg_ifcommit);Integer rslt = 1,cnt = 0,i
- DateTime server_dt
- Long ll_quoteid
- String ls_sccode
- IF IsNull(dscrp) THEN dscrp = ''
- IF IsNull(assign_emp) THEN assign_emp = ''
- IF IsNull(arg_operator) THEN arg_operator = ''
- IF IsNull(sendUser) THEN sendUser = ''
- IF IsNull(fiebrelcode) THEN fiebrelcode = ''
- IF IsNull(billtype) THEN billtype = 0
- IF IsNull(mrate) THEN mrate = 1
- //====================================================================
- // Script - save ( ref string arg_msg, boolean arg_ifcommit )
- // Reason:
- //--------------------------------------------------------------------
- // Modified By: yyx Date: 2004.02.20
- //--------------------------------------------------------------------
- //IF Len(dscrp) > 0 THEN dscrp = ' ' + dscrp
- //====================================================================
- operator = arg_operator
- IF it_newbegin = False And it_updatebegin = False THEN
- rslt = 0
- arG_MSG = "非编辑状态不可以提交"
- GOTO ext
- END IF
- IF Trim(assign_emp) = '' THEN
- rslt = 0
- arG_MSG = "请输入装箱单经手人"
- GOTO ext
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_cust
- Where cusid = :custID Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "查询操作失败,客户资料"
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 0
- arG_MSG = "客户未定义或错误"
- GOTO ext
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM cw_currency
- Where moneyid = :moneyid;
- IF commit_transaction.SQLCode <> 0 THEN
- arG_MSG = '查询币种失败'
- rslt = 0
- GOTO ext
- END IF
- IF cnt = 0 THEN
- arG_MSG = '币种资料不存在'
- rslt = 0
- GOTO ext
- END IF
- IF mrate = 0 THEN
- arG_MSG = '币种汇率错误'
- rslt = 0
- GOTO ext
- END IF
- IF f_moneyid_rate_check(moneyid,mrate,arG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- SELECT Top 1 getdate() Into :server_dt From u_user Using commit_transaction;
- //取得系统时间,借用操作员表
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "查询操作失败,日期 "
- GOTO ext
- END IF
- IF f_check_inoutdate(0,quotedate,False,arG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF it_mxbt = 0 THEN //如果输入物料资料错则已经清空
- rslt = 0
- arG_MSG = "没有正确报价单明细内容"
- GOTO ext
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_user
- Where username = :arg_operator Using commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "查询操作失败,操作员!"
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 0
- arG_MSG = "操作员姓名未登记或已取消!"
- GOTO ext
- END IF
- opdate = server_dt //填写单据建立时间(最近修改时间)
- ////////////////////////////////////////////////// //开始区分:新建/更新 处理
- IF quoteID = 0 THEN //新建
-
- ll_quoteid = f_sys_scidentity(scid,"u_quote","quoteID",arG_MSG,True,id_sqlca) //数据commit事务)
- IF ll_quoteid <= 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- IF f_get_sccode(scid,commit_transaction,ls_sccode,arG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- IF billtype = 0 THEN
- quoteCode = getid(scid,ls_sccode + 'BJ',Date(server_dt),False,commit_transaction)
- IF quoteCode = "err" THEN
- quoteCode = ''
- rslt = 0
- arG_MSG = "无法获取报价单编号"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- ELSEIF billtype = 1 THEN
- quoteCode = getid(scid,ls_sccode + 'QR',Date(server_dt),False,commit_transaction)
- IF quoteCode = "err" THEN
- quoteCode = ''
- rslt = 0
- arG_MSG = "无法获取报价单编号"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- END IF
-
- INSERT INTO u_quote
- ( scid,
- quoteid,
- quoteCode,
- cusID,
- quotedate,
- Assign_Emp,
- relcode,
- flag,
- Dscrp,
- opemp,
- opdate,
- moneyid,
- fiebrelcode,
- billtype,
- mrate
- )
- VALUES ( :scid,
- :ll_quoteid,
- :quoteCode,
- :custID,
- :quotedate,
- :Assign_Emp,
- :relcode,
- 0,
- :Dscrp,
- :operator,
- :server_dt,
- :moneyid,
- :fiebrelcode,
- :billtype,
- :mrate) Using commit_transaction ;
-
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "因网络或其它原因导致插入报价单操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- //读取新quoteid
- quoteID = ll_quoteid
-
- FOR i = 1 To it_mxbt
- INSERT INTO u_quotemx
- ( scid,
- quoteid,
- mtrlid,
- printid,
- maxprice,
- planprice,
- mxdscrp,
- sumprice,
- sumprice_1,
- pfcode,
- status,
- woodcode,
- pcode,
- profit_margin,
- wfjgprice,
- outcost,
- mancost,
- mtrlcost,
- qty,
- qty1,
- rebate,
- mtrlcode,
- mtrlname,
- mtrlmode,
- unit,
- paintarea,
- commonqty,
- customqty,
- mxdscrp2,
- taxrate,
- fprice)
- VALUES (:scid,
- :ll_quoteid,
- :quotemx[i].mtrlid,
- :quotemx[i].printid,
- :quotemx[i].maxprice ,
- :quotemx[i].planprice ,
- :quotemx[i].mxdscrp,
- :quotemx[i].sumprice,
- :quotemx[i].sumprice_1,
- :quotemx[i].pfcode,
- :quotemx[i].status,
- :quotemx[i].woodcode,
- :quotemx[i].pcode,
- :quotemx[i].profit_margin,
- :quotemx[i].wfjgprice,
- :quotemx[i].outcost,
- :quotemx[i].mancost,
- :quotemx[i].mtrlcost,
- :quotemx[i].qty,
- :quotemx[i].qty1,
- :quotemx[i].rebate,
- :quotemx[i].mtrlcode,
- :quotemx[i].mtrlname,
- :quotemx[i].mtrlmode,
- :quotemx[i].unit,
- :quotemx[i].paintarea,
- :quotemx[i].commonqty,
- :quotemx[i].customqty,
- :quotemx[i].mxdscrp2,
- :quotemx[i].taxrate,
- :quotemx[i].fprice) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- quoteID = 0 //还原quoteID
- rslt = 0
- arG_MSG = "因网络或其它原因导致插入明细操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- IF Len(Trim(quotemx[i].dscrp_text)) > 0 THEN
- INSERT INTO u_quotemx_dscrp
- (scid,
- quoteid,
- printid,
- dscrp)
- VALUES
- (:scid,
- :ll_quoteid,
- :quotemx[i].printid,
- :quotemx[i].dscrp_text) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- quoteID = 0 //还原quoteID
- rslt = 0
- arG_MSG = "因网络或其它原因导致插入明细备注操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- END IF
-
- NEXT
-
- ELSE //////////////////////////////////////////////// //更新
- UPDATE u_quote
- SET cusID = :custID,
- quotedate = :quotedate,
- Assign_Emp = :Assign_Emp,
- Dscrp = :Dscrp,
- moddate = getdate(),
- Modemp = :publ_operator,
- relcode = :relcode,
- moneyid = :moneyid,
- fiebrelcode = :fiebrelcode,
- mrate = :mrate
- WHERE u_quote.quoteid = :quoteID
- AND scid = :scid
- And flag = 0 Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 Or sqlca.SQLNRows <= 0 THEN
- rslt = 0
- arG_MSG = "因网络或其它原因导致更新报价单操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- //删除原有明细
- DELETE FROM u_quotemx
- WHERE quoteID = :quoteID
- And scid = :scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "删除旧有明细操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- DELETE FROM u_quoterqmtrl
- WHERE quoteID = :quoteID
- And scid = :scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "删除明细成本操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- DELETE FROM u_quoteworkprice
- WHERE quoteID = :quoteID
- And scid = :scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "删除明细成本操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- //删除原有明细
- DELETE FROM u_quotemx_dscrp
- Where quoteID = :quoteID And scid = :scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "删除旧有明细备注操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- FOR i = 1 To it_mxbt
- INSERT INTO u_quotemx
- ( scid,
- quoteid,
- mtrlid,
- printid,
- maxprice,
- planprice,
- mxdscrp,
- sumprice,
- sumprice_1,
- pfcode,
- status,
- woodcode,
- pcode,
- profit_margin,
- wfjgprice,
- outcost,
- mancost,
- mtrlcost,
- qty,
- qty1,
- rebate,
- mtrlcode,
- mtrlname,
- mtrlmode,
- unit,
- paintarea,
- commonqty,
- customqty,
- mxdscrp2,
- taxrate,
- fprice)
- VALUES (:scid,
- :quoteID,
- :quotemx[i].mtrlid,
- :quotemx[i].printid,
- :quotemx[i].maxprice ,
- :quotemx[i].planprice ,
- :quotemx[i].mxdscrp,
- :quotemx[i].sumprice,
- :quotemx[i].sumprice_1,
- :quotemx[i].pfcode,
- :quotemx[i].status,
- :quotemx[i].woodcode,
- :quotemx[i].pcode,
- :quotemx[i].profit_margin,
- :quotemx[i].wfjgprice,
- :quotemx[i].outcost,
- :quotemx[i].mancost,
- :quotemx[i].mtrlcost,
- :quotemx[i].qty,
- :quotemx[i].qty1,
- :quotemx[i].rebate,
- :quotemx[i].mtrlcode,
- :quotemx[i].mtrlname,
- :quotemx[i].mtrlmode,
- :quotemx[i].unit,
- :quotemx[i].paintarea,
- :quotemx[i].commonqty,
- :quotemx[i].customqty,
- :quotemx[i].mxdscrp2,
- :quotemx[i].taxrate,
- :quotemx[i].fprice) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "因网络或其它原因导致插入明细操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
-
-
- IF Len(Trim(quotemx[i].dscrp_text)) > 0 THEN
- INSERT INTO u_quotemx_dscrp
- (scid,
- quoteid,
- printid,
- dscrp)
- VALUES
- (:scid,
- :quoteID,
- :quotemx[i].printid,
- :quotemx[i].dscrp_text) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- quoteID = 0 //还原quoteID
- rslt = 0
- arG_MSG = "因网络或其它原因导致插入明细备注操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- END IF
- NEXT
- END IF
- it_newbegin = False
- it_updatebegin = False
- ext:
- IF rslt = 0 THEN
- p_clearmx()
- ROLLBACK Using commit_transaction;
- ELSEIF arg_ifcommit And rslt = 1 THEN
- COMMIT Using commit_transaction;
- END IF
- Return(rslt)
- end function
- public function integer add_dscrp (long arg_scid, long arg_quoteid, string arg_newdescppart, ref string arg_msg, boolean arg_ifcommit);//add_dscrp(string arg_newdescppart)
- //0 fail 1 SUCCESS
- Int rslt = 1
- arg_newdescppart = Trim(arg_newdescppart)
- IF it_updatebegin OR it_newbegin THEN
- rslt = 0
- arG_MSG = "编辑状态下不可用"
- GOTO ext
- END IF
- IF arg_newdescppart = '' THEN
- rslt = 0
- arG_MSG = "要添加内容为空,操作取消"
- GOTO ext
- END IF
- IF p_getinfo(arg_scid,arg_quoteid,arG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag = 0 THEN
- rslt = 0
- arG_MSG = "待审核状态下不可用"
- GOTO ext
- END IF
- UPDATE u_quote
- SET DSCRP = DSCRP+' '+:arg_newdescppart
- Where u_quote.quoteid = :arg_quoteid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "因网络或其它原因导致添加报价单备注操作失败"+"~n"+commit_transaction.SQLErrText
- ROLLBACK USING commit_transaction;
- GOTO ext
- END IF
- DSCRP = DSCRP+' '+arg_newdescppart
- it_newbegin = FALSE
- it_updatebegin = FALSE
- ext:
- IF arg_ifcommit AND rslt = 1 THEN
- COMMIT USING commit_transaction;
- END IF
- p_reset()
- Return (rslt)
- end function
- public function integer cancel (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit);//删除未审核的装箱单
- //0 FAIL, 1 SUCCESS
- Int rslt = 1
- IF arg_quoteid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误装箱单唯一码'
- GOTO ext
- END IF
- IF p_getinfo(arg_scid,arg_quoteid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag = 1 THEN
- rslt = 0
- ARG_MSG = "装箱单已经审核,不可以删除"
- GOTO ext
- END IF
- DELETE FROM u_quoterqmtrl
- WHERE u_quoterqmtrl.quoteid = :arg_quoteid
- And u_quoterqmtrl.scid = :arg_scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "删除报价单用料明细操作失败"+"~n"+SQLCA.SQLErrText
- ROLLBACK Using commit_transaction;
- GOTO ext
- END IF
- DELETE FROM u_quotemx
- WHERE u_quotemx.quoteid = :arg_quoteid
- And u_quotemx.scid = :arg_scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "删除报价单明细操作失败"+"~n"+SQLCA.SQLErrText
- ROLLBACK Using commit_transaction;
- GOTO ext
- END IF
- //删除原有明细
- DELETE FROM u_quotemx_dscrp
- Where quoteid = :arg_quoteid And scid = :arg_scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "删除旧有明细备注操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- DELETE FROM u_quote
- WHERE u_quote.quoteid = :arg_quoteid
- And u_quote.scid = :arg_scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "删除报价单操作失败"+"~n"+commit_transaction.SQLErrText
- ROLLBACK Using commit_transaction;
- GOTO ext
- END IF
- it_newbegin = False
- it_updatebegin = False
- IF arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- ext:
- p_reset()
- Return (rslt)
- end function
- public function integer p_getinfo (long arg_scid, long arg_quoteid, ref string arg_msg);Int rslt = 1
- SELECT quotecode,
- cusid,
- quotedate,
- assign_emp,
- relcode,
- dscrp,
- opemp,
- opdate,
- flag,
- moneyid,
- billtype,
- mrate
- INTO :quotecode,
- :custid,
- :quotedate,
- :assign_emp,
- :relcode,
- :dscrp,
- :operator,
- :opdate,
- :flag,
- :moneyid,
- :billtype,
- :mrate
- FROM u_quote
- WHERE u_quote.quoteid = :arg_quoteid AND
- u_quote.scid = :arg_scid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = '查询报价单内容失败(错误订单唯一码)'+sqlca.SQLErrText
- GOTO ext
- END IF
- scid = arg_scid
- quoteid = arg_quoteid
- ext:
- RETURN rslt
- end function
- public function integer updatebegin (long arg_scid, long arg_quoteid, ref string arg_msg);//UPDATEbegin(long arg_taskid,ref string arg_msg)
- //从置对象,设定业务类型与关联ID,准备更新单
- //0 fail 1 success
- long rslt=1,CNT=0
- if arg_scid < 0 then
- arg_msg = '请选择分部'
- rslt = 0
- goto ext
- end if
- IF arg_quoteid<=0 THEN
- rslt=0
- ARG_MSG='错误报价单唯一码'
- goto ext
- end if
- if p_getinfo(arg_scid,arg_quoteid,arg_msg)=0 then
- rslt=0
- goto ext
- end if
- if flag=1 then
- rslt=0
- ARG_MSG='已经处于审核状态,不可以修改,要修改请先撤销审核'
- goto ext
- end if
- it_newbegin=FALSE
- it_updatebegin=TRUE
- p_clearmx() //清除明细
- scid=arg_scid
- quoteid=arg_quoteid
- ext:
- if rslt=0 then p_reset()
- return rslt
- end function
- public function integer audit (long arg_scid, long arg_quoteid, string arg_emp, ref string arg_msg, boolean arg_ifcommit);
- Int rslt = 1,cnt = 0
- Long i
- uo_cusprice uo_update_cusprice
- uo_update_cusprice = Create uo_cusprice
- IF uo_option_if_oa_quote = -1000 THEN
- rslt = 0
- arg_msg = '选项:[235]销售报价单使用OA审批流程,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF uo_option_quote_secaudit = -1000 THEN
- rslt = 0
- arg_msg = '选项:[236]销售报价单使用二级审核,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF arg_quoteid <= 0 THEN
- rslt = 0
- arg_msg = '错误报价单唯一码'
- GOTO ext
- END IF
- IF getinfo(arg_scid,arg_quoteid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag <> 0 THEN
- rslt = 0
- arg_msg = "销售报价单已经审核,操作取消"
- GOTO ext
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_user
- Where username = :arg_emp Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "查询操作失败,操作员!"
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 0
- arg_msg = "操作员姓名未登记或已取消!"
- GOTO ext
- END IF
- FOR i = 1 To it_mxbt
- IF quotemx[i].sumprice_1 <= 0 THEN
- rslt = 0
- arg_msg = '第'+String(i)+'行,请输入客户还价'
- GOTO ext
- END IF
-
- // IF uo_update_cusprice.uof_update_custprice(0,0,custID,&
- // quotemx[i].mtrlid,quotemx[i].mtrlcode,quotemx[i].status,&
- // quotemx[i].woodcode,quotemx[i].pcode,&
- // quoteID,quoteCode,quotedate,quotemx[i].sumprice_1,&
- // quotemx[i].rebate,quotemx[i].sumprice_1 * quotemx[i].rebate * quotemx[i].qty,2,'',&
- // quotemx[i].printid,2,moneyid,FALSE,ARG_MSG) = 0 THEN
- // rslt = 0
- // GOTO ext
- // END IF
- NEXT
- //更新审核标记
- UPDATE u_quote
- SET auditingrep = :arg_emp,
- auditingdate = getdate(),
- flag = 4
- WHERE u_quote.quoteID = :arg_quoteid
- AND u_quote.scid = :arg_scid
- AND u_quote.flag = 0
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致单据审核操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- it_newbegin = False
- it_updatebegin = False
- IF uo_option_if_oa_quote = 1 And uo_option_quote_secaudit = 1 THEN
- IF f_oa(sqlca,False,arg_msg,461,arg_scid,arg_quoteid,quoteCode,relcode,dscrp) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- p_reset()
- Return (rslt)
- end function
- public function integer cancelaudit (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1,cnt = 0
- Long i
- DateTime ls_auditingdate
- SetNull(ls_auditingdate)
- IF uo_option_if_oa_quote = -1000 THEN
- rslt = 0
- arg_msg = '选项:[235]销售报价单使用OA审批流程,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF uo_option_quote_secaudit = -1000 THEN
- rslt = 0
- arg_msg = '选项:[236]销售报价单使用二级审核,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- uo_cusprice uo_update_cusprice
- uo_update_cusprice = Create uo_cusprice
- IF arg_quoteid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误报价单唯一码'
- GOTO ext
- END IF
- IF uo_option_if_oa_quote = 1 And uo_option_quote_secaudit = 1 THEN
- IF f_check_if_oaflow_caudit(arg_scid,arg_quoteid,461,ARG_MSG ) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF getinfo(arg_scid,arg_quoteid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag <> 4 THEN
- rslt = 0
- ARG_MSG = "报价只有在待终审状态才可以执行撤销初审,请核对"
- GOTO ext
- END IF
- UPDATE u_quote
- SET flag = 0,
- auditingrep = '',
- auditingdate = :ls_auditingdate
- WHERE u_quote.quoteid = :arg_quoteid
- AND u_quote.scid = :arg_scid
- AND u_quote.flag = 4
- Using commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "因网络或其它原因导致报价单撤消审核操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- // //删除旧有物料需求记录
- //DELETE FROM u_quoterqmtrl
- // WHERE u_quoterqmtrl.quoteid = :arg_quoteid
- // AND u_quoterqmtrl.scid = :arg_scid;
- //IF sqlca.SQLCode <> 0 THEN
- // ROLLBACK;
- // ARG_MSG = '删除旧有物料需求记录失败 '+sqlca.SQLErrText
- // rslt = 0
- // GOTO ext
- //END IF
- //
- //FOR i = 1 TO it_mxbt
- // IF uo_update_cusprice.uof_del_cusprice_auto(custid,quoteid,&
- // quotemx[i].printid,quotemx[i].mtrlid,quotemx[i].status,&
- // quotemx[i].woodcode,quotemx[i].pcode,&
- // 2,moneyid,FALSE,ARG_MSG) = 0 THEN
- // rslt = 0
- // GOTO ext
- // END IF
- //NEXT
- it_newbegin = False
- it_updatebegin = False
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- Destroy uo_update_cusprice
- p_reset()
- Return (rslt)
- end function
- public function integer uof_audit_mx (long arg_scid, long arg_quoteid, long arg_printid, integer arg_flag, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Int li_flag
- DateTime null_dt
- SetNull(null_dt)
- SELECT flag INTO :li_flag
- FROM u_quote
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询报价单审核标记失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF li_flag = 0 THEN
- IF arg_flag = 1 THEN
- arg_msg = '报价单还未审核,不能明细审核'
- ELSE
- arg_msg = '报价单还未审核,不能明细撤审'
- END IF
- rslt = 0
- GOTO ext
- END IF
- SELECT flag INTO :li_flag
- FROM u_quotemx
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- AND printid = :arg_printid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询明细审核标记失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF arg_flag = 1 THEN
- IF li_flag = 1 THEN
- arg_msg = '明细已审核不能再审核'
- rslt = 0
- GOTO ext
- END IF
- ELSE
- IF li_flag = 0 THEN
- arg_msg = '明细还未审核不能撤审'
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF arg_flag = 1 THEN
- UPDATE u_quotemx SET
- flag = 1,
- auditemp = :arg_opemp,
- auditdate = getdate()
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- AND printid = :arg_printid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '审核明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ELSE
- UPDATE u_quotemx SET
- flag = 0,
- auditemp = '',
- auditdate = :null_dt
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- AND printid = :arg_printid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '审核明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK USING commit_transaction;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT USING commit_transaction;
- END IF
- RETURN rslt
- end function
- public function integer getinfo (long arg_scid, long arg_quoteid, ref string arg_msg);Int rslt = 1
- Long i = 1
- Long no_mxcheck
- IF arg_quoteid <= 0 THEN
- rslt = 0
- arg_msg = "非法销售报价单唯一码"
- GOTO ext
- END IF
- rslt = p_getinfo(arg_scid,arg_quoteid,arg_msg)
- IF rslt = 0 THEN GOTO ext
- DECLARE cur_quotemx CURSOR FOR
- SELECT u_quotemx.printid,
- u_quotemx.mtrlid,
- u_quotemx.sumprice,
- u_quotemx.sumprice_1,
- u_quotemx.qty,
- u_quotemx.qty1,
- u_quotemx.mxDscrp,
- u_quotemx.status,
- u_quotemx.woodcode,
- u_quotemx.pcode,
- u_quotemx.rebate,
- u_quotemx.mtrlcode,
- u_quotemx.fprice
- FROM u_quotemx
- WHERE u_quotemx.scid = :arg_scid
- AND u_quotemx.quoteid = :arg_quoteid USING commit_transaction;
-
- OPEN cur_quotemx;
- FETCH cur_quotemx INTO :quotemx[i].printid,:quotemx[i].mtrlid,
- :quotemx[i].sumprice,:quotemx[i].sumprice_1,:quotemx[i].qty,:quotemx[i].qty1,:quotemx[i].mxdscrp,
- :quotemx[i].status,:quotemx[i].woodcode,:quotemx[i].pcode,:quotemx[i].rebate,:quotemx[i].mtrlcode,
- :quotemx[i].fprice;
-
- DO WHILE commit_transaction.SQLCode = 0
- i++
- FETCH cur_quotemx INTO :quotemx[i].printid,:quotemx[i].mtrlid,
- :quotemx[i].sumprice,:quotemx[i].sumprice_1,:quotemx[i].qty,:quotemx[i].qty1,:quotemx[i].mxdscrp,
- :quotemx[i].status,:quotemx[i].woodcode,:quotemx[i].pcode,:quotemx[i].rebate,:quotemx[i].mtrlcode,
- :quotemx[i].fprice;
- LOOP
- close cur_quotemx;
- SELECT count(*) INTO :no_mxcheck
- FROM u_quotemx
- WHERE quoteid = :arg_quoteid
- AND scid = :arg_scid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "查询操作失败,报价单明细数量"
- GOTO ext
- END IF
- IF i <> (no_mxcheck+1) THEN
- rslt = 0
- arg_msg = "查询操作失败,进仓单明细"
- GOTO ext
- END IF
- it_mxbt = i - 1
- it_newbegin = FALSE
- it_updatebegin = FALSE
- ext:
- IF rslt = 0 THEN p_reset()
- RETURN rslt
- end function
- public function integer uof_update_suliao (long arg_scid, long arg_quoteid, long arg_printid, s_quotesuliao arg_s_sl, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- IF arg_quoteid <= 0 THEN
- rslt = 0
- arg_msg = '错误的单据唯一码'
- GOTO ext
- END IF
- IF arg_printid <= 0 THEN
- rslt = 0
- arg_msg = '错误的单据明细唯一码'
- GOTO ext
- END IF
- IF IsNull(arg_s_sl.mtrlid) THEN arg_s_sl.mtrlid = 0
- IF IsNull(arg_s_sl.Pigment_price) THEN arg_s_sl.Pigment_price = 0
- IF IsNull(arg_s_sl.Pigment_weight ) THEN arg_s_sl.Pigment_weight = 0
- IF IsNull(arg_s_sl.Worktime ) THEN arg_s_sl.Worktime = 0
- IF IsNull(arg_s_sl.Workprice ) THEN arg_s_sl.Workprice = 0
- IF IsNull(arg_s_sl.Trans_price ) THEN arg_s_sl.Trans_price = 0
- IF IsNull(arg_s_sl.Trans_qty ) THEN arg_s_sl.Trans_qty = 0
- IF IsNull(arg_s_sl.Tax_rate ) THEN arg_s_sl.Tax_rate = 0
- IF IsNull(arg_s_sl.Discount_rate ) THEN arg_s_sl.Discount_rate = 0
- IF IsNull(arg_s_sl.Exprice ) THEN arg_s_sl.Exprice = 0
- IF IsNull(arg_s_sl.Pack_price ) THEN arg_s_sl.Pack_price = 0
- IF IsNull(arg_s_sl.Sumprice_cust ) THEN arg_s_sl.Sumprice_cust = 0
- IF IsNull(arg_s_sl.profit_margin ) THEN arg_s_sl.profit_margin = 0
- IF IsNull(arg_s_sl.sumprice ) THEN arg_s_sl.sumprice = 0
- IF IsNull(arg_s_sl.consultqty ) THEN arg_s_sl.consultqty = 0
- IF IsNull(arg_s_sl.materialprice ) THEN arg_s_sl.materialprice = 0
- IF IsNull(arg_s_sl.Modelqty ) THEN arg_s_sl.Modelqty = 0
- IF IsNull(arg_s_sl.Period ) THEN arg_s_sl.Period = 0
- IF IsNull(arg_s_sl.EquipmentID ) THEN arg_s_sl.EquipmentID = 0
- IF IsNull(arg_s_sl.Weight ) THEN arg_s_sl.Weight = 0
- IF IsNull(arg_s_sl.Cost_Elec_Degree ) THEN arg_s_sl.Cost_Elec_Degree = 0
- IF IsNull(arg_s_sl.Elec_Price ) THEN arg_s_sl.Elec_Price = 0
- IF IsNull(arg_s_sl.Materialwaste ) THEN arg_s_sl.Materialwaste = 0
- IF IsNull(arg_s_sl.discount_price ) THEN arg_s_sl.discount_price = 0
- IF IsNull(arg_s_sl.EquipmentQty ) THEN arg_s_sl.EquipmentQty = 0
- IF IsNull(arg_s_sl.management_cost ) THEN arg_s_sl.management_cost = 0
- IF IsNull(arg_s_sl.depreciation_cost ) THEN arg_s_sl.depreciation_cost = 0
- IF IsNull(arg_s_sl.suppose_price ) THEN arg_s_sl.suppose_price = 0
- IF IsNull(arg_s_sl.suppose_ain ) THEN arg_s_sl.suppose_ain = 0
- IF IsNull(arg_s_sl.suppose_tax_tate ) THEN arg_s_sl.suppose_tax_tate = 0
- IF IsNull(arg_s_sl.net_profit ) THEN arg_s_sl.net_profit = 0
- IF IsNull(arg_s_sl.vmtrlid ) THEN arg_s_sl.vmtrlid = 0
- IF IsNull(arg_s_sl.material ) THEN arg_s_sl.material = ''
- IF IsNull(arg_s_sl.total_cost ) THEN arg_s_sl.total_cost = 0
- IF IsNull(arg_s_sl.equiment_totalqty) THEN arg_s_sl.equiment_totalqty = 0
- DELETE FROM u_quotesuliao
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- AND printid = :arg_printid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '删除报价明细物料成本明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- INSERT INTO u_quotesuliao
- (scid,
- quoteid,
- printid,
- Pigment_price,
- Pigment_weight,
- Period,
- Modelqty,
- Worktime,
- Workprice,
- EquipmentID,
- Trans_price,
- Trans_qty,
- Tax_rate,
- Discount_rate,
- Exprice,
- Pack_price,
- Sumprice_cust,
- consultqty,
- Materialprice,
- Weight,
- Cost_Elec_Degree,
- Elec_Price,
- Materialwaste,
- discount_price,
- EquipmentQty,
- management_cost,
- depreciation_cost,
- suppose_price,
- suppose_ain,
- suppose_tax_tate,
- net_profit,
- vmtrlid,
- Material,
- equiment_totalqty,
- total_cost,
- mtrlid,
- profit_margin,
- sumprice)
- VALUES
- (:arg_scid,
- :arg_quoteid,
- :arg_printid,
- :arg_s_sl.Pigment_price,
- :arg_s_sl.Pigment_weight,
- :arg_s_sl.Period,
- :arg_s_sl.Modelqty,
- :arg_s_sl.Worktime,
- :arg_s_sl.Workprice,
- :arg_s_sl.EquipmentID,
- :arg_s_sl.Trans_price,
- :arg_s_sl.Trans_qty,
- :arg_s_sl.Tax_rate,
- :arg_s_sl.Discount_rate,
- :arg_s_sl.Exprice,
- :arg_s_sl.Pack_price,
- :arg_s_sl.Sumprice_cust,
- :arg_s_sl.consultqty,
- :arg_s_sl.Materialprice,
- :arg_s_sl.Weight,
- :arg_s_sl.Cost_Elec_Degree,
- :arg_s_sl.Elec_Price,
- :arg_s_sl.Materialwaste,
- :arg_s_sl.discount_price,
- :arg_s_sl.EquipmentQty,
- :arg_s_sl.management_cost,
- :arg_s_sl.depreciation_cost,
- :arg_s_sl.suppose_price,
- :arg_s_sl.suppose_ain,
- :arg_s_sl.suppose_tax_tate,
- :arg_s_sl.net_profit,
- :arg_s_sl.vmtrlid,
- :arg_s_sl.Material,
- :arg_s_sl.equiment_totalqty,
- :arg_s_sl.total_cost,
- :arg_s_sl.mtrlid,
- :arg_s_sl.profit_margin,
- :arg_s_sl.sumprice) USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '建立报价明细塑料计算信息明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- UPDATE u_quotemx SET
- sumprice = :arg_s_sl.sumprice,
- sumprice_1 = :arg_s_sl.Sumprice_cust,
- profit_margin = :arg_s_sl.profit_margin
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- AND printid = :arg_printid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '更新明细资料失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK USING commit_transaction;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT USING commit_transaction;
- END IF
- RETURN rslt
- end function
- public function integer sec_audit (long arg_scid, long arg_quoteid, string arg_emp, ref string arg_msg, boolean arg_ifcommit);
- Int rslt = 1,cnt = 0
- Long i
- uo_cusprice uo_update_cusprice
- uo_update_cusprice = Create uo_cusprice
- IF arg_quoteid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误报价单唯一码'
- GOTO ext
- END IF
- IF uo_option_if_oa_quote = 1 And uo_option_quote_secaudit = 1 And audit_buildtype = 0 THEN
- IF f_check_if_oaflow(arg_scid,arg_quoteid,461,ARG_MSG ) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF getinfo(arg_scid,arg_quoteid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag <> 4 THEN
- rslt = 0
- ARG_MSG = "销售报价单不是在待终审状态,不能执行终审"
- GOTO ext
- END IF
- cnt = 0
- SELECT count(*) INTO :cnt
- FROM u_user
- Where username = :arg_emp Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "查询操作失败,操作员!"
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 0
- ARG_MSG = "操作员姓名未登记或已取消!"
- GOTO ext
- END IF
- IF billtype = 0 THEN
- FOR i = 1 To it_mxbt
- IF quotemx[i].sumprice_1 <= 0 THEN
- rslt = 0
- ARG_MSG = '第'+String(i)+'行,请输入客户还价'
- GOTO ext
- END IF
-
- IF uo_update_cusprice.uof_update_custprice(0,0,custID,&
- quotemx[i].mtrlid,quotemx[i].mtrlcode,quotemx[i].status,&
- quotemx[i].woodcode,quotemx[i].pcode,&
- quoteID,quoteCode,quotedate,quotemx[i].sumprice_1,&
- quotemx[i].rebate,quotemx[i].sumprice_1 * quotemx[i].rebate * quotemx[i].qty,2,'',&
- quotemx[i].printid,2,moneyid,quotemx[i].qty,quotemx[i].qty1,False,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- END IF
- //更新审核标记
- UPDATE u_quote
- SET sec_auditemp = :arg_emp,
- sec_auditdate = getdate(),
- flag = 1
- WHERE u_quote.quoteID = :arg_quoteid
- AND u_quote.scid = :arg_scid
- AND u_quote.flag = 4
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "因网络或其它原因导致单据审核操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- it_newbegin = False
- it_updatebegin = False
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- p_reset()
- Return (rslt)
- end function
- public function integer cancelsecaudit (long arg_scid, long arg_quoteid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1,cnt = 0
- Long i
- DateTime ls_auditingdate
- SetNull(ls_auditingdate)
- uo_cusprice uo_update_cusprice
- uo_update_cusprice = Create uo_cusprice
- IF arg_quoteid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误报价单唯一码'
- GOTO ext
- END IF
- IF getinfo(arg_scid,arg_quoteid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag <> 1 THEN
- rslt = 0
- ARG_MSG = "报价只有在已审核状态才可以执行撤销终审,请核对"
- GOTO ext
- END IF
- UPDATE u_quote
- SET flag = 4,
- sec_auditemp = '',
- sec_auditdate = :ls_auditingdate
- WHERE u_quote.quoteid = :arg_quoteid
- AND u_quote.scid = :arg_scid
- AND u_quote.flag = 1
- Using commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "因网络或其它原因导致报价单撤消审核操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- //删除旧有物料需求记录
- DELETE FROM u_quoterqmtrl
- WHERE u_quoterqmtrl.quoteid = :arg_quoteid
- And u_quoterqmtrl.scid = :arg_scid;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- ARG_MSG = '删除旧有物料需求记录失败 '+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF billtype = 0 THEN
- FOR i = 1 To it_mxbt
- IF uo_update_cusprice.uof_del_cusprice_auto(custid,quoteid,&
- quotemx[i].printid,quotemx[i].mtrlid,quotemx[i].status,&
- quotemx[i].woodcode,quotemx[i].pcode,&
- 2,moneyid,quotemx[i].qty,quotemx[i].qty1,False,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- END IF
- it_newbegin = False
- it_updatebegin = False
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- Destroy uo_update_cusprice
- p_reset()
- Return (rslt)
- end function
- public function integer uof_stop_mx (long arg_scid, long arg_quoteid, long arg_printid, integer arg_flag, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Int li_bill_flag,li_mx_flag,li_mx_stopflag
- DateTime null_dt
- SetNull(null_dt)
- SELECT flag INTO :li_bill_flag
- FROM u_quote
- WHERE scid = :arg_scid
- And quoteid = :arg_quoteid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询报价单审核标记失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF li_bill_flag = 0 THEN
- IF arg_flag = 1 THEN
- arg_msg = '报价单还未审核,不能明细终止'
- ELSE
- arg_msg = '报价单还未审核,不能明细终止'
- END IF
- rslt = 0
- GOTO ext
- END IF
- SELECT flag,stopflag INTO :li_mx_flag,:li_mx_stopflag
- FROM u_quotemx
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询明细审核标记失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF li_mx_flag = 0 THEN
- arg_msg = '明细未审核,不能终止操作'
- rslt = 0
- GOTO ext
- END IF
- IF arg_flag = 1 THEN
- IF li_mx_stopflag = 1 THEN
- arg_msg = '明细已终止不能再终止'
- rslt = 0
- GOTO ext
- END IF
- ELSE
- IF li_mx_stopflag = 0 THEN
- arg_msg = '明细还未终止不能取消终止操作'
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF arg_flag = 1 THEN
- UPDATE u_quotemx SET
- stopflag = 1,
- stopemp = :arg_opemp,
- stopdate = getdate()
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '终止明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ELSE
- UPDATE u_quotemx SET
- stopflag = 0,
- stopemp = '',
- stopdate = :null_dt
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '取消终止明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF rslt = 1 And arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- RETURN rslt
- end function
- public function integer uof_update_mx (long arg_scid, long arg_quoteid, long arg_printid, decimal arg_sumprice, decimal arg_sumprice_1, decimal arg_profit_margin, decimal arg_mtrlcost, decimal arg_mancost, decimal arg_outcost, decimal arg_wfjgprice, decimal arg_paintarea, decimal arg_commonqty, decimal arg_customqty, string arg_pfcode, s_quote_rqmtrl arg_rqmtrl, s_quote_workprice arg_workprice, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Int li_flag
- Long cnt,ll_mtrlid,ll_i
- Int li_billtype
- SELECT flag,mtrlid INTO :li_flag,:ll_mtrlid
- FROM u_quotemx
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询明细审核标记失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF li_flag = 1 THEN
- arg_msg = '明细已审核不能修改'
- rslt = 0
- GOTO ext
- END IF
- SELECT billtype INTO :li_billtype
- FROM u_quote
- WHERE scid = :arg_scid
- And quoteid = :arg_quoteid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询单据类型失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF li_billtype = 0 THEN
- SELECT count(*) INTO :cnt
- FROM u_mtrl_pf
- WHERE mtrlid = :ll_mtrlid
- And pfcode = :arg_pfcode Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询明细物料清单资料失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- IF cnt = 0 THEN
- arg_msg = '明细物料不存在清单:'+arg_pfcode
- rslt = 0
- GOTO ext
- END IF
- END IF
- DELETE FROM u_quoterqmtrl
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '删除报价明细物料成本明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF UpperBound(arg_rqmtrl.mtrlid) > 0 THEN
- FOR ll_i = 1 To UpperBound(arg_rqmtrl.mtrlid)
- INSERT INTO u_quoterqmtrl
- (scid,
- quoteid,
- printid,
- pid,
- MtrlID,
- RqQty,
- newprice,
- planprice,
- lp,
- pmtrlid,
- status,
- woodcode,
- pcode,
- pfgroup,
- pfgroupqty,
- pfgroupmode,
- sonscale,
- sonloss,
- promode,
- klmode,
- klarea)
- VALUES
- (:arg_scid,
- :arg_quoteid,
- :arg_printid,
- :arg_rqmtrl.printid[ll_i],
- :arg_rqmtrl.mtrlid[ll_i],
- :arg_rqmtrl.RqQty[ll_i],
- :arg_rqmtrl.newprice[ll_i],
- :arg_rqmtrl.planprice[ll_i],
- :arg_rqmtrl.lp[ll_i],
- :arg_rqmtrl.pmtrlid[ll_i],
- :arg_rqmtrl.status[ll_i],
- :arg_rqmtrl.woodcode[ll_i],
- :arg_rqmtrl.pcode[ll_i],
- :arg_rqmtrl.pfgroup[ll_i],
- :arg_rqmtrl.pfgroupqty[ll_i],
- :arg_rqmtrl.pfgroupmode[ll_i],
- :arg_rqmtrl.sonscale[ll_i],
- :arg_rqmtrl.sonloss[ll_i],
- :arg_rqmtrl.promode[ll_i],
- :arg_rqmtrl.klmode[ll_i],
- :arg_rqmtrl.klarea[ll_i]) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '建立报价明细物料成本明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- NEXT
- END IF
- DELETE FROM u_quoteworkprice
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '删除报价明细工价信息明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF UpperBound(arg_workprice.mtrlid) > 0 THEN
- FOR ll_i = 1 To UpperBound(arg_workprice.mtrlid)
- INSERT INTO u_quoteworkprice
- (scid,
- quoteid,
- printid,
- pid,
- MtrlID,
- proid,
- proorder,
- procode,
- proname,
- wrkgrpid,
- workprice,
- workqty,
- dscrp)
- VALUES
- (:arg_scid,
- :arg_quoteid,
- :arg_printid,
- :arg_workprice.pid[ll_i],
- :arg_workprice.mtrlid[ll_i],
- :arg_workprice.proid[ll_i],
- :arg_workprice.proorder[ll_i],
- :arg_workprice.procode[ll_i],
- :arg_workprice.proname[ll_i],
- :arg_workprice.wrkgrpid[ll_i],
- :arg_workprice.workprice[ll_i],
- :arg_workprice.workqty[ll_i],
- :arg_workprice.dscrp[ll_i]) Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '建立报价明细工价信息明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- NEXT
- END IF
- UPDATE u_quotemx SET
- sumprice = :arg_sumprice,
- sumprice_1 = :arg_sumprice_1,
- profit_margin = :arg_profit_margin,
- mtrlcost = :arg_mtrlcost,
- mancost = :arg_mancost,
- outcost = :arg_outcost,
- wfjgprice = :arg_wfjgprice,
- pfcode = :arg_pfcode,
- paintarea = :arg_paintarea,
- commonqty = :arg_commonqty,
- customqty = :arg_customqty
- WHERE scid = :arg_scid
- AND quoteid = :arg_quoteid
- And printid = :arg_printid Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '更新明细资料失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF rslt = 1 And arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- RETURN rslt
- end function
- public function integer acceptmx (long arg_mtrlid, string arg_mtrlcode, string arg_mtrlname, string arg_mtrlmode, string arg_unit, string arg_mxdscrp, ref string arg_msg, long arg_printid, decimal arg_sumprice, decimal arg_sumprice_1, string arg_status, string arg_woodcode, string arg_pcode, decimal arg_maxprice, decimal arg_planprice, decimal arg_profit_margin, decimal arg_wfjgprice, decimal arg_outcost, decimal arg_mancost, decimal arg_mtrlcost, decimal arg_qty, decimal arg_qty1, decimal arg_rebate, string arg_dscrp_text, string arg_mxdscrp2, decimal arg_paintarea, decimal arg_commonqty, decimal arg_customqty, decimal arg_taxrate);Long rslt = 1,cnt = 0,LS_i
- Decimal ld_newprice,ld_planprice
- Int li_statusflag,li_woodcodeflag,li_pcodeflag
- String ls_pfcode
- Int li_status_check,li_woodcode_check,li_pcode_check
- IF uo_option_change_status = '-1000' THEN
- rslt = 0
- arg_msg = '选项:[029]配置标题文本,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF uo_option_change_woodcode = '-1000' THEN
- rslt = 0
- arg_msg = '选项:[027]配置1标题文本,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF uo_option_change_pcode = '-1000' THEN
- rslt = 0
- arg_msg = '选项:[028]配置2标题文本,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF it_newbegin = False And it_updatebegin = False THEN
- rslt = 0
- arg_msg = "非编辑状态不可以使用,操作取消"
- GOTO ext
- END IF
- //清除空值
- IF IsNull(arg_mtrlid) THEN arg_mtrlid = 0
- IF IsNull(arg_sumprice) THEN arg_sumprice = 0
- IF IsNull(arg_sumprice_1) THEN arg_sumprice_1 = 0
- IF IsNull(arg_mxdscrp) THEN arg_mxdscrp = ''
- IF IsNull(arg_printid) THEN arg_printid = 0
- IF IsNull(arg_mtrlcode) THEN arg_mtrlcode = ''
- IF IsNull(arg_status) THEN arg_status = ''
- IF IsNull(arg_woodcode) THEN arg_woodcode = ''
- IF IsNull(arg_pcode) THEN arg_pcode = ''
- IF IsNull(arg_qty) THEN arg_qty = 0
- IF IsNull(arg_qty1) THEN arg_qty1 = 0
- IF IsNull(arg_rebate) THEN arg_rebate = 1
- IF IsNull(arg_mxdscrp2) THEN arg_mxdscrp2 = ''
- IF IsNull(arg_paintarea) THEN arg_paintarea = 0
- IF IsNull(arg_commonqty) THEN arg_commonqty = 0
- IF IsNull(arg_customqty) THEN arg_customqty = 0
- IF IsNull(arg_taxrate) THEN arg_taxrate = 0
- arg_status = Trim(arg_status)
- arg_woodcode = Trim(arg_woodcode)
- arg_pcode = Trim(arg_pcode)
- IF billtype = 0 THEN
- IF arg_mtrlid = 0 THEN // 如果物料编号为空,则不作任何处理
- rslt = 1
- GOTO ext
- END IF
- END IF
- IF arg_printid = 0 THEN // 如果序号为空,则不作任何处理
- rslt = 1
- GOTO ext
- END IF
- IF billtype = 0 THEN
- SELECT planprice,
- statusflag,
- woodcodeflag,
- pcodeflag,
- status_check,
- woodcode_check,
- pcode_check
- INTO :ld_planprice,
- :li_statusflag,
- :li_woodcodeflag,
- :li_pcodeflag,
- :li_status_check,
- :li_woodcode_check,
- :li_pcode_check
- FROM u_mtrldef
- Where u_mtrldef.mtrlid = :arg_mtrlid ;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '行:'+String(arg_printid)+",查询物料:"+arg_mtrlcode+'计划价失败'
- GOTO ext
- END IF
-
- IF li_statusflag = 2 THEN
- IF arg_status = '' THEN
- arg_msg = '行:'+String(arg_printid)+',物料'+uo_option_change_status + '字段使用组合配置,请输入'
- rslt = 0
- GOTO ext
- END IF
- ELSEIF li_statusflag = 4 And li_status_check = 1 THEN
- IF arg_status = '' THEN
- arg_msg = '行:'+String(arg_printid)+',物料'+uo_option_change_woodcode + '字段使用部件选配,请输入'
- rslt = 0
- GOTO ext
- END IF
- END IF
-
- IF li_woodcodeflag = 4 And li_woodcode_check = 1 THEN
- IF arg_woodcode = '' THEN
- arg_msg = '行:'+String(arg_printid)+',物料'+uo_option_change_woodcode + '字段使用部件选配,请输入'
- rslt = 0
- GOTO ext
- END IF
- END IF
-
- IF li_pcodeflag = 4 And li_pcode_check = 1 THEN
- IF arg_pcode = '' THEN
- arg_msg = '行:'+String(arg_printid)+',物料'+uo_option_change_pcode + '字段使用部件选配,请输入'
- rslt = 0
- GOTO ext
- END IF
- END IF
-
- SELECT price
- INTO :ld_newprice
- FROM v_maxprice_cusprice
- Where mtrlid = :arg_mtrlid;
- IF sqlca.SQLCode <> 0 Or IsNull(ld_newprice) THEN ld_newprice = 0
-
- ls_pfcode = f_get_dft_pf(arg_mtrlid)
- END IF
- FOR LS_i = 1 To it_mxbt //合并重复项(产品)
- IF quotemx[LS_i].mtrlid = arg_mtrlid And &
- quotemx[LS_i].mtrlcode = arg_mtrlcode And &
- quotemx[LS_i].status = arg_status And &
- quotemx[LS_i].woodcode = arg_woodcode And &
- quotemx[LS_i].pcode = arg_pcode And &
- quotemx[LS_i].qty = arg_qty And &
- quotemx[LS_i].qty1 = arg_qty1 THEN
- rslt = 0
- arg_msg = "存在相同的产品,在"+quotemx[LS_i].mtrlcode+",请自行手动合并"
- GOTO ext
- END IF
- NEXT
- //写入内容
- it_mxbt++
- quotemx[it_mxbt].mtrlid = arg_mtrlid
- quotemx[it_mxbt].mtrlcode = arg_mtrlcode
- quotemx[it_mxbt].maxprice = ld_newprice
- quotemx[it_mxbt].planprice = ld_planprice
- quotemx[it_mxbt].mxdscrp = arg_mxdscrp
- quotemx[it_mxbt].printid = arg_printid
- quotemx[it_mxbt].sumprice = arg_sumprice
- quotemx[it_mxbt].sumprice_1 = arg_sumprice_1
- quotemx[it_mxbt].pfcode = ls_pfcode
- quotemx[it_mxbt].status = arg_status
- quotemx[it_mxbt].woodcode = arg_woodcode
- quotemx[it_mxbt].pcode = arg_pcode
- quotemx[it_mxbt].maxprice = arg_maxprice
- quotemx[it_mxbt].planprice = arg_planprice
- quotemx[it_mxbt].profit_margin = arg_profit_margin
- quotemx[it_mxbt].wfjgprice = arg_wfjgprice
- quotemx[it_mxbt].outcost = arg_outcost
- quotemx[it_mxbt].mancost = arg_mancost
- quotemx[it_mxbt].mtrlcost = arg_mtrlcost
- quotemx[it_mxbt].qty = arg_qty
- quotemx[it_mxbt].qty1 = arg_qty1
- quotemx[it_mxbt].rebate = arg_rebate
- quotemx[it_mxbt].dscrp_text = arg_dscrp_text
- quotemx[it_mxbt].unit = arg_unit
- quotemx[it_mxbt].mtrlname = arg_mtrlname
- quotemx[it_mxbt].mtrlmode = arg_mtrlmode
- quotemx[it_mxbt].mxdscrp2 = arg_mxdscrp2
- quotemx[it_mxbt].paintarea = arg_paintarea
- quotemx[it_mxbt].commonqty = arg_commonqty
- quotemx[it_mxbt].customqty = arg_customqty
- quotemx[it_mxbt].taxrate = arg_taxrate
- quotemx[it_mxbt].fprice = arg_sumprice * mrate
- ext:
- IF rslt = 0 THEN p_clearmx()
- Return(rslt)
- end function
- on uo_quote.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_quote.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
- event constructor;String str_optionvalue,arg_msg
- f_get_sys_option_value('029',str_optionvalue,arg_msg)
- uo_option_change_status = str_optionvalue
- f_get_sys_option_value('027',str_optionvalue,arg_msg)
- uo_option_change_woodcode = str_optionvalue
- f_get_sys_option_value('028',str_optionvalue,arg_msg)
- uo_option_change_pcode = str_optionvalue
- f_get_sys_option_value('235',str_optionvalue,arg_msg)
- uo_option_if_oa_quote = long(str_optionvalue)
- f_get_sys_option_value('236',str_optionvalue,arg_msg)
- uo_option_quote_secaudit = long(str_optionvalue)
- end event
- global type uo_incase from nonvisualobject
- end type
|