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

📄 frmitemtax.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
        If txtItemTax(i) = 0 Then
           lstTxtItemTax(i - 1).Enabled = False
           lstTxtItemTax(i - 1).TabStop = False
           lstTxtItemTax(i - 1).BackColor = &H80000004
           lblItemTax(i + 2).Enabled = False
        End If
    Next
    mblnChangeIsFirst = False
End Function

Private Sub chkStop_Click()
    mblnIsChanged = True
End Sub

Private Sub chkStop_LostFocus()
    If chkStop.Value = 0 Then
        mblnIsInActive = False
    Else
        mblnIsInActive = True
    End If
    mblnIsChanged = True
End Sub

Private Sub cmdItemTax_Click(Index As Integer)
    Dim i As Integer
    Dim strSql As String
    Dim recTax As rdoResultset
    Dim intMsg As Integer
    
    If mblnIsExist Then Exit Sub
    Select Case Index
    Case 0
        If Caption = "修改商品税率" Then
            If Not EditRecord Then
               Exit Sub
            Else
               Unload Me
               Exit Sub
            End If
        Else
            If Not AddRecord Then
               Exit Sub
            Else
'                strSql = "select * from tax order by lngTaxID"
'                Set recTax = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
'                If recTax.RowCount > 0 Then
'                   recTax.MoveLast
'                   ID = recTax!lngTaxID
'                Else
'                   ID = 0
'                End If
            End If
        End If
        Unload Me
    Case 1
        mblnIsChanged = False
        Unload Me
    Case 2
        If Not AddRecord Then
           Exit Sub
        End If
        mlngTaxID = 0
        InitCard
    End Select
End Sub

Private Sub cmdItemTax_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
    If Index = 1 Then mblnIsCancel = True
End Sub

Private Sub Form_Activate()
    SetHelpID Me.HelpContextID
    txtItemTax(0).SelStart = 0
    'txtItemTax(0).SelLength = strLen(Trim(txtItemTax(0).Text))
    'txtItemTax(0).SetFocus
    frmMain.mnuEditShowList.Enabled = True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    mblnIsRefer = False
    If KeyCode = vbKeyEscape Or KeyCode = vbKeyReturn Then
        If lstTxtItemTax(0).ReferVisible Then mblnIsRefer = True
        If lstTxtItemTax(1).ReferVisible Then mblnIsRefer = True
    End If
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    If mblnIsList Then
        mblnIsList = False
        Exit Sub
    End If
    If KeyAscii = vbKeyReturn Then
        If Not mblnIsRefer Then
            BKKEY Me.ActiveControl.hwnd, vbKeyTab
        End If
    ElseIf KeyAscii = vbKeyEscape Then
        cmdItemTax(1).Value = Not mblnIsRefer
    End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn And Shift = 2 Then
        cmdItemTax(0).Value = True
    End If
End Sub

Private Sub Form_Load()
    On Error GoTo ErrHandle
'    SetHelpID Me.hwnd, 30034
    mblnIsChanged = False
    station(0) = None
    station(1) = None
    Utility.LoadFormResPicture Me
'    SendKeys "%{N}"
   ' Set mclsMainControl = gclsSys.MainControls.Add(Me)
   ' frmTaxPersonList.IsShowCard(0) = True
   Exit Sub
    Dim edtErrReturn As ErrDealType
ErrHandle:
    edtErrReturn = Errors.ErrorsDeal
    
    If edtErrReturn = edtResume Then
         Resume
    Else
         On Error Resume Next
         Unload Me
    End If
End Sub

Private Sub Form_Paint()
  FrameBox Me.hwnd, 150, 150, 5150, 2340
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        Dim intResponse As Integer
        If UnloadMode = vbFormControlMenu Then
           If mblnIsChanged Then
              intResponse = ShowMsg(0, "当前商品税率已被修改,是否保存?", _
                            vbYesNoCancel + vbQuestion + MB_TASKMODAL, Caption)
              If intResponse = vbYes Then
                 If getID > 0 Then
                    Cancel = Not EditRecord()
                 Else
                    Cancel = Not AddRecord()
                 End If
              ElseIf intResponse = vbCancel Then
                 Cancel = True
              End If
           End If
        End If
        If Not Cancel Then mblnIsChanged = False
    End Sub

Private Sub Form_Unload(Cancel As Integer)
  
    On Error Resume Next
    Utility.UnLoadFormResPicture Me
    mblnIsCancel = False
