123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- $PBExportHeader$uo_orderrqmtrl.sru
- forward
- global type uo_orderrqmtrl from nonvisualobject
- end type
- end forward
- global type uo_orderrqmtrl from nonvisualobject
- end type
- global uo_orderrqmtrl uo_orderrqmtrl
- type variables
- transaction commit_transaction
- end variables
- forward prototypes
- public function integer uf_rqdate_changed (long arg_scid, long arg_orderid, long arg_mtrlid, long arg_wrkgrpid, string arg_status, string arg_woodcode, string arg_pcode, long arg_plantype, long arg_produce_wrkgrpid, datetime arg_rqdate, ref string arg_msg, boolean if_commit)
- end prototypes
- public function integer uf_rqdate_changed (long arg_scid, long arg_orderid, long arg_mtrlid, long arg_wrkgrpid, string arg_status, string arg_woodcode, string arg_pcode, long arg_plantype, long arg_produce_wrkgrpid, datetime arg_rqdate, ref string arg_msg, boolean if_commit);Int rslt = 1
- DateTime ld_org_date
- Decimal ld_rqqty
- SELECT rqdate, rqqty
- INTO :ld_org_date, :ld_rqqty
- FROM u_OrderRqMtrl
- WHERE scid = :arg_scid
- AND orderid = :arg_orderid
- AND mtrlid = :arg_mtrlid
- AND wrkgrpid = :arg_wrkgrpid
- AND status = :arg_status
- AND woodcode = :arg_woodcode
- AND pcode = :arg_pcode
- AND plantype = :arg_plantype
- AND produce_wrkGrpid = :arg_produce_wrkGrpid
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询物料需求时间失败,' + commit_transaction.SQLErrText
- GOTO ext
- END IF
- IF ld_org_date = arg_rqdate THEN
- GOTO ext
- END IF
- //IF f_aps_mtrl_will_add(arg_scid,arg_mtrlid,arg_status,arg_woodcode,arg_pcode,ld_org_date,0 - ld_rqqty,2,arg_msg,mrp_sqlca,True) = 0 THEN
- // rslt = 0
- // GOTO ext
- //END IF
- //
- //IF f_aps_mtrl_will_add(arg_scid,arg_mtrlid,arg_status,arg_woodcode,arg_pcode,arg_rqdate,ld_rqqty,2,arg_msg,mrp_sqlca,True) = 0 THEN
- // rslt = 0
- // GOTO ext
- //END IF
- UPDATE u_OrderRqMtrl
- SET rqdate = :arg_rqdate
- WHERE scid = :arg_scid
- AND orderid = :arg_orderid
- AND mtrlid = :arg_mtrlid
- AND wrkgrpid = :arg_wrkgrpid
- AND status = :arg_status
- AND woodcode = :arg_woodcode
- AND pcode = :arg_pcode
- AND plantype = :arg_plantype
- AND produce_wrkGrpid = :arg_produce_wrkGrpid
- Using commit_transaction;
- IF commit_transaction.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '更新物料需求日期失败,' + commit_transaction.SQLErrText
- GOTO ext
- END IF
- GOTO ext
- ext:
- IF rslt = 1 And if_commit THEN
- COMMIT Using commit_transaction;
- ELSEIF rslt = 0 THEN
- ROLLBACK Using commit_transaction;
- END IF
- RETURN rslt
- end function
- on uo_orderrqmtrl.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_orderrqmtrl.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|