123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708 |
- $PBExportHeader$uo_outware_ly.sru
- forward
- global type uo_outware_ly from uo_outware
- end type
- end forward
- global type uo_outware_ly from uo_outware
- end type
- global uo_outware_ly uo_outware_ly
- type variables
- end variables
- forward prototypes
- public function integer c_sec_auditing (long arg_scid, long arg_billid, ref string arg_msg, boolean arg_ifcommit)
- public function integer sec_auditing (long arg_scid, long arg_billid, ref string arg_msg, boolean arg_ifcommit)
- public function integer auditing (boolean arg_ifcommit, ref string arg_msg)
- public function integer uof_add_empmtrl_ly (integer arg_flag, boolean arg_ifcommit, ref string arg_msg)
- public function integer c_auditing (boolean arg_ifcommit, ref string arg_msg)
- end prototypes
- public function integer c_sec_auditing (long arg_scid, long arg_billid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Long cnt = 0,i
- Decimal ls_emp_sumwage
- DateTime null_server_dt
- SetNull(null_server_dt)
- IF getinfo(arg_scid,arg_billid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF secflag = 0 THEN
- rslt = 0
- arg_msg = '单据还没有财审,操作取消'
- GOTO ext
- END IF
- UPDATE u_outware SET
- secflag = 0,
- secauditingrep = '',
- secAuditingdate = :null_server_dt
- WHERE scid = :arg_scid
- and outwareid = :arg_billid
- AND flag = 1
- AND secflag = 1;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = '审核扣费单失败,原因>>'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- secflag = 0
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT;
- END IF
- RETURN rslt
- end function
- public function integer sec_auditing (long arg_scid, long arg_billid, ref string arg_msg, boolean arg_ifcommit);Int rslt = 1
- Long cnt = 0,i
- Decimal ls_emp_sumwage
- uo_wage u_wage
- u_wage = CREATE uo_wage
- Long ll_wagemth
- IF getinfo(arg_scid,arg_billid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- IF secflag = 1 THEN
- rslt = 0
- arg_msg = '单据还已经财审,操作取消'
- GOTO ext
- END IF
- UPDATE u_outware SET
- secflag = 1,
- secauditingrep = :publ_operator,
- secAuditingdate = getdate()
- WHERE scid = :arg_scid
- AND outwareid = :arg_billid
- AND flag = 1
- AND secflag = 0;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = '审核扣费单失败,原因>>'+sqlca.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- secflag = 1
- ext:
- IF rslt = 0 THEN
- ROLLBACK;
- ELSEIF rslt = 1 AND arg_ifcommit THEN
- COMMIT;
- END IF
- DESTROY u_wage
- RETURN rslt
- end function
- public function integer auditing (boolean arg_ifcommit, ref string arg_msg);Int rslt = 1
- Long cnt = 0,i,j,mx_barcode_cnt
- String ls_storagename
- Int li_outtype,li_storagetype
- Decimal ld_sumnotoutqty
- IF uo_option_inout_type = -1000 THEN
- rslt = 0
- arg_msg = '选项:[142]进出仓高级选项,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- IF uo_option_barcode_outwareother_paudit = -1000 THEN
- rslt = 0
- arg_msg = '选项:[205]仓库使用条码流程,其它出仓单使用先确认后审核流程,读取初始默认值失败,操作取消!'
- GOTO ext
- END IF
- uo_mtrlware_assign uo_ma
- uo_ma = Create uo_mtrlware_assign
- uo_ma.commit_transaction = commit_transaction
- uo_sqlpro uo_pro
- uo_pro = Create uo_sqlpro
- uo_pro.commit_transaction = commit_transaction
- //库存分配ds
- datastore ds_out_assign
- ds_out_assign = Create datastore
- ds_out_assign.DataObject = 'ds_outwaremx_assign'
- ds_out_assign.SetTransObject(commit_transaction)
- IF outwareid = 0 THEN
- rslt = 0
- arg_msg = "没有出仓审核对象"
- GOTO ext
- END IF
- IF storageid = 0 THEN
- rslt = 0
- arg_msg = '没有正确的仓库'
- GOTO ext
- END IF
- IF billtype <> 9 THEN
- IF uof_check_warepdb_audit(storageid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- SELECT storagename,outtype,storagetype
- INTO :ls_storagename,:li_outtype,:li_storagetype
- FROM u_storage
- Where storageid = :storageid Using commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "查询操作失败,仓库"
- GOTO ext
- END IF
- //检查是否有该仓库的建立权限
- IF sys_user_storagestr_audit <> '0' THEN
- IF Pos(sys_user_storagestr_audit,','+String(storageid)+',') <= 0 THEN
- rslt = 0
- arg_msg = '没有仓库: '+ls_storagename+' 的审核权限,不允许审核该仓库的单据'
- GOTO ext
- END IF
- END IF
- //
- IF uo_option_inout_type = 2 And &
- ( uo_option_barcode_outwareother_paudit = 1 And billtype = 8 ) THEN
- IF priceflag = 0 THEN
- arg_msg = '单据未确认,不能审核'
- rslt = 0
- GOTO ext
- END IF
- END IF
- IF flag = 1 THEN
- rslt = 0
- arg_msg = "单据已经审核"
- GOTO ext
- END IF
- IF li_outtype = 2 THEN
- FOR i = 1 To it_mxbt
- IF outwaremx[i].outtype_mtrl = 2 THEN mx_barcode_cnt++
- NEXT
-
- IF billtype = 8 And mx_barcode_cnt > 0 THEN
- IF uof_check_qty_to_bqty(arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
- UPDATE u_outware
- SET Auditingrep = :publ_operator,
- Auditingdate = getdate(),
- flag = 1
- WHERE u_outware.outwareid = :outwareid
- 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
- FOR i = 1 To it_mxbt
-
- Decimal ld_ref_costamt
-
- // ld_ref_costamt = 0
- IF p_update_cost(outwaremx[i].mtrlwareid,outwaremx[i].mtrlcode,&
- outwaremx[i].qty,outwaremx[i].printid,ld_ref_costamt,arg_msg,False) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
-
- IF billtype <> 19 THEN
-
- IF sys_option_inout_procedure = 0 THEN
- IF p_update_mtrlware ( outwaremx[i].mtrlwareid, outwaremx[i].mtrlid, &
- outwaremx[i].mtrlcode, storageid, outwaremx[i].plancode,&
- outwaremx[i].status, outwaremx[i].qty,outwaremx[i].uqty,ld_ref_costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,outwaremx[i].ifvqty,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
-
- ELSE
- IF uo_pro.p_outware_update_mtrlware(scid,outwareid,outwaremx[i].printid,outwaremx[i].mtrlwareid,&
- outwaremx[i].mtrlid,outwaremx[i].mtrlcode,storageid,outwaremx[i].plancode,outwaremx[i].status,&
- outwaremx[i].qty,outwaremx[i].uqty,ld_ref_costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- END IF
-
- //更新库存分配(销售出仓单包件出仓)
- Long ll_taskid,ll_taskprintid
- Decimal ld_assign_outqty
-
- IF li_storagetype = 1 And billtype = 21 And outwaremx[i].ifpack = 1 THEN
- ll_taskid = 0
- ll_taskprintid = 0
- ld_assign_outqty = 0
-
- SELECT u_outwaremx.relid,
- u_outwaremx.relprintid
- INTO :ll_taskid,
- :ll_taskprintid
- FROM u_outwaremx
- WHERE u_outwaremx.scid = :scid
- AND u_outwaremx.outwareid = :outwareid
- AND u_outwaremx.printid = :outwaremx[i].olmtrlid
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '销售出仓单明细行:'+String(i)+'查询相关发货单明细所属订单明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- ds_out_assign.Retrieve(scid,outwaremx[i].mtrlwareid,ll_taskid,ll_taskprintid)
-
- IF ds_out_assign.RowCount() > 0 THEN
- ld_sumnotoutqty = ds_out_assign.Object.sumnotoutqty[1]
- ELSE
- ld_sumnotoutqty = 0
- END IF
-
- ds_out_assign.AcceptText()
- IF outwaremx[i].qty > ld_sumnotoutqty THEN
- arg_msg = '行:'+String(i)+'订单库存分配数不足,请检查库存分配明细'
- rslt = 0
- GOTO ext
- ELSE
- ld_assign_outqty = 0
- FOR j = 1 To ds_out_assign.RowCount()
- IF ds_out_assign.Object.notoutqty[j] >= outwaremx[i].qty THEN
- ld_assign_outqty = outwaremx[i].qty
- IF uo_ma.uof_assign_addoutqty(ds_out_assign.Object.assignid[j],ld_assign_outqty,arg_msg,False) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- EXIT
- ELSE
- ld_assign_outqty = ds_out_assign.Object.notoutqty[j]
- IF uo_ma.uof_assign_addoutqty(ds_out_assign.Object.assignid[j],ld_assign_outqty,arg_msg,False) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- outwaremx[i].qty = outwaremx[i].qty - ds_out_assign.Object.notoutqty[j]
- END IF
- NEXT
- END IF
- END IF
- ELSE
- IF sys_option_inout_procedure = 0 THEN
- IF p_update_mtrlware_ws( outwaremx[i].mtrlwareid, outwaremx[i].mtrlid, &
- outwaremx[i].mtrlcode, storageid, outwaremx[i].plancode,&
- outwaremx[i].status, outwaremx[i].qty,outwaremx[i].uqty,ld_ref_costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- ELSE
- IF uo_pro.p_outware_update_mtrlware(scid,outwareid,outwaremx[i].printid,outwaremx[i].mtrlwareid,&
- outwaremx[i].mtrlid,outwaremx[i].mtrlcode,storageid,outwaremx[i].plancode,outwaremx[i].status,&
- outwaremx[i].qty,outwaremx[i].uqty,ld_ref_costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
- NEXT
- IF li_outtype = 2 And mx_barcode_cnt > 0 THEN
- IF uof_p_barcode(1,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- //更新人员 领用物料信息
- IF relint_1 = 0 THEN
- IF uof_add_empmtrl_ly(0, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- //更新库存已开单数(减)
- If uof_noauditingqty_del(scid,outwareid,arG_MSG) = 0 Then
- rslt = 0
- Goto ext
- End If
- flag = 1
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF rslt = 1 And arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- Destroy uo_ma
- Destroy ds_out_assign
- Destroy uo_pro
- RETURN rslt
- end function
- public function integer uof_add_empmtrl_ly (integer arg_flag, boolean arg_ifcommit, ref string arg_msg);Int rslt = 1
- Long i
- uo_empinfo uo_emp
- uo_emp = Create uo_empinfo
- IF arg_flag = 0 THEN //审核
- FOR i = 1 To it_mxbt
- IF uo_emp.uof_add_empmtrl_ly(outwaremx[i].relid, outwaremx[i].mtrlid, outwaremx[i].status, outwaremx[i].woodcode, outwaremx[i].pcode, outwaremx[i].qty,outwaremx[i].cost, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- ELSE
- FOR i = 1 To it_mxbt
- IF uo_emp.uof_add_empmtrl_ly(outwaremx[i].relid, outwaremx[i].mtrlid, outwaremx[i].status, outwaremx[i].woodcode, outwaremx[i].pcode, 0 - outwaremx[i].qty,outwaremx[i].cost, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- END IF
- ext:
- Destroy uo_emp
- RETURN rslt
- end function
- public function integer c_auditing (boolean arg_ifcommit, ref string arg_msg);Int rslt = 1
- Long cnt = 0,i,j,mx_barcode_cnt
- String ls_storagename
- Int li_outtype,li_storagetype
- Decimal ld_sumnotoutqty
- DateTime null_dt
- SetNull(null_dt)
- uo_mtrlware_assign uo_ma
- uo_ma = Create uo_mtrlware_assign
- uo_ma.commit_transaction = commit_transaction
- uo_sqlpro uo_pro
- uo_pro = Create uo_sqlpro
- uo_pro.commit_transaction = commit_transaction
- //库存分配ds
- datastore ds_out_assign
- ds_out_assign = Create datastore
- ds_out_assign.DataObject = 'ds_outwaremx_assign_cancel'
- ds_out_assign.SetTransObject(commit_transaction)
- IF storageid = 0 THEN
- rslt = 0
- arg_msg = '没有正确的仓库'
- GOTO ext
- END IF
- IF billtype <> 9 THEN
- IF uof_check_warepdb_audit(storageid,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- SELECT storagename,outtype,storagetype
- INTO :ls_storagename,:li_outtype,:li_storagetype
- FROM u_storage
- Where storageid = :storageid Using commit_transaction ;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = "查询操作失败,仓库"
- GOTO ext
- END IF
- //检查是否有该仓库的建立权限
- IF sys_user_storagestr_audit <> '0' THEN
- IF Pos(sys_user_storagestr_audit,','+String(storageid)+',') <= 0 THEN
- rslt = 0
- arg_msg = '没有仓库: '+ls_storagename+' 的审核权限,不允许撤审该仓库的单据'
- GOTO ext
- END IF
- END IF
- //
- IF outwareid = 0 THEN
- rslt = 0
- arg_msg = "没有出仓撤审对象"
- GOTO ext
- END IF
- IF ctmint > 0 THEN
- arg_msg = '单据已截数,不能操作'
- rslt = 0
- GOTO ext
- END IF
- IF flag = 0 THEN
- rslt = 0
- arg_msg = "单据还未审核"
- GOTO ext
- END IF
- IF balcflag = 1 THEN
- rslt = 0
- arg_msg = "单据已经日结,不能撤审"
- GOTO ext
- END IF
- //检查是否开归还单
- UPDATE u_outware
- SET Auditingrep = '',
- Auditingdate = :null_dt,
- flag = 0
- WHERE u_outware.outwareid = :outwareid
- AND flag = 1
- AND secflag = 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
- FOR i = 1 To it_mxbt
- IF billtype <> 19 THEN
- IF sys_option_inout_procedure = 0 THEN
- IF p_update_mtrlware ( outwaremx[i].mtrlwareid, outwaremx[i].mtrlid, &
- outwaremx[i].mtrlcode, storageid, outwaremx[i].plancode,&
- outwaremx[i].status, 0 - outwaremx[i].qty,0 - outwaremx[i].uqty,0 - outwaremx[i].costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid, outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,outwaremx[i].ifvqty,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- ELSE
- IF uo_pro.p_outware_update_mtrlware(scid,outwareid,outwaremx[i].printid,outwaremx[i].mtrlwareid,&
- outwaremx[i].mtrlid,outwaremx[i].mtrlcode,storageid,outwaremx[i].plancode,outwaremx[i].status,&
- 0 - outwaremx[i].qty,0 - outwaremx[i].uqty,outwaremx[i].costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- END IF
-
- //更新库存分配
- Decimal ld_assign_outqty
- Long ll_taskid,ll_taskprintid
- IF li_storagetype = 1 And billtype = 21 And outwaremx[i].ifpack = 1 THEN
- ll_taskid = 0
- ll_taskprintid = 0
- ld_assign_outqty = 0
-
- SELECT u_outwaremx.relid,
- u_outwaremx.relprintid
- INTO :ll_taskid,
- :ll_taskprintid
- FROM u_outwaremx
- WHERE u_outwaremx.scid = :scid
- AND u_outwaremx.outwareid = :outwareid
- AND u_outwaremx.printid = :outwaremx[i].olmtrlid
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- arg_msg = '销售出仓单明细行:'+String(i)+'查询相关发货单明细所属订单明细失败,'+commit_transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
-
- ds_out_assign.Retrieve(scid,outwaremx[i].mtrlwareid,ll_taskid,ll_taskprintid)
-
- IF ds_out_assign.RowCount() > 0 THEN
- ld_sumnotoutqty = ds_out_assign.Object.sumnotoutqty[1]
- ELSE
- ld_sumnotoutqty = 0
- END IF
-
- ds_out_assign.AcceptText()
- IF outwaremx[i].qty > ld_sumnotoutqty THEN
- arg_msg = '行:'+String(i)+'订单库存分配已出仓数不足,不能撤审,请检查库存分配明细'
- rslt = 0
- GOTO ext
- ELSE
- ld_assign_outqty = 0
- FOR j = 1 To ds_out_assign.RowCount()
- IF ds_out_assign.Object.notoutqty[j] >= outwaremx[i].qty THEN
- ld_assign_outqty = outwaremx[i].qty
- IF uo_ma.uof_assign_addoutqty(ds_out_assign.Object.assignid[j],0 - ld_assign_outqty,arg_msg,False) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- EXIT
- ELSE
- ld_assign_outqty = ds_out_assign.Object.notoutqty[j]
- IF uo_ma.uof_assign_addoutqty(ds_out_assign.Object.assignid[j],0 - ld_assign_outqty,arg_msg,False) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- outwaremx[i].qty = outwaremx[i].qty - ds_out_assign.Object.notoutqty[j]
- END IF
- NEXT
- END IF
- END IF
- ELSE
- IF sys_option_inout_procedure = 0 THEN
- IF p_update_mtrlware_ws( outwaremx[i].mtrlwareid, outwaremx[i].mtrlid, &
- outwaremx[i].mtrlcode, storageid, outwaremx[i].plancode,&
- outwaremx[i].status, 0 - outwaremx[i].qty,0 - outwaremx[i].uqty,0 - outwaremx[i].costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid, outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- ELSE
- IF uo_pro.p_outware_update_mtrlware(scid,outwareid,outwaremx[i].printid,outwaremx[i].mtrlwareid,&
- outwaremx[i].mtrlid,outwaremx[i].mtrlcode,storageid,outwaremx[i].plancode,outwaremx[i].status,&
- 0 - outwaremx[i].qty,0 - outwaremx[i].uqty,outwaremx[i].costamt,&
- outwaremx[i].planprice, outwaremx[i].sptid,outwaremx[i].dxflag,&
- outwaremx[i].woodcode, outwaremx[i].pcode,outwaremx[i].mtrlcuscode,outwaremx[i].Location,arg_msg) = 0 THEN
- arg_msg = '行:'+String(i)+','+arg_msg
- rslt = 0
- GOTO ext
- END IF
- END IF
- END IF
-
- IF li_outtype = 2 And outwaremx[i].outtype_mtrl = 2 THEN mx_barcode_cnt++
- NEXT
- IF li_outtype = 2 And mx_barcode_cnt > 0 THEN
- IF uof_p_barcode(0,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- //更新人员 领用物料信息
- IF relint_1 = 0 THEN
- IF uof_add_empmtrl_ly(1, False, arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- //增加已开单数
- If uof_noauditingqty_add(scid,billtype,relint_1,arg_msg) = 0 Then
- rslt = 0
- Goto ext
- End If
- flag = 0
- ext:
- IF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- ELSEIF rslt = 1 And arg_ifcommit THEN
- COMMIT Using commit_transaction;
- END IF
- Destroy uo_ma
- Destroy ds_out_assign
- Destroy uo_pro
- RETURN rslt
- end function
- on uo_outware_ly.create
- call super::create
- end on
- on uo_outware_ly.destroy
- call super::destroy
- end on
|