End Sub

Private Sub lstTxtItemTax_AddNew(Index As Integer)
    Dim intID As Long
    
    mblnIsEditAdd = True
    intID = Card.AddCard(Message.msgAccount)
    Select Case Index
           Case 0
                settlistbox lstTxtItemTax(0), 0
                settlistbox lstTxtItemTax(1), 1
           Case 1
               settlistbox lstTxtItemTax(1), 1
               settlistbox lstTxtItemTax(0), 0
    End Select
    lstTxtItemTax(Index).SeekId intID
    station(Index) = Add
End Sub

Private Sub lstTxtItemTax_Choose(Index As Integer)
    Dim intID As Long
    Dim blnIsDel As Boolean

    If mblnChangeIsFirst = True Then Exit Sub
    If Index = 0 Then
       mlngPurchaseTaxAccountID = lstTxtItemTax(Index).ID
    Else
       mlngSaleTaxAccountID = lstTxtItemTax(Index).ID
    End If
    
End Sub


'设置列表框选项
Public Sub settlistbox(lstSetting As ListText, Index As Integer)
    Dim strSql As String
    
    Select Case Index
           Case 0
                setlistbox lstSetting, 0, mlngPurchaseTaxAccountID
           Case 1
                setlistbox lstSetting, 0, mlngSaleTaxAccountID
    End Select
    
End Sub

Private Sub lstTxtItemTax_Delete(Index As Integer)
        Dim blnIsDel As Boolean
        
        mblnIsEditAdd = True
        Select Case Index
               Case 0
                    If mlngPurchaseTaxAccountID = 0 Then
                       ShowMsg 0, "编码不存在", vbExclamation + MB_TASKMODAL, Me.Caption
                       lstTxtItemTax(0).SetFocus
                       Exit Sub
                    End If
                    
                    blnIsDel = Card.DelCard(Message.msgAccount, mlngPurchaseTaxAccountID, frmItemTax.hwnd)
                    If blnIsDel = True Then
                       mlngPurchaseTaxAccountID = -1
                       settlistbox lstTxtItemTax(Index), Index
                       settlistbox lstTxtItemTax(1), 1
                       lstTxtItemTax(Index).Text = ""
                       lstTxtItemTax(Index).SetFocus
                    Else
                       lstTxtItemTax(Index).SeekId mlngPurchaseTaxAccountID
                    End If
               Case 1
                    If mlngSaleTaxAccountID = 0 Then
                       ShowMsg 0, "编码不存在", vbExclamation + MB_TASKMODAL, Me.Caption
                       lstTxtItemTax(1).SetFocus
                       Exit Sub
                    End If
                    blnIsDel = Card.DelCard(Message.msgAccount, mlngSaleTaxAccountID, frmItemTax.hwnd)
                    If blnIsDel = True Then
                       mlngSaleTaxAccountID = -1
                       settlistbox lstTxtItemTax(Index), Index
                       settlistbox lstTxtItemTax(0), 0
                       lstTxtItemTax(Index).Text = ""
                       lstTxtItemTax(Index).SetFocus
                    Else
                       lstTxtItemTax(Index).SeekId mlngSaleTaxAccountID
                    End If
        End Select
End Sub

Private Sub lstTxtItemTax_Edit(Index As Integer)
        mblnIsEditAdd = True
        If Index = 0 Then
            If mlngPurchaseTaxAccountID = 0 Then
                ShowMsg 0, "编码不存在", vbExclamation + MB_TASKMODAL, Me.Caption
                lstTxtItemTax(0).SetFocus
                Exit Sub
            End If
            Card.EditCard Message.msgAccount, mlngPurchaseTaxAccountID
            settlistbox lstTxtItemTax(Index), Index
            settlistbox lstTxtItemTax(1), 1
            lstTxtItemTax(Index).SeekId mlngPurchaseTaxAccountID
        End If
        If Index = 1 Then
            If mlngSaleTaxAccountID = 0 Then
                ShowMsg 0, "编码不存在", vbExclamation + MB_TASKMODAL, Me.Caption
                lstTxtItemTax(1).SetFocus
                Exit Sub
            End If
            Card.EditCard Message.msgAccount, mlngSaleTaxAccountID
            settlistbox lstTxtItemTax(Index), Index
            settlistbox lstTxtItemTax(0), 0
            lstTxtItemTax(Index).SeekId mlngSaleTaxAccountID
        End If
        station(Index) = Edit
