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

📄 frmdlselectpurchasereceipt.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
                 mfrmToFormname.grdCol.TextMatrix(k, 2) = msgGrid.TextMatrix(j, 22)
                 mfrmToFormname.grdCol.TextMatrix(k, 29) = msgGrid.TextMatrix(j, 0)
                 mfrmToFormname.grdCol.TextMatrix(k, 3) = msgGrid.TextMatrix(j, 28)
                 mfrmToFormname.grdCol.TextMatrix(k, 30) = msgGrid.TextMatrix(j, 27)
                 mfrmToFormname.grdCol.TextMatrix(k, 4) = msgGrid.TextMatrix(j, 25)
                 mfrmToFormname.grdCol.TextMatrix(k, 31) = msgGrid.TextMatrix(j, 10)
                 mfrmToFormname.grdCol.TextMatrix(k, 5) = msgGrid.TextMatrix(j, n)
                 mfrmToFormname.grdCol.TextMatrix(k, 6) = msgGrid.TextMatrix(j, 12)
                 mfrmToFormname.grdCol.TextMatrix(k, 14) = msgGrid.TextMatrix(j, l)
                 mfrmToFormname.grdCol.TextMatrix(k, 8) = msgGrid.TextMatrix(j, 11)
                 mfrmToFormname.grdCol.TextMatrix(k, 11) = msgGrid.TextMatrix(j, 26)
                 mfrmToFormname.grdCol.TextMatrix(k, 32) = msgGrid.TextMatrix(j, 13)
                 mfrmToFormname.grdCol.TextMatrix(k, 21) = msgGrid.TextMatrix(j, 29)
                 mfrmToFormname.grdCol.TextMatrix(k, 33) = msgGrid.TextMatrix(j, 14)
                 mfrmToFormname.grdCol.TextMatrix(k, 22) = msgGrid.TextMatrix(j, 30)
                 mfrmToFormname.grdCol.TextMatrix(k, 23) = msgGrid.TextMatrix(j, 31)
                 mfrmToFormname.grdCol.TextMatrix(k, 24) = msgGrid.TextMatrix(j, 32)
                 mfrmToFormname.grdCol.TextMatrix(k, 25) = msgGrid.TextMatrix(j, 33)
                 mfrmToFormname.grdCol.TextMatrix(k, 26) = msgGrid.TextMatrix(j, 34)
                 mfrmToFormname.grdCol.TextMatrix(k, 27) = msgGrid.TextMatrix(j, 35)
                 mfrmToFormname.grdCol.TextMatrix(k, 34) = msgGrid.TextMatrix(j, 15)
                 mfrmToFormname.grdCol.TextMatrix(k, 35) = msgGrid.TextMatrix(j, 16)
                 mfrmToFormname.grdCol.TextMatrix(k, 36) = msgGrid.TextMatrix(j, 17)
                 mfrmToFormname.grdCol.TextMatrix(k, 37) = msgGrid.TextMatrix(j, 18)
                 mfrmToFormname.grdCol.TextMatrix(k, 38) = msgGrid.TextMatrix(j, 19)
                 mfrmToFormname.grdCol.TextMatrix(k, 39) = msgGrid.TextMatrix(j, 20)
                 mfrmToFormname.grdCol.TextMatrix(k, 40) = msgGrid.TextMatrix(j, 23)
             End If
       End If
       blnColse = IIf(Trim(msgGrid.TextMatrix(j, m)) = "√", True, False)
       slh = "Update PurchaseOrderDetail Set blnIsClose =" & blnColse & " Where lngPurchaseOrderDetailID=" & getnumber(j, 0) & ""
       gclsBase.ExecSQL slh
       j = j + 1
    Wend
    j = 1
    Do While j < mfrmToFormname.grdCol.Rows       '=0为未覆盖标志
       mfrmToFormname.CalcAmount j
       j = j + 1
    Loop
'MousePointer = vbDefault
If kkk = 1 Then
   Unload Me
