通过K3 BOS 新单插件调用老单单据的插件代码能正确新
增工业单据
通过K3 BOS 新单插件调用老单单据的插件代码能正确新增工业单据,但如何在调用的时候往单据中符值呢?
下面是新单插件调用老单单据的插件,你可以参照此方法,在老单插件中调用。 'Call mdlCallIndustryBill.CallBills(5, 1804, 1, 1)
'////////////////////////////单据调用/////////////////////////////////////// '参数说明
' nTranType : 事务类型 ' nInterID : 单据ID
' nShowType : 查看模式 (0:新建; 1:EDIT; 2:View) ' nBillType : 单据调用模式(0:普通; 1:单据调单据) ' StateParm : 其他参数,目前主要为BOM使用 ' sNewBillType :
' nSaleMode : 内销 or 外销
Private m_BillInterface As BillEvent Public Declare Function GetCurrentProcessId _
Lib \Public UserId As Long Public Function CallBills(ByVal
nTranType As Long, _
Optional ByVal nInterID As Long = 0, _ Optional ByVal nShowType As Long = 2, _ Optional ByVal nBillType As Long = 0, _ Optional StateParm As Object, _
Optional ByVal sNewBillType As String = \ Optional ByVal nSaleMode As Long = 0) As Boolean Dim objBill As Object
Dim nBillCls As Long '事务类别 (ICTransactiontype.FType) On Error GoTo lError '得到单据事务类型的TypeID If nBillCls = 0 Then nBillCls = GetBillClsID(nTranType) If nBillCls = 0 Then
MsgBox \单据系统模板错误\ GoTo lError
End If '-----------------注意:此处参数有改动--------------------' If nBillType = 0 Then
Set objBill = CreateObject(\ Else
Set objBill = CreateObject(\ End If '-------------------------------------------------------' Dim dlg As Object
Set dlg = CreateObject(\
Dim LocalCnStr As String Dim sSubID As String Dim sSubName As String Dim lModel As Long Dim lModelDetail As Long LocalCnStr = dlg.LocalCnn Set dlg = Nothing With objBill .LocalCnn = LocalCnStr .SystemName = sSubName .SetOpt UserId, UserName If
Not .SaveVect(1).Lookup(\ .SaveVect(1)(\
End If If nInterID <> 0 Then .ListRecordset = SetBillRec(nInterID, nTranType) .ListRSFieldVect = SetBillVect
End If If Len(sNewBillType) > 0 Then .NewBillTransType = sNewBillType Else
.NewBillTransType = VBA.CStr(nTranType) End If .Show nBillCls, nShowType
' 'Add By ChenLianli 用于判断是否单据改变了 ' bBillValueChaged = .BillValueChanged