$PBExportHeader$f_outware_sale_audit.srf global type f_outware_sale_audit from function_object end type forward prototypes global function integer f_outware_sale_audit (ref string arg_msg, ref long arg_cnt, ref long arg_failcnt) end prototypes global function integer f_outware_sale_audit (ref string arg_msg, ref long arg_cnt, ref long arg_failcnt);uo_outware_sale uo_ware uo_ware = Create uo_outware_sale uo_ware.commit_transaction = sqlca datastore ds_outware ds_outware = Create datastore ds_outware.DataObject = 'ds_outware_sale_noaudit_pda' ds_outware.SetTransObject(sqlca) ds_outware.Retrieve() Long ll_i String ls_outwarecode Long ll_scid,ll_outwareid String ls_msg Long ll_fail,ll_suc FOR ll_i = 1 To ds_outware.RowCount() ll_scid = ds_outware.Object.scid[ll_i] ll_outwareid = ds_outware.Object.outwareid[ll_i] ls_outwarecode = ds_outware.Object.outwarecode[ll_i] IF uo_ware.getinfo(ll_scid,ll_outwareid,ls_msg) = 0 THEN ROLLBACK; arg_msg = arg_msg + ls_outwarecode + ' 审核失败,'+ls_msg + '~r~n' ll_fail++ CONTINUE END IF IF uo_ware.auditing(True,ls_msg) = 0 THEN ROLLBACK; arg_msg = arg_msg + ls_outwarecode + ' 审核失败,'+ls_msg + '~r~n' ll_fail++ CONTINUE END IF ll_suc++ NEXT arg_cnt = ll_suc arg_failcnt = ll_fail Destroy uo_ware Destroy ds_outware RETURN 1 end function