End If
'Exit Sub
'Err:
'     MousePointer = vbDefault
'    ShowMsg Me.hWnd, "在向其它窗口传递数据时失败 ", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "选择采购订单"
End Sub
'关联


'重定窗体中各控件的位置、大小
Private Sub Form_Resize()
    If mblnFormNoRezise Then Exit Sub
    If Me.WindowState = 1 Then
      Exit Sub
    End If
    On Error Resume Next
    If Me.Height < intFormHeight Then Me.Height = intFormHeight
    If Me.Width < intFormWidth Then Me.Width = intFormWidth
    RedrawForm
End Sub
Private Sub RedrawForm()
    '重画MS FlexGrid 控件
    Dim leftx As Integer
    On Error Resume Next
    With msgGrid
        .Width = Me.ScaleWidth - DlListFormLeft - DlListFormRight * 2 - DlFormButtonWidth
        
        .Height = Me.ScaleHeight - DlListUpAreaHeight - DlListDownAreaHeight - DlListFormBottom
    End With
    
    '重画其余控件
    leftx = Me.ScaleLeft + Me.ScaleWidth - DlFormButtonWidth - DlListFormRight + 18
    Cmdall(4).Left = leftx
    Cmdall(7).Left = leftx
    Cmdall(1).Left = leftx
    Cmdall(2).Left = leftx
    Cmdall(3).Left = leftx
'    Cmdall(4).Left = leftx
    Cmdall(5).Left = leftx
    Cmdall(6).Left = leftx
    
    Lbbz(1).top = 120
    Cmdall(7).top = Me.ScaleTop + Lbbz(1).Height + Lbbz(1).top
    Cmdall(1).top = Cmdall(7).top + 9 + DlFormButtonHeight
    Cmdall(2).top = Cmdall(1).top + 133 + DlFormButtonHeight
    Cmdall(3).top = Cmdall(2).top + 9 + DlFormButtonHeight
    'Cmdall(4).top = Cmdall(3).top + 9 + DlFormButtonHeight
    Cmdall(5).top = Cmdall(3).top + 133 + DlFormButtonHeight
    Cmdall(6).top = Cmdall(5).top + 9 + DlFormButtonHeight
    Label1(0).top = 120
    lbdw.top = 120
    Label1(0).Left = msgGrid.Left
    lbdw.Left = msgGrid.Left + 600
    lbdw.Width = Int(msgGrid.Width / 2)
    Lbbz(0).top = 120
    Lbbz(1).Width = Int(msgGrid.Width / 7)
    Lbbz(1).Left = msgGrid.Width - Lbbz(1).Width
    Lbbz(0).Left = Lbbz(1).Left - Lbbz(0).Width + 135
    mclsGrid.TotalRowAdjust
    Me.Refresh
End Sub
'Flexgrid显示栏目设置
Private Sub setColumn()
Dim i As Integer
On Error GoTo Err
    i = 1
    strWorkID = ""
    Do While i < msgGrid.Rows
       If msgGrid.TextMatrix(i, 1) = "√" Then
          If Len(strWorkID) > 0 Then
              strWorkID = strWorkID & "," & CStr(getnumber(i, 0))
          Else
              strWorkID = CStr(getnumber(i, 0))
          End If
       End If
       i = i + 1
    Loop
    strWorkID = "( " & strWorkID & " )"
    If msgGrid.Rows > 1 Then
       If ShowMsg(Me.hwnd, "栏目设置后,你刚刚做的选择将被取消,需要先存盘吗", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_SYSTEMMODAL, "选择采购订单") = IDYES Then
          SaveData (0)
       End If
    End If
    mclsGrid.GridToListSet
    mclsGrid.ListSet.SaveList
    If mclsGrid.ListSet.ShowListSet(mclsGrid.ListSet.ViewId) Then
        GetList
        mclsGrid.SetupStyle
    End If
    isinit = True
Exit Sub
Err:
    ShowMsg Me.hwnd, "栏目设置操作不成功 ", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "选择采购订单"
End Sub

