123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- $PBExportHeader$uo_transqty_ws.sru
- forward
- global type uo_transqty_ws from nonvisualobject
- end type
- end forward
- global type uo_transqty_ws from nonvisualobject
- end type
- global uo_transqty_ws uo_transqty_ws
- type variables
- Long uo_billid
- String uo_billcode
- end variables
- forward prototypes
- public function integer add_dscrp (long arg_billid, string arg_newdescppart, ref string arg_msg)
- public function integer del (long arg_billid, ref string arg_msg, boolean arg_ifcommit)
- public function integer updatebegin (long arg_billid, ref string arg_msg)
- public function integer audit (long arg_billid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit)
- public function integer caudit (long arg_billid, ref string arg_msg, boolean arg_ifcommit)
- public function integer save (s_transqty_ws arg_s_transqty, string arg_opemp, ref string arg_msg, boolean arg_ifcommit)
- public function integer getinfo (long arg_billid, ref s_transqty_wsmx arg_s_mx[], ref long arg_arr_cnt, ref string arg_msg)
- public function integer p_getflag (long arg_billid, ref long arg_flag, ref string arg_msg)
- end prototypes
- public function integer add_dscrp (long arg_billid, string arg_newdescppart, ref string arg_msg);
- Int rslt = 1
- long ll_flag
- IF arg_newdescppart = '' THEN
- rslt = 0
- arG_MSG = "要添加内容为空,操作取消"
- GOTO ext
- END IF
- IF p_getflag(arg_billid,ll_flag,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF ll_flag = 0 THEN
- rslt = 0
- arG_MSG = "待审核状态下不可用"
- GOTO ext
- END IF
- UPDATE u_transqty_ws
- SET DSCRP = DSCRP+' '+:arg_newdescppart
- WHERE u_transqty_ws.billid = :arg_billid;
- IF SQLCA.SQLCode <> 0 THEN
- rslt = 0
- arG_MSG = "因网络或其它原因导致添加备注操作失败"+"~n"+SQLCA.SQLErrText
- GOTO ext
- END IF
- ext:
- IF rslt = 1 THEN
- COMMIT;
- ELSE
- ROLLBACK;
- END IF
- Return (rslt)
- end function
- public function integer del (long arg_billid, ref string arg_msg, boolean arg_ifcommit);int rslt = 1
- long ll_flag
- if arg_billid <= 0 then
- rslt = 0
- arg_msg = '错误单据唯一码'
- GOTO ext
- END IF
- IF p_getflag(arg_billid,ll_flag,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- if ll_flag <> 0 then
- rslt = 0
- arg_msg = '单据不是在待审核状态,不能删除'
- GOTO ext
- END IF
- DELETE FROM u_transqty_wsmx
- WHERE billid = :arg_billid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "删除单据明细操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- DELETE FROM u_transqty_ws
- WHERE billid = :arg_billid
- AND flag = 0;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "删除单据操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT;
- END IF
- RETURN rslt
- end function
- public function integer updatebegin (long arg_billid, ref string arg_msg);Int rslt = 1
- long li_flag
- IF arg_billid <= 0 THEN
- rslt = 0
- arg_msg = '错误单据唯一码'
- GOTO ext
- END IF
- IF p_getflag(arg_billid,li_flag,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF li_flag = 1 THEN
- rslt = 0
- arg_msg = '单据已经审核,不可以修改,要修改请先撤销审核'
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
- public function integer audit (long arg_billid, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Long ll_flag
- IF arg_billid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误单据唯一码'
- GOTO ext
- END IF
- IF p_getflag(arg_billid,ll_flag,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF ll_flag <> 0 THEN
- rslt = 0
- ARG_MSG = '单据不是在待审核状态,不可以再审'
- GOTO ext
- END IF
- DateTime ld_billdate
- Long ll_scid,ll_storageid
- String ls_rep,ls_billcode,ls_dscrp
- long ll_billtype
- long rst_outwareid,rst_inwareid
- SELECT billdate,scid,storageid,rep,billcode,dscrp,billtype
- INTO :ld_billdate,:ll_scid,:ll_storageid,:ls_rep,:ls_billcode,:ls_dscrp,:ll_billtype
- FROM u_transqty_ws
- Where billid = :arg_billid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = '查询单据相关信息失败,'+sqlca.SQLErrText
- GOTO ext
- END IF
- s_transqty_wsmx s_mx[]
- Long ll_arr_cnt,i
- IF getinfo(arg_billid,s_mx,ll_arr_cnt,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- uo_outware uo_out
- uo_out = CREATE uo_outware
- uo_out.commit_transaction = sqlca
- uo_out.if_getid_ture = FALSE
- uo_inware uo_in
- uo_in = CREATE uo_inware
- uo_in.commit_transaction = sqlca
- uo_in.if_getid_ture = FALSE
- //////
- IF uo_out.newbegin(ll_scid,20,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- uo_out.relid = arg_billid
- uo_out.outdate = ld_billdate
- uo_out.outrep = ls_rep
- uo_out.part = ls_billcode
- uo_out.dscrp = ls_dscrp
- uo_out.cusname = '车间库存分配数转换单自动生成'
- uo_out.storageid = ll_storageid
- Decimal ld_qty
- FOR i = 1 TO ll_arr_cnt
- IF ll_billtype = 0 THEN
- ld_qty = s_mx[i].transqty
- ELSE
- ld_qty = 0 - s_mx[i].transqty
- END IF
-
- IF uo_out.acceptmx(s_mx[i].mtrlwareid,&
- ld_qty,s_mx[i].fprice,1,&
- s_mx[i].mxdscrp,s_mx[i].printid,ARG_MSG,0,0,0,0,'',0,0,&
- s_mx[i].unit,ld_qty,1,'','',0,0,'',0,0,0,0,'','') = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- IF uo_out.Save(FALSE,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- rst_outwareid = uo_out.outwareid
- IF uo_out.getinfo(ll_scid,rst_outwareid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_out.auditing(FALSE,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- /////////
- ////////////////
- IF uo_in.newbegin(ll_scid,21,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- uo_in.relid = arg_billid
- uo_in.indate = ld_billdate
- uo_in.inrep = ls_rep
- uo_in.part = ls_billcode
- uo_in.dscrp = ls_dscrp
- uo_in.storageid = ll_storageid
- uo_in.sptname = '车间库存分配数转换单自动生成'
- FOR i = 1 TO ll_arr_cnt
- IF ll_billtype = 0 THEN
- ld_qty = s_mx[i].transqty
- ELSE
- ld_qty = 0 - s_mx[i].transqty
- END IF
- IF uo_in.acceptmx(s_mx[i].printid,&
- s_mx[i].mtrlid,&
- s_mx[i].mtrlcode,&
- s_mx[i].plancode,&
- s_mx[i].status,&
- ld_qty,&
- s_mx[i].fprice,&
- 1,&
- s_mx[i].mxdscrp,&
- arg_msg,&
- 0,0,0,s_mx[i].woodcode,&
- s_mx[i].pcode,&
- s_mx[i].sptid,&
- s_mx[i].unit,&
- 1,&
- ld_qty,0,0,'','',0,0,'','',&
- ld_qty,&
- 0) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- IF uo_in.Save(FALSE,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- rst_inwareid = uo_in.inwareid
- //4.原事务审核进仓单
- IF uo_in.getinfo(ll_scid,rst_inwareid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_in.auditing(FALSE,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ///////////////
- //更新审核标记
- UPDATE u_transqty_ws
- SET auditemp = :arg_opemp,
- auditdate = getdate(),
- flag = 1
- WHERE billid = :arg_billid
- AND flag = 0;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "因网络或其它原因导致单据审核操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT;
- END IF
- DESTROY uo_in
- DESTROY uo_out
- RETURN rslt
- end function
- public function integer caudit (long arg_billid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Long ll_flag
- DateTime null_dt
- SetNull(null_dt)
- uo_outware uo_out
- uo_out = CREATE uo_outware
- uo_out.commit_transaction = sqlca
- uo_out.if_getid_ture = FALSE
- uo_inware uo_in
- uo_in = CREATE uo_inware
- uo_in.commit_transaction = sqlca
- uo_in.if_getid_ture = FALSE
- IF arg_billid <= 0 THEN
- rslt = 0
- ARG_MSG = '错误单据唯一码'
- GOTO ext
- END IF
- IF p_getflag(arg_billid,ll_flag,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF ll_flag <> 1 THEN
- rslt = 0
- ARG_MSG = '单据不是在审核状态,不可以撤审'
- GOTO ext
- END IF
- Long ll_scid
- SELECT scid INTO :ll_scid
- FROM u_transqty_ws
- Where billid = :arg_billid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = '查询单据相关信息失败,'+sqlca.SQLErrText
- GOTO ext
- END IF
- Long rst_outwareid,rst_inwareid
- ///////////
- SELECT inwareid INTO :rst_inwareid
- FROM u_inware
- WHERE scid = :ll_scid
- AND relid = :arg_billid
- AND billtype = 21;
- IF sqlca.SQLCode <> 0 THEN
- ARG_MSG = '查询该单据相关进仓单失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF uo_in.getinfo(ll_scid,rst_inwareid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_in.c_auditing(FALSE,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_in.del(ll_scid,rst_inwareid,ARG_MSG,FALSE) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- /////////////
- /////////////////
- SELECT outwareid INTO :rst_outwareid
- FROM u_outware
- WHERE scid = :ll_scid
- AND relid = :arg_billid
- AND billtype = 20;
- IF sqlca.SQLCode <> 0 THEN
- ARG_MSG = '查询该单据相关出仓单失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- IF uo_out.getinfo(ll_scid,rst_outwareid,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_out.c_auditing(FALSE,ARG_MSG) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF uo_out.del(ll_scid,rst_outwareid,0,ARG_MSG,FALSE) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- ////////////
- //更新审核标记
- UPDATE u_transqty_ws
- SET auditemp = '',
- auditdate = :null_dt,
- flag = 0
- Where billid = :arg_billid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- ARG_MSG = "因网络或其它原因导致单据撤审操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT;
- END IF
- DESTROY uo_in
- DESTROY uo_out
- RETURN rslt
- end function
- public function integer save (s_transqty_ws arg_s_transqty, string arg_opemp, ref string arg_msg, boolean arg_ifcommit);Integer rslt = 1,cnt = 0
- DateTime server_dt
- Long ll_billid,it_mxbt,i
- String ls_sccode,ls_billcode
- IF IsNull(arg_s_transqty.scid) THEN arg_s_transqty.scid = 0
- IF IsNull(arg_s_transqty.billid) THEN arg_s_transqty.billid = 0
- IF IsNull(arg_s_transqty.rep) THEN arg_s_transqty.rep = ''
- IF IsNull(arg_s_transqty.dscrp) THEN arg_s_transqty.dscrp = ''
- IF IsNull(arg_s_transqty.storageid) THEN arg_s_transqty.storageid = 0
- IF arg_s_transqty.rep = '' THEN
- arg_msg = '请输入经手人'
- rslt = 0
- GOTO ext
- END IF
- IF arg_s_transqty.storageid = 0 THEN
- arg_msg = '请选择车间仓'
- rslt = 0
- GOTO ext
- END IF
- SELECT Top 1 getdate() INTO :server_dt FROM u_user;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "查询操作失败,日期 "
- GOTO ext
- END IF
- it_mxbt = UpperBound(arg_s_transqty.arg_s_mx)
- IF it_mxbt <= 0 THEN
- rslt = 0
- arg_msg = "没有正确明细内容"
- GOTO ext
- END IF
- IF arg_s_transqty.billid = 0 THEN
- ll_billid = f_sys_scidentity(0,"u_transqty_ws","billid",arg_msg,TRUE,id_sqlca)
-
- IF ll_billid <= 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
- IF f_get_sccode(arg_s_transqty.scid,sqlca,ls_sccode,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
-
-
- ls_billcode = getid(arg_s_transqty.scid,ls_sccode + 'TQ',Date(server_dt),FALSE,sqlca)
-
-
- IF ls_billcode = "err" THEN
- rslt = 0
- arg_msg = "无法获取单据编号"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
-
- INSERT INTO u_transqty_ws
- (scid,
- billid,
- billcode,
- billtype,
- storageid,
- relcode,
- flag,
- rep,
- billdate,
- dscrp,
- opemp,
- opdate
- )
- VALUES
- (:arg_s_transqty.scid,
- :ll_billid,
- :ls_billcode,
- :arg_s_transqty.billtype,
- :arg_s_transqty.storageid,
- :arg_s_transqty.relcode,
- :arg_s_transqty.flag,
- :arg_s_transqty.rep,
- :arg_s_transqty.billdate,
- :arg_s_transqty.dscrp,
- :arg_opemp,
- getdate()
- );
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致建立单据操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
-
- FOR i = 1 TO it_mxbt
- INSERT INTO u_transqty_wsmx
- (scid,
- billid,
- printid,
- mtrlwareid,
- mtrlid,
- status,
- woodcode,
- pcode,
- plancode,
- sptid,
- transqty,
- fprice,
- mxdscrp)
- VALUES
- (:arg_s_transqty.scid,
- :ll_billid,
- :arg_s_transqty.arg_s_mx[i].printid,
- :arg_s_transqty.arg_s_mx[i].mtrlwareid,
- :arg_s_transqty.arg_s_mx[i].mtrlid,
- :arg_s_transqty.arg_s_mx[i].status,
- :arg_s_transqty.arg_s_mx[i].woodcode,
- :arg_s_transqty.arg_s_mx[i].pcode,
- :arg_s_transqty.arg_s_mx[i].plancode,
- :arg_s_transqty.arg_s_mx[i].sptid,
- :arg_s_transqty.arg_s_mx[i].transqty,
- :arg_s_transqty.arg_s_mx[i].fprice,
- :arg_s_transqty.arg_s_mx[i].mxdscrp
- );
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- NEXT
-
- uo_billid = ll_billid
- uo_billcode = ls_billcode
-
- ELSE
- UPDATE u_transqty_ws
- SET billdate = :arg_s_transqty.billdate,
- rep = :arg_s_transqty.rep,
- relcode = :arg_s_transqty.relcode,
- dscrp = :arg_s_transqty.dscrp,
- moddate = getdate(),
- modemp = :arg_opemp,
- storageid = :arg_s_transqty.storageid
- WHERE billid = :arg_s_transqty.billid
- AND flag = 0 ;
- IF sqlca.SQLCode <> 0 OR sqlca.SQLNRows <= 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致更新单据操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
-
- DELETE FROM u_transqty_wsmx
- Where billid = :arg_s_transqty.billid;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "删除旧有明细操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
-
- FOR i = 1 TO it_mxbt
- INSERT INTO u_transqty_wsmx
- (scid,
- billid,
- printid,
- mtrlwareid,
- mtrlid,
- status,
- woodcode,
- pcode,
- plancode,
- sptid,
- transqty,
- fprice,
- mxdscrp)
- VALUES
- (:arg_s_transqty.scid,
- :arg_s_transqty.billid,
- :arg_s_transqty.arg_s_mx[i].printid,
- :arg_s_transqty.arg_s_mx[i].mtrlwareid,
- :arg_s_transqty.arg_s_mx[i].mtrlid,
- :arg_s_transqty.arg_s_mx[i].status,
- :arg_s_transqty.arg_s_mx[i].woodcode,
- :arg_s_transqty.arg_s_mx[i].pcode,
- :arg_s_transqty.arg_s_mx[i].plancode,
- :arg_s_transqty.arg_s_mx[i].sptid,
- :arg_s_transqty.arg_s_mx[i].transqty,
- :arg_s_transqty.arg_s_mx[i].fprice,
- :arg_s_transqty.arg_s_mx[i].mxdscrp
- );
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
- GOTO ext
- END IF
- NEXT
-
- uo_billid = arg_s_transqty.billid
-
- END IF
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF arg_ifcommit AND rslt = 1 THEN
- COMMIT;
- END IF
- RETURN rslt
- end function
- public function integer getinfo (long arg_billid, ref s_transqty_wsmx arg_s_mx[], ref long arg_arr_cnt, ref string arg_msg);Int rslt = 1
- Long i = 1 ,no_mxcheck
- IF arg_billid <= 0 THEN
- rslt = 0
- arg_msg = '错误单据唯一码'
- GOTO ext
- END IF
- DECLARE cur_mx CURSOR FOR
- SELECT u_mtrldef.mtrlcode,
- u_transqty_wsmx.transqty,
- u_transqty_wsmx.mxdscrp,
- u_transqty_wsmx.scid,
- u_transqty_wsmx.billid,
- u_transqty_wsmx.printid,
- u_transqty_wsmx.mtrlwareid,
- u_transqty_wsmx.mtrlid,
- u_transqty_wsmx.status,
- u_transqty_wsmx.woodcode,
- u_transqty_wsmx.pcode,
- u_transqty_wsmx.plancode,
- u_transqty_wsmx.sptid,
- u_transqty_wsmx.fprice,
- u_mtrldef.unit
- FROM u_transqty_wsmx INNER JOIN
- u_mtrldef ON u_transqty_wsmx.mtrlid = u_mtrldef.mtrlid
- WHERE u_transqty_wsmx.billid = :arg_billid
- Order By u_transqty_wsmx.printid;
-
- OPEN cur_mx;
- FETCH cur_mx INTO :arg_s_mx[i].mtrlcode,
- :arg_s_mx[i].transqty,
- :arg_s_mx[i].mxdscrp,
- :arg_s_mx[i].scid,
- :arg_s_mx[i].billid,
- :arg_s_mx[i].printid,
- :arg_s_mx[i].mtrlwareid,
- :arg_s_mx[i].mtrlid,
- :arg_s_mx[i].status,
- :arg_s_mx[i].woodcode,
- :arg_s_mx[i].pcode,
- :arg_s_mx[i].plancode,
- :arg_s_mx[i].sptid,
- :arg_s_mx[i].fprice,
- :arg_s_mx[i].unit;
- DO WHILE sqlca.SQLCode = 0
- i++
- FETCH cur_mx INTO :arg_s_mx[i].mtrlcode,
- :arg_s_mx[i].transqty,
- :arg_s_mx[i].mxdscrp,
- :arg_s_mx[i].scid,
- :arg_s_mx[i].billid,
- :arg_s_mx[i].printid,
- :arg_s_mx[i].mtrlwareid,
- :arg_s_mx[i].mtrlid,
- :arg_s_mx[i].status,
- :arg_s_mx[i].woodcode,
- :arg_s_mx[i].pcode,
- :arg_s_mx[i].plancode,
- :arg_s_mx[i].sptid,
- :arg_s_mx[i].fprice,
- :arg_s_mx[i].unit;
-
- LOOP
- CLOSE cur_mx;
- SELECT count(*) INTO :no_mxcheck
- FROM u_transqty_wsmx
- Where billid = :arg_billid;
- IF sqlca.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
- arg_arr_cnt = i - 1
- ext:
- RETURN rslt
- end function
- public function integer p_getflag (long arg_billid, ref long arg_flag, ref string arg_msg);Int rslt = 1
- SELECT flag
- INTO :arg_flag
- FROM u_transqty_ws
- WHERE billid = :arg_billid;
- IF sqlca.SQLCode <> 0 THEN
- ARG_MSG = '查询单据审核标记失败,'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- ext:
- RETURN rslt
- end function
- on uo_transqty_ws.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_transqty_ws.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|