End Sub

Private Sub lstTxtItemTax_GotFocus(Index As Integer)
   If txtItemTax(2).Text = "0" Or Trim(txtItemTax(2).Text) = "" Then
      lstTxtItemTax(1).TabStop = False
   Else
      lstTxtItemTax(1).TabStop = True
   End If
'   If Me.Caption = "修改商品税率" Then
'      cmdItemTax(0).Default = False
'   Else
'      cmdItemTax(0).Default = False
'      cmdItemTax(2).Default = False
'   End If
   If mblnChangeIsFirst = True Then Exit Sub
   If lstTxtItemTax(Index).Referrows <= 1 Then
       settlistbox lstTxtItemTax(Index), Index
   End If
End Sub

Private Sub lstTxtItemTax_ItemNotExist(Index As Integer)
    Dim intMsgReturn As Integer
    Dim intID As Long
    
    If mblnIsCancel = True Then Exit Sub
    mblnIsExist = True
    Select Case Index
    Case 0
        '调窗体
        intMsgReturn = frmMsgAdd.MsgAddShow(Caption, "进项税科目中没有" & lstTxtItemTax(0).Text)
    Case 1
        intMsgReturn = frmMsgAdd.MsgAddShow(Caption, "销项税科目中没有" & lstTxtItemTax(1).Text)
    End Select
    If intMsgReturn = vbOK Then
        intID = Card.AddCard(Message.msgAccount, lstTxtItemTax(Index).Text)
        Select Case Index
           Case 0
                settlistbox lstTxtItemTax(0), 0
                settlistbox lstTxtItemTax(1), 1
           Case 1
               settlistbox lstTxtItemTax(1), 1
               settlistbox lstTxtItemTax(0), 0
        End Select
        lstTxtItemTax(Index).SeekId intID
        station(Index) = Add
    Else
        lstTxtItemTax(Index).SelStart = 0
        lstTxtItemTax(Index).SelLength = Len(lstTxtItemTax(Index).Text)
        lstTxtItemTax(Index).SetFocus
    End If
    mblnIsExist = False
End Sub

Private Sub lstTxtItemTax_KeyPress(Index As Integer, KeyAscii As Integer)
    mblnIsChanged = True
End Sub

Private Sub lstTxtItemTax_LostFocus(Index As Integer)
    Dim lngID As Long
    Dim strSql As String
    Dim recAccount As rdoResultset
    
    
    If mblnIsEditAdd = False Then
'       lngID = lstTxtItemTax(Index).ID  'TextMatrix(lstMethod(index).ReferRow, 1)
'       If lngID > 0 Then
'          strsql = "select * from Account where lngAccountID=" & lngID & " and blnIsDetail=true"
'          Set recAccount = gclsBase.BaseDB.openresultset(strsql, rdopenstatic)
'          If recAccount.EOF Then
'             ShowMsg 0, "“" & lstTxtItemTax(Index).Text & "“会计科目不是末级科目,请重新选择会计科目!", _
'                      vbExclamation + MB_TASKMODAL, Me.Caption
'             lstTxtItemTax(Index).SelStart = 0
'             lstTxtItemTax(Index).SelLength = strLen(lstTxtItemTax(0).Text)
'             lstTxtItemTax(Index).SetFocus
'             Exit Sub
'          End If
'          recAccount.Close
'
'          strsql = "select * from Account where lngAccountID=" & lngID & " and blnIsQuantity=true"
'          Set recAccount = gclsBase.BaseDB.openresultset(strsql, rdopenstatic)
'          If Not recAccount.EOF Then
'             ShowMsg 0, "税种税率中的进,销项税科目不能有数量核算属性,请重新选择会计科目!", _
'                      vbExclamation + MB_TASKMODAL, Me.Caption
'             lstTxtItemTax(Index).SelStart = 0
'             lstTxtItemTax(Index).SelLength = strLen(lstTxtItemTax(0).Text)
'             lstTxtItemTax(Index).SetFocus
'             Exit Sub
'          End If
'          recAccount.Close
'
'       End If
    End If
    mblnIsEditAdd = False
'    If Me.Caption = "修改商品税率" Then
'       cmdItemTax(0).Default = True
'       cmdItemTax(2).Default = False
'    Else
'       cmdItemTax(0).Default = False
'       cmdItemTax(2).Default = True
'    End If

⌨️ 快捷键说明

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