金蝶K3工业老单中间层开发示例
来源:互联网 发布:淘宝买家秀福利 网站 编辑:程序博客网 时间:2024/04/29 19:20
Dim rsBill As ADODB.Recordset
Dim lBillInterID As Long '当前单据内码
Dim lRtnBillInterID As Long
Dim strRtnMsg As String
Dim lCheckID As Long
Dim StrSql As String
Dim strsql2 As String
Dim strsql3 As String
Dim sCurrZhangTaoTag As String
Dim sCurrSupply As String
Dim bIsOKTransBill As Boolean
Dim cn As ADODB.Connection
'定义插件对象接口. 必须具有的声明, 以此来获得事件
'注意: 此方法必须存在, 请勿修改
On Error GoTo doerr
If dctParams.Value("TranType") <> 71 And dctParams.Value("TranType") <> 81 Then
HookInvoke = 1
Exit Function
End If
sDsn = dctParams.Value("sDsn")
InitDataEnv sDsn
Set cn = datasource.Connection
sOtherZhangTaoDsn = GetOtherZhangTaoDsn()
lBillInterID = dctParams.Value("InterID")
Select Case EventID
Case 200001 '操作前
lBillInterID = dctParams.Value("InterID")
If CheckIsExist(lBillInterID, dctParams.Value("TranType"), sOtherZhangTaoDsn) Then
HookInvoke = -1
GoTo ReAprov
End If
Case 200003 '审核退出前事件
GetObjectContext.SetAbort
lCheckID = dctParams.Value("OperateCode")
If lCheckID = 1 Then '审核
sCurrZhangTaoTag = GetCurrZhangTaoTag()
If dctParams.Value("TranType") = POBill_FID And sCurrZhangTaoTag = "S" Then
sCurrSupply = GetCurrBillSupplyName(lBillInterID)
If sCurrSupply = DG_WATSON Then
bIsOKTransBill = TransSingaporePOToDongguanSO(lBillInterID)
If Not bIsOKTransBill Then
HookInvoke = -1
Exit Function
End If
End If
End If
End If
If lCheckID = 2 Then '反审核
lBillInterID = dctParams.Value("InterID")
If CheckIsExist(lBillInterID, dctParams.Value("TranType"), sOtherZhangTaoDsn) Then
HookInvoke = -1
GoTo ReAprov
End If
End If
Case Else
End Select
GetObjectContext.SetComplete
HookInvoke = 1
Exit Function
doerr:
err.Raise -1, , "中间层调用失败,原因可能是:" & err.Description, "金蝶提示"
HookInvoke = -1
Exit Function
ReAprov:
err.Raise -1, , "反审核失败,该单据已经传递,不能进行反审核", "金蝶提示"
HookInvoke = -1
Exit Function
End Function
Dim lBillInterID As Long '当前单据内码
Dim lRtnBillInterID As Long
Dim strRtnMsg As String
Dim lCheckID As Long
Dim StrSql As String
Dim strsql2 As String
Dim strsql3 As String
Dim sCurrZhangTaoTag As String
Dim sCurrSupply As String
Dim bIsOKTransBill As Boolean
Dim cn As ADODB.Connection
'定义插件对象接口. 必须具有的声明, 以此来获得事件
'注意: 此方法必须存在, 请勿修改
On Error GoTo doerr
If dctParams.Value("TranType") <> 71 And dctParams.Value("TranType") <> 81 Then
HookInvoke = 1
Exit Function
End If
sDsn = dctParams.Value("sDsn")
InitDataEnv sDsn
Set cn = datasource.Connection
sOtherZhangTaoDsn = GetOtherZhangTaoDsn()
lBillInterID = dctParams.Value("InterID")
Select Case EventID
Case 200001 '操作前
lBillInterID = dctParams.Value("InterID")
If CheckIsExist(lBillInterID, dctParams.Value("TranType"), sOtherZhangTaoDsn) Then
HookInvoke = -1
GoTo ReAprov
End If
Case 200003 '审核退出前事件
GetObjectContext.SetAbort
lCheckID = dctParams.Value("OperateCode")
If lCheckID = 1 Then '审核
sCurrZhangTaoTag = GetCurrZhangTaoTag()
If dctParams.Value("TranType") = POBill_FID And sCurrZhangTaoTag = "S" Then
sCurrSupply = GetCurrBillSupplyName(lBillInterID)
If sCurrSupply = DG_WATSON Then
bIsOKTransBill = TransSingaporePOToDongguanSO(lBillInterID)
If Not bIsOKTransBill Then
HookInvoke = -1
Exit Function
End If
End If
End If
End If
If lCheckID = 2 Then '反审核
lBillInterID = dctParams.Value("InterID")
If CheckIsExist(lBillInterID, dctParams.Value("TranType"), sOtherZhangTaoDsn) Then
HookInvoke = -1
GoTo ReAprov
End If
End If
Case Else
End Select
GetObjectContext.SetComplete
HookInvoke = 1
Exit Function
doerr:
err.Raise -1, , "中间层调用失败,原因可能是:" & err.Description, "金蝶提示"
HookInvoke = -1
Exit Function
ReAprov:
err.Raise -1, , "反审核失败,该单据已经传递,不能进行反审核", "金蝶提示"
HookInvoke = -1
Exit Function
End Function
0 0
- 金蝶K3工业老单中间层开发示例
- 金蝶K3工业老单中间层开发示例-2
- K3工业老单单据的相关表
- K3工业老单单据的相关表
- 金蝶K3系统中间层群集部署方案
- 金蝶K3工业单据二次开发指导汇总
- 金蝶 k3 HR客户端平台提示:中间层服务器不可用
- 金蝶 k3 打开帐套时提示 中间层配置有误
- 金蝶 k3 打开帐套时提示 中间层配置有误 .
- 金蝶K3打包业务单据(老单),部署到别账套出错处理方法!
- 金蝶老单中间层开发的一个示例
- 金蝶K3数据库查询示例
- K3老单自定义字段自动折行显示
- 金蝶K3其他应收单
- 金蝶K3付款单代码
- 金蝶K3 ERP二次开发,定制开发
- K3系统常用数据表结构(工业版)
- 安装Kingdee K3中间层服务器时的一个补丁KB936296
- matlab目录操作
- Paxos在大型系统中常见的应用场景
- 测试过程中的问题定位与分析
- JavaScript概述
- 部署失败:本地 SharePoint 服务器不可用解决
- 金蝶K3工业老单中间层开发示例
- 哈夫曼树
- “浪潮杯”第五届ACM大学生程序设计竞赛
- sharepoint WSP安装包安装、删除、更新
- Local and Push Notification Programming Guide
- .Net、Java、为我作证,随机数是骗人的
- Linux网路编程系列-网络I/O模型
- 【JAVA学习】JAVA中int、String的类型转换
- Sicily 1732 Alice and Bob (二进制数的最大公约数)