Private Sub Form_Load()
    Set mclsGrid = New NewGrid
    Set mclsGrid.Grid = msgGrid
    Set mclsGrid.Form = Me
    Set bsdate = New Base
    blnIsCancel = False
    SetHelpID Me.hwnd, 17008
    hldate = bsdate.BaseDate
    mblnFormNoRezise = False
    mclsGrid.ColOfs = intfixl
    isinit = True
    GetList
    mclsGrid.ListSetToGrid
    mclsGrid.SetupStyle
    Cmdall(7).Picture = Utility.GetFormResPicture(1001, 0)
    Cmdall(1).Picture = Utility.GetFormResPicture(1002, 0)
    Cmdall(4).Picture = Utility.GetFormResPicture(1010, 0)
    lbdw.Caption = Customernm
    Lbbz(1).Caption = Currencynm
    Set Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
    mfrmToFormname.MousePointer = vbDefault
End Sub


Private Sub Form_Unload(Cancel As Integer)
    mfrmToFormname.MousePointer = vbDefault
    If blnIsCancel = False And msgGrid.Rows > 1 Then
       If Balance.IsChange(msgGrid, 1) Then
            If ShowMsg(Me.hwnd, "确定退出选择采购订单吗", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_SYSTEMMODAL, "选择采购订单") = IDNO Then
                Cancel = True
                Exit Sub
            End If
       End If
    End If
    If msgGrid.Rows > 1 Then
       mclsGrid.GridToListSet
       mclsGrid.ListSet.SaveList
    End If
    Set mclsGrid = Nothing
    Set mfrmToFormname = Nothing
    Set mlhls = Nothing
'    Set bsdata = Nothing
    Utility.RemoveFormResPicture 1001
    Utility.RemoveFormResPicture 1002
    Utility.RemoveFormResPicture 1010
End Sub
'从Flexgrid中取出数字值
Private Function getnumber(getx As Integer, gety As Integer) As Double
    If (Len(msgGrid.TextMatrix(getx, gety)) = 0 Or IsNull(msgGrid.TextMatrix(getx, gety))) Then
        getnumber = 0
    Else
        getnumber = CDbl(msgGrid.TextMatrix(getx, gety))
    End If
End Function

'本函数用于做结算与非结算处理
Private Sub msgGrid_Click()
Dim i As Integer, k As Integer, intCount As Integer
Dim n As Integer, xx As Double, temp As Double
'On Error GoTo Err
    ytextRow = msgGrid.MouseRow
    ytextCol = msgGrid.MouseCol
     i = intfixl
     k = intfixl
     n = intfixl
    '本循环找出本次收款及本次折扣所在的列
    While (msgGrid.TextMatrix(0, i) <> "未到金额")
           i = i + 1
    Wend
    While (msgGrid.TextMatrix(0, k) <> "未到数量")
           k = k + 1
    Wend
    While (msgGrid.TextMatrix(0, n) <> "关闭")
           n = n + 1
    Wend
    
    If ytextRow > 0 And msgGrid.ColSel > 0 And msgGrid.MouseRow > 0 Then
        If (msgGrid.TextMatrix(0, 1) = "选择") And (msgGrid.MouseCol = 1) Then
           If ((msgGrid.TextMatrix(ytextRow, 1) = "") And Trim(msgGrid.TextMatrix(ytextRow, n)) <> "√") Then
           'Or (getnumber(ytextRow, k) <> getnumber(ytextRow, 4)) Or (getnumber(ytextRow, i) <> getnumber(ytextRow, 5))) And Trim(msgGrid.TextMatrix(ytextRow, n)) <> "√" Then     '打√情况
               msgGrid.TextMatrix(ytextRow, 1) = "√"
'               xx = getnumber(ytextRow, 5) - getnumber(ytextRow, i)
'               hLb(i).Caption = CStr(CDbl(IIf(Len(hLb(i).Caption) = 0, "0", hLb(i).Caption)) + xx)
'               msgGrid.TextMatrix(ytextRow, i) = msgGrid.TextMatrix(ytextRow, 5)
'               msgGrid.TextMatrix(ytextRow, k) = msgGrid.TextMatrix(ytextRow, 4)
           Else
              If Trim(msgGrid.TextMatrix(ytextRow, n)) <> "√" Then
               msgGrid.TextMatrix(ytextRow, 1) = ""       '取消打√(结算)情况
