天天看點

'調用K3元件删除庫存單據

Public Function DeleteK3Bill(ByVal lTranType As Long, ByVal lInterID As Long) As Boolean

On Error GoTo Err

    DeleteK3Bill = True

    Dim obj As Object, bIsSuccess As Boolean, strMsg As String, strErrInfo As String, BaseInfo As String

    Dim m_ListID As Long, BillClsID As Long, lTemplateID As Long

    Set obj = CreateObject("K3ListServer.clsListUpdate")

    Select Case lTranType

        Case 24

            '生産領料單

            m_ListID = 11'select * from ICTransactionType

            BillClsID = 201

            lTemplateID = 77'select * from ICListTemplate

    End Select

    Dim str As Variant

    str = Split(sPropsString, "};")

    BaseInfo = Mid(str(0), 16, 1000) & "|16394|administrator"

    bIsSuccess = obj.DeleteBill("", sPropsString, m_ListID, BaseInfo, lInterID, lTranType, BillClsID, lTemplateID, strErrInfo)     If bIsSuccess Then

        'Msg "删除成功!"

    Else

        DeleteK3Bill = False

        Msg strErrInfo

    End If

    Exit Function

Err:

    DeleteK3Bill = False

    Msg Err.Description

End Function