12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472 |
- $PBExportHeader$uo_reissue_sptcust.sru
- forward
- global type uo_reissue_sptcust from nonvisualobject
- end type
- end forward
- global type uo_reissue_sptcust from nonvisualobject
- end type
- global uo_reissue_sptcust uo_reissue_sptcust
- type variables
- PUBLIC PROTECTEDWRITE Long scid
- PUBLIC PROTECTEDWRITE Long reissueid
- PUBLIC PROTECTEDWRITE String reissuecode
- PUBLIC PROTECTEDWRITE DateTime opdate
- PUBLIC PROTECTEDWRITE String opemp
- PUBLIC PROTECTEDWRITE DateTime moddate
- PUBLIC PROTECTEDWRITE String modemp
- PUBLIC PROTECTEDWRITE Int flag
- PUBLIC PROTECTEDWRITE DateTime auditingdate
- PUBLIC PROTECTEDWRITE String auditingrep
- PUBLIC PROTECTEDWRITE Decimal sumamt = 0
- Long relid
- String relcode
- DateTime reissuedate
- String dscrp
- Long cusid
- String cuscode
- String reissueemp
- String cusname
- Long r_type
- Long relint_3
- Long moneyid
- long itemid
- Int cwauditingflag = 0 //总账审核标记
- DateTime cwauditingdate //总账审核时间
- String cwauditingrep //总账审核操作员
- Transaction commit_transaction
- Boolean if_getid_ture = TRUE
- s_reissuemx reissuemx[]
- Long it_mxbt
- Boolean it_newbegin = FALSE
- Boolean it_updatebegin = FALSE
- end variables
- forward prototypes
- public function integer p_clearmx ()
- public function integer p_reset ()
- public function integer p_getinfo (long arg_scid, long arg_reissueid, ref string arg_msg)
- public function integer getinfo (long arg_scid, long arg_reissueid, ref string arg_msg)
- public function integer newbegin (long arg_scid, ref string arg_msg)
- public function integer updatebegin (long arg_scid, long arg_reissueid, ref string arg_msg)
- public function integer add_dscrp (long arg_scid, long arg_reissueid, string arg_newdescppart, ref string arg_msg)
- public function integer save (boolean arg_ifcommit, ref string arg_msg)
- public function integer del (long arg_scid, long arg_reissueid, ref string arg_msg, boolean arg_ifcommit)
- public function integer auditing (boolean arg_ifcommit, ref string arg_msg)
- public function integer c_auditing (boolean arg_ifcommit, ref string arg_msg)
- public function integer acceptmx (decimal arg_qty, double arg_price, decimal arg_amt, string arg_mxdscrp, long arg_printid, ref string arg_msg, long arg_mtrlid, string arg_mtrlname)
- public function integer audit_subject (long arg_scid, long arg_billid, boolean arg_ifcommit, ref string arg_msg)
- public function integer c_audit_subject (long arg_scid, long arg_billid, boolean arg_ifcommit, ref string arg_msg)
- end prototypes
- public function integer p_clearmx ();//int p_clearmx()
- //清除明细
- it_mxbt=0
- sumamt = 0
- return 1
- end function
- public function integer p_reset ();//int p_reset()
- //清除对象及其明细
- scid = 0
- reissueid = 0
- reissuecode = ''
- opemp = ''
- modemp = ''
- auditingrep = ''
- flag = 0
- relid = 0
- relcode = ''
- dscrp = ''
- cusid = 0
- moneyid = 0
- cuscode = ''
- cusname = ''
- it_newbegin = FALSE
- it_updatebegin = FALSE
- //清除明细
- p_clearmx()
- RETURN 1
- end function
- public function integer p_getinfo (long arg_scid, long arg_reissueid, ref string arg_msg);//p_getinfo(arg_scid,arg_outwareid,arg_msg)
- //0 失败 1成功
- Int rslt = 1
- IF arg_reissueid <= 0 THEN
- rslt = 0
- arG_MSG = "非法补件单唯一码"
- GOTO ext
- END IF
- SELECT u_reissue.reissuecode,
- u_reissue.cusid,
- u_reissue.cuscode,
- u_reissue.cusname,
- u_reissue.reissuedate,
- u_reissue.relid,
- u_reissue.relcode,
- u_reissue.dscrp,
- u_reissue.flag,
- u_reissue.reissueemp,
- u_reissue.type,
- u_reissue.moneyid,
- u_reissue.relint_3,
- u_reissue.itemid,
- u_reissue.cwauditingflag,
- u_reissue.cwauditingrep,
- u_reissue.cwauditingdate
- INTO :reissuecode,
- :cusid,
- :cuscode,
- :cusname,
- :reissuedate,
- :relid,
- :relcode,
- :dscrp,
- :flag,
- :reissueemp,
- :r_type,
- :moneyid,
- :relint_3,
- :itemid,
- :cwauditingflag,
- :cwauditingrep,
- :cwauditingdate
- FROM u_reissue
- WHERE u_reissue.reissueid = :arg_reissueid
- AND scid = :arg_scid
- USING commit_transaction;
-
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "查询操作失败(错误补件单唯一码),补件单"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- reissueid = arg_reissueid
- scid = arg_scid
- ext:
- IF rslt = 0 THEN p_reset()
- RETURN rslt
- end function
- public function integer getinfo (long arg_scid, long arg_reissueid, ref string arg_msg);//getinfo(arg_scid,arg_reissueid,arg_msg)
- //0 失败 1成功
- Int rslt = 1,i = 1,no_mxcheck = 0
- IF arg_reissueid <= 0 THEN
- rslt = 0
- arg_msg = "非法补件单唯一码"
- GOTO ext
- END IF
- sumamt = 0
- rslt = p_getinfo(arg_scid,arg_reissueid,arg_msg)
- IF rslt = 0 THEN GOTO ext
- //用游标读取明细
- IF r_type = 0 THEN
- DECLARE cur_inwaermx_0 CURSOR FOR
- SELECT u_reissuemx.printid,
- u_reissuemx.mtrlid,
- u_mtrldef.mtrlcode,
- u_mtrldef.mtrlname,
- u_reissuemx.qty,
- u_reissuemx.price,
- u_reissuemx.dscrp,
- u_reissuemx.amt,
- u_reissuemx.relid
- FROM u_reissuemx left OUTER join u_mtrldef on
- u_reissuemx.mtrlid = u_mtrldef.mtrlid
- WHERE u_reissuemx.reissueid = :arg_reissueid AND
- u_reissuemx.scid = :arg_scid USING commit_transaction;
-
- OPEN cur_inwaermx_0;
- FETCH cur_inwaermx_0 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- DO WHILE commit_transaction.SQLCode = 0
-
- sumamt += reissuemx[i].amt
-
- i++
-
- FETCH cur_inwaermx_0 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- LOOP
- CLOSE cur_inwaermx_0;
- ELSEIF r_type = 1 THEN
- DECLARE cur_inwaermx_1 CURSOR FOR
- SELECT u_reissuemx.printid,
- u_reissuemx.mtrlid,
- U_Expenses.Expensescode,
- U_Expenses.Expensesname,
- u_reissuemx.qty,
- u_reissuemx.price,
- u_reissuemx.dscrp,
- u_reissuemx.amt,
- u_reissuemx.relid
- FROM u_reissuemx left OUTER join U_Expenses on
- u_reissuemx.mtrlid = U_Expenses.Expensesid
- WHERE u_reissuemx.reissueid = :arg_reissueid AND
- u_reissuemx.scid = :arg_scid USING commit_transaction;
-
- OPEN cur_inwaermx_1;
- FETCH cur_inwaermx_1 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- DO WHILE commit_transaction.SQLCode = 0
-
- sumamt += reissuemx[i].amt
-
- i++
-
- FETCH cur_inwaermx_1 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- LOOP
- CLOSE cur_inwaermx_1;
-
- ELSEIF r_type = 2 THEN
- DECLARE cur_inwaermx_2 CURSOR FOR
- SELECT u_reissuemx.printid,
- u_reissuemx.mtrlid,
- U_Expenses.Expensescode,
- u_reissuemx.mtrlname,
- u_reissuemx.qty,
- u_reissuemx.price,
- u_reissuemx.dscrp,
- u_reissuemx.amt,
- u_reissuemx.relid
- FROM u_reissuemx left OUTER join U_Expenses on
- u_reissuemx.mtrlid = U_Expenses.Expensesid
- WHERE u_reissuemx.reissueid = :arg_reissueid AND
- u_reissuemx.scid = :arg_scid USING commit_transaction;
-
- OPEN cur_inwaermx_2;
- FETCH cur_inwaermx_2 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- DO WHILE commit_transaction.SQLCode = 0
-
- sumamt += reissuemx[i].amt
-
- i++
-
- FETCH cur_inwaermx_2 INTO :reissuemx[i].printid,
- :reissuemx[i].mtrlid,:reissuemx[i].mtrlcode,
- :reissuemx[i].mtrlname,:reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].amt,
- :reissuemx[i].relid;
- LOOP
- CLOSE cur_inwaermx_2;
- END IF
- //检验明细是否读入完整
- SELECT count(*) INTO :no_mxcheck
- FROM u_reissuemx
- WHERE u_reissuemx.reissueid = :arg_reissueid
- 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
- reissueid = arg_reissueid
- scid = arg_scid
- it_mxbt = i - 1
- it_newbegin = FALSE
- it_updatebegin = FALSE
- ext:
- IF rslt = 0 THEN p_reset()
- RETURN rslt
- end function
- public function integer newbegin (long arg_scid, ref string arg_msg);//====================================================================
- // Function: newbegin(long arg_scid,int arg_billtype,ref string arg_msg)
- //--------------------------------------------------------------------
- // Description: 从置对象,设定业务类型,准备建立新进仓单
- //--------------------------------------------------------------------
- // Arguments:
- // value long arg_scid
- // value integer arg_billtype
- // reference string arg_msg
- //--------------------------------------------------------------------
- // Returns: integer
- //--------------------------------------------------------------------
- // Author: yyx Date: 2003.11.12
- //--------------------------------------------------------------------
- // Modify History:
- //
- //====================================================================
- int rslt=1
- if arg_scid < 0 then
- arg_msg = '请选择分部'
- rslt = 0
- goto ext
- end if
- p_reset()
- scid=arg_scid
- it_newbegin=true
- it_updatebegin=false
- ext:
- if rslt=0 then p_reset()
- return rslt
- end function
- public function integer updatebegin (long arg_scid, long arg_reissueid, ref string arg_msg);//====================================================================
- // Function: updatebegin(arg_scid,arg_inwareid,arg_billtype,arg_msg)
- //--------------------------------------------------------------------
- // Description: 从置对象,设定业务类型与关联ID,准备更新进仓单
- //--------------------------------------------------------------------
- // Arguments:
- // value long arg_scid
- // value long arg_inwareid
- // value integer arg_billtype
- // reference string arg_msg
- //--------------------------------------------------------------------
- // Returns: integer
- //--------------------------------------------------------------------
- // Author: yyx Date: 2003.11.12
- //--------------------------------------------------------------------
- // Modify History:
- //
- //====================================================================
- long rslt=1
- if arg_scid < 0 then
- arg_msg = '请选择分部'
- rslt = 0
- goto ext
- end if
- if arg_reissueid<=0 then
- rslt=0
- goto ext
- end if
- rslt=p_getinfo(arg_scid,arg_reissueid,arg_msg)
- if rslt=0 then goto ext
- if flag=1 then
- rslt=0
- arg_msg='单据已经审核,不可以修改'
- goto ext
- end if
- reissueid=arg_reissueid
- scid=arg_scid
- it_newbegin=false
- it_updatebegin=true
- p_clearmx() //清除明细
- ext:
- if rslt=0 then p_reset()
- return rslt
- end function
- public function integer add_dscrp (long arg_scid, long arg_reissueid, string arg_newdescppart, ref string arg_msg);//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
- rslt=p_getinfo(arg_scid,arg_reissueid,arg_msg)
- if rslt=0 then goto ext
- if flag=0 then
- rslt=0
- arg_msg="非审核状态下不可用"
- goto ext
- end if
- update u_reissue
- set dscrp = dscrp+' '+:arg_newdescppart
- where u_reissue.reissueid = :reissueid
- and scid=:scid using commit_transaction;
- if commit_transaction.sqlcode<>0 then
- rollback ;
- rslt=0
- arg_msg="因网络或其它原因导致添加单据备注操作失败"+"~n"+commit_transaction.sqlerrtext
- goto ext
- end if
- commit using commit_transaction;
- dscrp = dscrp+' '+arg_newdescppart
- ext: return (rslt)
- end function
- public function integer save (boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1,cnt = 0,i
- DateTime server_dt
- Long ls_newid
- String ls_sccode
- IF IsNull(relid) THEN relid = 0
- IF IsNull(cusid) THEN cusid = 0
- IF IsNull(moneyid) THEN moneyid = 0
- IF IsNull(relcode) THEN relcode = ''
- IF IsNull(reissueemp) THEN reissueemp = ''
- IF IsNull(dscrp) THEN dscrp = ''
- IF IsNull(itemid) THEN itemid = 0
- IF it_newbegin = FALSE AND it_updatebegin = FALSE THEN
- rslt = 0
- arg_msg = "非编辑状态不可以提交"
- 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 r_type = 2 THEN
- IF cusid = 0 THEN
- arg_msg = '请选择供应商'
- rslt = 0
- GOTO ext
- END IF
-
- SELECT count(*) INTO :cnt
- FROM u_spt
- WHERE sptid = :cusid
- USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询供应商资料失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- IF cnt = 0 THEN
- rslt = 0
- arg_msg = '错误的供应商资料'
- GOTO ext
- END IF
- ELSE
-
- IF cusid = 0 THEN
- arg_msg = '请选择客户'
- rslt = 0
- GOTO ext
- END IF
-
- SELECT count(*) INTO :cnt
- FROM u_cust
- WHERE cusid = :cusid
- USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询客户资料失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- IF cnt = 0 THEN
- rslt = 0
- arg_msg = '错误的客户资料'
- GOTO ext
- END IF
- END IF
- IF it_mxbt = 0 THEN //如果输入物料资料错则已经清空
- rslt = 0
- arg_msg = "没有正确进仓内容"
- GOTO ext
- END IF
- IF itemid = 0 THEN
- rslt = 0
- arg_msg = '请选择项目'
- GOTO ext
- END IF
- SELECT count(*) INTO :cnt
- FROM u_itemdef
- WHERE itemid = :itemid
- USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询项目资料失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF cnt = 0 THEN
- rslt = 0
- arg_msg = '错误的项目资料'
- GOTO ext
- END IF
- IF f_check_inoutdate(0,reissuedate,true,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ////////////////////////////////////////////// //开始区分:新建/更新 处理
- IF reissueid = 0 THEN //新建
- ls_newid = f_sys_scidentity(scid,"u_reissue","reissueid",arg_msg,if_getid_ture,commit_transaction)
- IF ls_newid <= 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 r_type = 0 THEN
- reissuecode = getid(scid,ls_sccode + 'FJ',Date(server_dt),if_getid_ture,commit_transaction)
- ELSEIF r_type = 1 THEN
- reissuecode = getid(scid,ls_sccode + 'FY',Date(server_dt),if_getid_ture,commit_transaction)
- ELSE
- reissuecode = getid(scid,ls_sccode + 'FS',Date(server_dt),if_getid_ture,commit_transaction)
- END IF
-
- IF reissuecode = "err" THEN
- reissuecode = ''
- rslt = 0
- arg_msg = "无法获取单据编号"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- INSERT INTO u_reissue (
- scid,
- reissueid,
- reissuecode,
- cusid,
- reissuedate,
- relid,
- relcode,
- dscrp,
- opdate,
- opemp,
- flag,
- reissueemp,
- type,
- moneyid,
- itemid)
- VALUES (
- :scid,
- :ls_newid,
- :reissuecode,
- :cusid,
- :reissuedate,
- :relid,
- :relcode,
- :dscrp,
- :server_dt,
- :publ_operator,
- :flag,
- :reissueemp,
- :r_type,
- :moneyid,
- :itemid) USING commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
-
- IF Pos(Lower(commit_transaction.SQLErrText),'PK_u_reissue') > 0 THEN
- arg_msg = '插入操作失败,关键字单据ID重复'
- ELSEIF Pos(Lower(commit_transaction.SQLErrText),'IX_u_reissue') > 0 THEN
- arg_msg = '插入操作失败,关键字单据编号重复'
- ELSE
- arg_msg = "因网络或其它原因导致插入操作失败"+"~n"+commit_transaction.SQLErrText
- END IF
-
- GOTO ext
- END IF
-
- //读取新reissueid
- reissueid = ls_newid
-
- FOR i = 1 TO it_mxbt
- INSERT INTO u_reissuemx
- (scid,
- reissueid,
- mtrlid,
- printid,
- qty,
- price,
- amt,
- dscrp,
- mtrlname)
- VALUES (
- :scid,
- :ls_newid,
- :reissuemx[i].mtrlid,
- :reissuemx[i].printid,
- :reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].amt,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].mtrlname) USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- // reissueid = 0 //还原reissueid
- rslt = 0
-
- IF Pos(Lower(commit_transaction.SQLErrText),'PK_u_reissuemx') > 0 THEN
- arg_msg = '插入明细操作失败,关键字单据ID,序号重复'
- ELSE
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+commit_transaction.SQLErrText
- END IF
-
- GOTO ext
- END IF
- NEXT
- ELSE //////////////////////////////////////////////// //更新
- UPDATE u_reissue
- SET cusid = :cusid,
- reissuedate = :reissuedate,
- relid = :relid,
- relcode = :relcode,
- dscrp = :dscrp,
- moddate = : server_dt,
- modemp = :publ_operator,
- reissueemp = :reissueemp,
- type = :r_type,
- moneyid = :moneyid,
- itemid = :itemid
- WHERE u_reissue.reissueid = :reissueid
- AND u_reissue.scid = :scid
- AND flag = 0 USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 OR commit_transaction.SQLNRows <= 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致更新单据操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
-
- //删除原有明细
- DELETE FROM u_reissuemx
- WHERE u_reissuemx.reissueid = :reissueid
- AND u_reissuemx.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_reissuemx
- (scid,
- reissueid,
- mtrlid,
- printid,
- qty,
- price,
- amt,
- dscrp,
- mtrlname)
- VALUES (
- :scid,
- :reissueid,
- :reissuemx[i].mtrlid,
- :reissuemx[i].printid,
- :reissuemx[i].qty,
- :reissuemx[i].price,
- :reissuemx[i].amt,
- :reissuemx[i].mxdscrp,
- :reissuemx[i].mtrlname) USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- IF Pos(Lower(commit_transaction.SQLErrText),'PK_u_reissuemx') > 0 THEN
- arg_msg = '插入明细操作失败,关键字单据ID,序号重复'
- ELSE
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+commit_transaction.SQLErrText
- END IF
- GOTO ext
- END IF
- NEXT
- END IF
- it_newbegin = FALSE
- it_updatebegin = FALSE
- ext:
- IF rslt = 0 THEN
- ROLLBACK USING commit_transaction;
- p_clearmx()
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT USING commit_transaction;
- END IF
- RETURN rslt
- end function
- public function integer del (long arg_scid, long arg_reissueid, ref string arg_msg, boolean arg_ifcommit);//如果单据还没有审核删除单据极其明细
- //0 FAIL, 1 SUCCESS
- Int rslt = 1
- IF arg_reissueid <= 0 THEN
- rslt = 0
- arG_MSG = "没有删除对象,操作取消"
- GOTO ext
- END IF
- IF p_getinfo(arg_scid,arg_reissueid,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_reissue
- WHERE u_reissue.reissueid = :arg_reissueid
- AND u_reissue.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_reissuemx
- WHERE u_reissuemx.reissueid = :arg_reissueid
- AND u_reissuemx.scid = :arg_scid 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;
- p_reset()
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT USING commit_transaction;
- END IF
- RETURN (rslt)
- end function
- public function integer auditing (boolean arg_ifcommit, ref string arg_msg);Long rslt = 1,cnt = 0,ll_i
- //DateTime ld_viewdate
- //SetNull(ld_viewdate)
- uo_musttake uo_take
- uo_mustpay uo_pay
- uo_take = CREATE uo_musttake
- uo_pay = CREATE uo_mustpay
- String ls_about,ls_dscrp
- Decimal ld_takeamt = 0,ld_msttakeamt = 0
- Decimal ld_payamt = 0,ld_mstpayamt = 0
- IF reissueid = 0 THEN
- rslt = 0
- arg_msg = "没有审核对象"
- GOTO ext
- END IF
- IF it_newbegin OR it_updatebegin THEN
- rslt = 0
- arg_msg = "编辑状态下不可以执行审核"
- GOTO ext
- END IF
- IF flag = 1 THEN
- rslt = 0
- arg_msg = "单据已经审核"
- GOTO ext
- END IF
- Int li_btype
- Long ll_accountsid
- SELECT btype,accountsid INTO :li_btype,:ll_accountsid
- FROM cw_banktype
- Where banktypeid = :relid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询结算方式类型失败,'+ commit_transaction.SQLErrText
- GOTO ext
- END IF
- SELECT count(*) INTO :cnt
- FROM u_user
- Where username = :publ_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
- UPDATE u_reissue
- SET auditingrep = :publ_operator,
- auditingdate = getdate(),
- flag = 1
- WHERE u_reissue.reissueid = :reissueid
- AND flag = 0
- AND scid = :scid USING commit_transaction;
-
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致审核单据操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- ELSEIF commit_transaction.SQLNRows = 0 THEN
- rslt = 0
- arg_msg = "单据正在审核,请稍后查询。"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- IF r_type = 0 THEN //补件单
-
- IF sumamt <> 0 THEN
- ls_about = reissuecode + "补件款"
-
- ls_dscrp = ls_about
- ld_msttakeamt = sumamt
- IF li_btype = 1 THEN
- ld_takeamt = ld_msttakeamt
- ELSE
- ld_takeamt = 0
- END IF
-
- s_bmsttake s_take
-
- s_take.scid = scid
- s_take.cusid = cusid
- s_take.takedate = reissuedate
- s_take.inrep = reissueemp
- s_take.oriamt = ld_msttakeamt
- s_take.msttakeamt = ld_msttakeamt
- s_take.takeamt = ld_takeamt
- s_take.dscrp = ls_dscrp
- s_take.billcode = reissuecode
- s_take.banktypeid = relid
- s_take.opemp = publ_operator
- s_take.buildtype = 1
- s_take.outwareid = reissueid
- s_take.accountsid = ll_accountsid
- s_take.itemid = itemid
- s_take.moneyid = moneyid
-
- // IF uo_take.add_takerec (s_take,arg_msg,FALSE) = 0 THEN
- // rslt = 0
- // GOTO ext
- // END IF
-
- IF uo_take.add_takerec(scid,cusid,reissuedate,reissueemp,ld_msttakeamt,Round(ld_msttakeamt,sys_saleamt_round),Round(ld_takeamt,sys_saleamt_round),ls_dscrp,&
- reissuecode,relid,1,publ_operator,reissueid,0,arg_msg,FALSE,reissuedate,ll_accountsid,itemid,moneyid,relcode) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- UPDATE u_reissue
- SET relint_3 = :uo_take.ref_takeid
- WHERE u_reissue.reissueid = :reissueid
- AND scid = :scid
- AND flag = 1 USING commit_transaction;
-
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '更新补件单相关应收帐ID失败'
- rslt = 0
- GOTO ext
- END IF
- END IF
- ELSEIF r_type = 1 THEN //费用单
-
- FOR ll_i = 1 TO it_mxbt
-
- IF reissuemx[ll_i].amt <> 0 THEN
-
- IF Trim(reissuemx[ll_i].mxdscrp) = '' THEN
- ls_about = reissuecode + ',' + reissuemx[ll_i].mtrlname
- ELSE
- ls_about = reissuecode + ',' + reissuemx[ll_i].mtrlname + ',' + reissuemx[ll_i].mxdscrp
- END IF
-
- ls_dscrp = ls_about
- ld_msttakeamt = 0 - reissuemx[ll_i].amt
- IF li_btype = 1 THEN
- ld_takeamt = ld_msttakeamt
- ELSE
- ld_takeamt = 0
- END IF
-
- s_bmsttake s_take2
-
- s_take2.scid = scid
- s_take2.cusid = cusid
- s_take2.takedate = reissuedate
- s_take2.inrep = reissueemp
- s_take2.oriamt = ld_msttakeamt
- s_take2.msttakeamt = ld_msttakeamt
- s_take2.takeamt = ld_takeamt
- s_take2.dscrp = ls_dscrp
- s_take2.billcode = reissuecode
- s_take2.banktypeid = relid
- s_take2.opemp = publ_operator
- s_take2.buildtype = 1
- s_take2.outwareid = reissueid
- s_take2.accountsid = ll_accountsid
- s_take2.itemid = itemid
- s_take2.moneyid = moneyid
-
-
- // IF uo_take.add_takerec (s_take2,arg_msg,FALSE) = 0 THEN
- // rslt = 0
- // GOTO ext
- // END IF
- IF uo_take.add_takerec(scid,cusid,reissuedate,reissueemp,ld_msttakeamt,Round(ld_msttakeamt,sys_saleamt_round),Round(ld_takeamt,sys_saleamt_round),ls_dscrp,&
- reissuecode,relid,1,publ_operator,reissueid,0,arg_msg,FALSE,reissuedate,ll_accountsid,itemid,moneyid,relcode) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
-
- UPDATE u_reissuemx
- SET relid = :uo_take.ref_takeid
- FROM u_reissuemx,u_reissue
- WHERE u_reissuemx.reissueid = :reissueid
- AND u_reissuemx.printid = :reissuemx[ll_i].printid
- AND u_reissuemx.scid = :scid
- AND u_reissuemx.scid = u_reissue.scid
- AND u_reissuemx.reissueid = u_reissue.reissueid
- AND u_reissue.flag = 1 USING commit_transaction;
-
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '更新费用单相关应收帐ID失败'
- rslt = 0
- GOTO ext
- END IF
- END IF
- NEXT
- ELSEIF r_type = 2 THEN //?
- FOR ll_i = 1 TO it_mxbt
- IF Trim(reissuemx[ll_i].mxdscrp) = '' THEN
- ls_about = reissuecode + ',' + reissuemx[ll_i].mtrlname
- ELSE
- ls_about = reissuecode + ',' + reissuemx[ll_i].mtrlname + ',' + reissuemx[ll_i].mxdscrp
- END IF
-
- ls_dscrp = ls_about
-
- ld_mstpayamt = reissuemx[ll_i].amt
-
- IF li_btype = 1 THEN
- ld_payamt = ld_mstpayamt
- ELSE
- ld_payamt = 0
- END IF
-
- s_bmstpay s_pay
- s_pay.scid = scid
- s_pay.sptid = cusid
- s_pay.paydate = reissuedate
- s_pay.inrep = reissueemp
- s_pay.oriamt = ld_mstpayamt
- s_pay.mstpayamt = ld_mstpayamt
- s_pay.payamt = ld_payamt
- s_pay.dscrp = ls_dscrp
- s_pay.billcode = reissuecode
- s_pay.banktypeid = relid
- //s_pay.viewdate
- s_pay.opemp = publ_operator
- s_pay.buildtype = 1
- s_pay.inwareid = reissueid
- s_pay.accountsid = ll_accountsid
- s_pay.itemid = itemid
-
- // IF uo_pay.add_payrec (s_pay,arg_msg,FALSE) = 0 THEN
- // rslt = 0
- // GOTO ext
- // END IF
-
- DateTime plandate
- SetNull(plandate)
- IF uo_pay.add_payrec (scid,cusid,reissuedate,reissueemp,ld_mstpayamt,ld_mstpayamt,ld_payamt,ls_dscrp,&
- reissuecode,relid,1,publ_operator,reissueid,0,arg_msg,FALSE,plandate,ll_accountsid,itemid,moneyid ,relcode) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- UPDATE u_reissuemx
- SET relid = :uo_pay.ref_payid
- FROM u_reissuemx,u_reissue
- WHERE u_reissuemx.reissueid = :reissueid
- AND u_reissuemx.printid = :reissuemx[ll_i].printid
- AND u_reissuemx.scid = :scid
- AND u_reissuemx.scid = u_reissue.scid
- AND u_reissuemx.reissueid = u_reissue.reissueid
- AND u_reissue.flag = 1 USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '更新相关应收帐ID失败'
- rslt = 0
- GOTO ext
- END IF
- NEXT
- END IF
- flag = 1
- ext:
- DESTROY uo_take
- DESTROY uo_pay
- IF rslt = 0 THEN
- ROLLBACK USING commit_transaction;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT USING commit_transaction;
- END IF
- reissueid = 0 //还原reissueid
- RETURN rslt
- end function
- public function integer c_auditing (boolean arg_ifcommit, ref string arg_msg);Long rslt = 1,cnt = 0,ll_i
- uo_musttake uo_take
- uo_mustpay uo_pay
- uo_take = CREATE uo_musttake
- uo_pay = create uo_mustpay
- Long ll_takeid
- DateTime null_dt
- SetNull(null_dt)
- IF reissueid = 0 THEN
- rslt = 0
- arg_msg = "没有审核对象"
- GOTO ext
- END IF
- IF it_newbegin OR it_updatebegin THEN
- rslt = 0
- arg_msg = "编辑状态下不可以执行审核"
- GOTO ext
- END IF
- IF cwauditingflag = 1 THEN
- rslt = 0
- arG_MSG = "该单据已经总账审核,不能进行财务撤审"
- GOTO ext
- END IF
- IF flag = 0 THEN
- rslt = 0
- arg_msg = "单据还未审核"
- GOTO ext
- END IF
- SELECT count(*) INTO :cnt
- FROM u_user
- Where username = :publ_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
- UPDATE u_reissue
- SET Auditingrep = '',
- Auditingdate = :null_dt,
- flag = 0,
- relint_3 = 0
- WHERE u_reissue.reissueid = :reissueid
- AND flag = 1
- AND scid = :scid USING commit_transaction;
-
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致审核单据操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- ELSEIF commit_transaction.SQLNRows = 0 THEN
- rslt = 0
- arg_msg = "单据正在审核,请稍后查询。"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- IF r_type = 0 THEN
- IF sumamt <> 0 THEN
- IF uo_take.del_takerec(scid,1,relint_3,cusid,arg_msg,FALSE) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- ELSEIF r_type = 1 THEN
- FOR ll_i = 1 TO it_mxbt
- IF reissuemx[ll_i].amt <> 0 THEN
- IF uo_take.del_takerec(scid,1,reissuemx[ll_i].relid,cusid,arg_msg,FALSE) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- UPDATE u_reissuemx
- SET relid = 0
- WHERE u_reissuemx.reissueid = :reissueid
- AND u_reissuemx.printid = :reissuemx[ll_i].printid
- AND u_reissuemx.scid = :scid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致审核单据操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- END IF
- NEXT
- ELSEIF r_type = 2 THEN
-
- FOR ll_i = 1 TO it_mxbt
- IF reissuemx[ll_i].amt <> 0 THEN
- IF uo_pay.del_payrec(scid,1,reissuemx[ll_i].relid,cusid,arg_msg,FALSE) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- UPDATE u_reissuemx
- SET relid = 0
- WHERE u_reissuemx.reissueid = :reissueid
- AND u_reissuemx.printid = :reissuemx[ll_i].printid
- AND u_reissuemx.scid = :scid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致审核单据操作失败"+"~n"+commit_transaction.SQLErrText
- GOTO ext
- END IF
- END IF
- NEXT
- END IF
- flag = 0
- ext:
- DESTROY uo_take
- DESTROY uo_pay
- 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 (decimal arg_qty, double arg_price, decimal arg_amt, string arg_mxdscrp, long arg_printid, ref string arg_msg, long arg_mtrlid, string arg_mtrlname);Int rslt = 1
- Long cnt = 0
- IF it_newbegin = FALSE AND it_updatebegin = FALSE THEN
- rslt = 0
- arg_msg = "非编辑状态不可以使用,操作取消"
- GOTO ext
- END IF
- //清除空值
- IF IsNull(arg_qty) THEN arg_qty = 0
- IF IsNull(arg_price) THEN arg_price = 0
- IF IsNull(arg_printid) THEN arg_printid = 0
- IF IsNull(arg_amt) THEN arg_amt = 0
- IF IsNull(arg_mxdscrp) THEN arg_mxdscrp = ''
- IF IsNull(arg_mtrlid) THEN arg_mtrlid = 0
- IF IsNull(arg_mtrlname) THEN arg_mtrlname = ''
- // 如果出仓数量为 0,或物料编号为空,则不作任何处理
- IF r_type = 0 THEN
- SELECT count(*) INTO :cnt
- FROM u_mtrldef
- Where mtrlid = :arg_mtrlid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = "查询物料资料失败,"+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF arg_mtrlid = 0 THEN
- rslt = 1
- GOTO ext
- END IF
- ELSEIF r_type = 1 THEN
- SELECT count(*) INTO :cnt
- FROM U_Expenses
- Where Expensesid = :arg_mtrlid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询项目资料失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF arg_mtrlid = 0 THEN
- rslt = 1
- GOTO ext
- END IF
-
- ELSEIF r_type = 2 AND arg_mtrlid > 0 THEN
- SELECT count(*) INTO :cnt
- FROM U_Expenses
- Where Expensesid = :arg_mtrlid USING commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '查询项目资料失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- END IF
- IF arg_qty = 0 THEN
- rslt = 1
- GOTO ext
- END IF
- //写入内容
- it_mxbt++
- reissuemx[it_mxbt].mtrlid = arg_mtrlid
- reissuemx[it_mxbt].qty = arg_qty
- reissuemx[it_mxbt].amt = Round(arg_amt,2)
- reissuemx[it_mxbt].price = arg_price
- reissuemx[it_mxbt].mxdscrp = arg_mxdscrp
- reissuemx[it_mxbt].printid = arg_printid
- reissuemx[it_mxbt].mtrlname = arg_mtrlname
- ext:
- IF rslt = 0 THEN
- p_clearmx()
- arg_msg = "第" + String(arg_printid) + "行," + arg_msg
- END IF
- RETURN rslt
- end function
- public function integer audit_subject (long arg_scid, long arg_billid, boolean arg_ifcommit, ref string arg_msg);
- Int rslt = 1,cnt = 0
- IF arg_billid = 0 THEN
- rslt = 0
- arg_msg = "没有审核对象"
- GOTO ext
- END IF
- IF p_getinfo(arg_scid,arg_billid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF flag = 0 THEN
- rslt = 0
- arg_msg = "单据没有审核"
- GOTO ext
- END IF
- IF cwauditingflag = 1 THEN
- rslt = 0
- arg_msg = "单据已经总账审核"
- GOTO ext
- END IF
- UPDATE u_reissue
- SET cwauditingflag = 1,
- cwauditingdate = getdate(),
- cwauditingrep = :publ_operator
- WHERE ( u_reissue.reissueid = :arg_billid ) AND
- ( u_reissue.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
- ext:
- IF arg_ifcommit And rslt = 1 THEN
- COMMIT Using commit_transaction;
- END IF
- Return (rslt)
- end function
- public function integer c_audit_subject (long arg_scid, long arg_billid, boolean arg_ifcommit, ref string arg_msg);
- Int rslt = 1,cnt = 0
- IF arg_billid = 0 THEN
- rslt = 0
- arg_msg = "没有审核对象"
- GOTO ext
- END IF
- IF p_getinfo(arg_scid,arg_billid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF cwauditingflag = 0 THEN
- rslt = 0
- arg_msg = "单据没有总账审核"
- GOTO ext
- END IF
- UPDATE u_reissue
- SET cwauditingflag = 0,
- cwauditingdate =null,
- cwauditingrep = ''
- WHERE ( u_reissue.reissueid = :arg_billid ) AND
- ( u_reissue.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
- ext:
- IF arg_ifcommit And rslt = 1 THEN
- COMMIT Using commit_transaction;
- END IF
- Return (rslt)
- end function
- on uo_reissue_sptcust.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_reissue_sptcust.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|