⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bos_voutype_plugins.cls

📁 完成报销系统的业务流程;在报销系统中达到预算控制目的;将历史数据导入金蝶账套生成历史备查数据。
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "BOS_VouType_PlugIns"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "This is BillEvent Interface Class, made by K3BOSPLUGINSWIZAED"
Option Explicit

 
'定义 BillEvent 接口. 必须具有的声明, 以此来获得事件
Private WithEvents m_BillInterface  As BillEvent
Attribute m_BillInterface.VB_VarHelpID = -1
 
Public Sub Show(ByVal oBillInterface As Object)
 
    'BillEvent 接口实现
    '注意: 此方法必须存在, 请勿修改
    Set m_BillInterface = oBillInterface


End Sub

Private Sub Class_Terminate()
 
    '释放接口对象
    '注意: 此方法必须存在, 请勿修改
    Set m_BillInterface = Nothing

End Sub

Private Sub m_BillInterface_AfterLoadBill()
        '-------------------------------------------------------------------
        '在模板类型为“借款申请单模板”时,隐藏 字段“报销项目”,“部门”,“部门名称”,“类型”
        '-------------------------------------------------------------------
   With m_BillInterface
            If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申请单模板" Then
                .ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FDepID", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FVouType", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), True
                

            
            Else
                .ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False

            End If
    End With
End Sub
'************************************************************
'新增单据后,
'1给单据体的显示状态付值
'2自动给代码付值'
'************************************************************
Private Sub m_BillInterface_AfterNewBill()
    Dim sSql As String
    Dim rs As New ADODB.Recordset
    With m_BillInterface
        .ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
        .ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
        .ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
        .ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
        .ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False
        
        sSql = "select max(cast(FNumber as decimal)) as maxNum from t_EP_ER_VouType"
        Set rs = .K3Lib.GetData(sSql)
        If rs.State = adStateOpen And rs.RecordCount > 0 Then
            .SetFieldValue "FNumber", CStr(CNulls(rs("maxNum"), 0)) + 1
        End If
    End With
    
    Set rs = Nothing
End Sub

Private Sub m_BillInterface_BeforeSave(bCancel As Boolean)
    '-------------------------------------------------------------------
    '保存数据
    '在模板类型为“借款申请单模板”时, “借款方式”不为空
    '在模板类型为“借款申请单模板”时, “报销项目”,“部门”,“部门名称”,“类型”不为空
    '-------------------------------------------------------------------
    With m_BillInterface
        If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申请单模板" Then
            If .GetFieldValue("FLoanType") = "" Then
                MsgBox "请检查“借款方式”是否为空!", vbOKOnly + vbInformation, HINTINFO
                bCancel = True
            End If
            
        Else
            If .GetFieldValue("FWipeItem") = "" Or .GetFieldValue("FDepID") = "" Or _
                    .GetFieldValue("FBaseProperty") = "" Or .GetFieldValue("FVouType") = "" Then
                MsgBox "请检查“报销项目”,“部门”,“部门名称”,“报销类型”是否为空", vbOKOnly + vbInformation, HINTINFO
                bCancel = True
            End If
        End If
    End With
End Sub

Private Sub m_BillInterface_Change(ByVal dct As KFO.IDictionary, ByVal dctFld As KFO.IDictionary, ByVal Col As Long, ByVal Row As Long, Cancel As Boolean)
    Dim FAmt
    Dim FMaxAmt
    With m_BillInterface
        '-------------------------------------------------------------------
        '在模板类型为“借款申请单模板”时,隐藏 字段“报销项目”,“部门”,“部门名称”,“类型”
        '-------------------------------------------------------------------
        If dct("FFieldName") = "FVouTempletType" Then
            If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申请单模板" Then

                .ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FDepID", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FVouType", "", 0), False
                .ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), True
                If .GetFieldValue("FWipeitem") <> "" Or .GetFieldValue("FWipeitem") <> "" Or _
                    .GetFieldValue("FWipeitem") <> "" Or .GetFieldValue("FWipeitem") <> "" Then
                    Cancel = True
                    MsgBox "“报销项目”,“部门”,“部门名称”,“报销类型”不能有值!", vbInformation + vbOKOnly, HINTINFO
                    .SetFieldValue ("FVouTempletType"), 2
                    m_BillInterface_Change dct, dctFld, Col, Row, Cancel
                End If
            
            Else
                .SetFieldValue "FLoanType", ""
                
                .ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
                .ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False
                If .GetFieldValue("FLoanType") <> "" Then
                     MsgBox "“借款方式”不能有值!", vbInformation + vbOKOnly, HINTINFO
                    .SetFieldValue ("FVouTempletType"), 1
                    m_BillInterface_Change dct, dctFld, Col, Row, Cancel
                End If
            End If
        End If
      
        
    End With
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -