–以下代码为更新任务回报单的工时功能,以下插件代码:
Public Sub MainFunction(ByVal sKey As String, oList As Object, ByRef bCancel As Boolean)
Dim sqlCode As String
Dim FInterID As Long
Dim FEntryID As Long
Set OBJ = CreateObject("K3Connection.AppConnection") '老单据数据库处理过程
If sKey = "HMPrint" Then
oList.MultiSelect = 2
'获取选择单据的单据内码及行号
Dim selInterID As KFO.Vector
Dim selEntryID As KFO.Vector
Set selInterID = oList.GetSelData("FInterID")
Set selEntryID = oList.GetSelData("FEntryID")
If selInterID.UBound > 0 Then
Dim hrwt As String
Dim hrWTime As Double
hrwt = InputBox("请输工时数值", "请输工时数值", "0")
If IsNumeric(hrwt) Then
hrWTime = Round(CDbl(hrwt), 2)
For i = selInterID.LBound To selInterID.UBound
FInterID = selInterID(i).GetValue("FInterID")
FEntryID = selEntryID(i).GetValue("FEntryID")
sqlCode = "UPDATE ICMORptEntry SET FTimeHrWork=" &am