'               hlb(i).Caption = CStr(CDbl(hlb(i).Caption) - getnumber(ytextRow, i))
'               msgGrid.TextMatrix(ytextRow, k) = ""
'               msgGrid.TextMatrix(ytextRow, i) = ""
              End If
           End If
        Else
            If (msgGrid.TextMatrix(0, 1) <> "选择") Then
               ShowMsg Me.hwnd, ("请将选择栏放在第一列上!!"), MB_SYSTEMMODAL + MB_ICONEXCLAMATION, msgcaption
            End If
            If msgGrid.TextMatrix(0, ytextCol) = "关闭" Then
                If Trim(msgGrid.TextMatrix(ytextRow, ytextCol) = "√") Then
                   msgGrid.TextMatrix(ytextRow, ytextCol) = ""
                Else
                   msgGrid.TextMatrix(ytextRow, ytextCol) = "√"
                   msgGrid.TextMatrix(ytextRow, 1) = ""       '取消打√(结算)情况
'                   msgGrid.TextMatrix(ytextRow, i) = ""
'                   msgGrid.TextMatrix(ytextRow, k) = ""
'                   hlb(i).Caption = CStr(CDbl(hlb(i).Caption) - getnumber(ytextRow, i))
                End If
            End If
        End If
        Me.Refresh
    End If
'Exit Sub
'Err:
 '   ShowMsg Me.hWnd, "在进行结算操作时失败!    ", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "选择采购订单"
End Sub

Private Sub msgGrid_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    With msgGrid
        If .MouseCol = 1 Or msgGrid.TextMatrix(0, .MouseCol) = "关闭" Then
            .MousePointer = vbCustom
        Else
            .MousePointer = vbDefault
        End If
    End With
End Sub

'右键菜单
Private Sub msgGrid_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = vbRightButton And msgGrid.Rows > 1 Then
        PopupMenu Me.menuchk, , x + 118, y + 418
    End If
End Sub

Public Sub GivemeParameter(ToForm As Object, Optional dwID As Long = 0, Optional bzID As Long = 0, Optional ywID As Long = 0)
'dwID  :   单位ID
'bzID  :   币种ID
'ywID  :   业务ID
    Dim strTmp As String
'    CustomerID = dwID
'    CurrencyID = bzID
    Set mfrmToFormname = ToForm
    mfrmToFormname.MousePointer = vbHourglass
    DetailID = mfrmToFormname.getID                                                         '取业务ID号
    CustomerID = C2Lng(mfrmToFormname.lblHead(0).Tag)                                       '取单位ID号
    DispartString mfrmToFormname.lblHead(1).Caption, Currencynm, Customernm                 '取单位名称
    CurrencyID = mfrmToFormname.GetFID(7)                                                   '取币种ID
    Currencynm = mfrmToFormname.lblField(7).Caption                                         '取币种名称
    DispartString Currencynm, strTmp, Currencynm                                          '取币种名称
    blnIsPurchase = IIf(C2Lng(mfrmToFormname.lblHead(2).Tag) = 4, True, False)             '判断窗体单据是否为受托入库单据
    If CustomerID < 1 Then
       mfrmToFormname.MousePointer = vbDefault
       ShowMsg mfrmToFormname.hwnd, "请先输入单位!", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "选择订单"
       Exit Sub
    End If
    If CurrencyID < 1 Then
       mfrmToFormname.MousePointer = vbDefault
       ShowMsg mfrmToFormname.hwnd, "请先输入币种!", MB_SYSTEMMODAL + MB_ICONEXCLAMATION, "选择订单"
       Exit Sub
    End If
    isinit = True
    Me.Show 1
End Sub



⌨️ 快捷键说明

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