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

📄 frmprintreceipt.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
Private Const lngSaleDataBookViewID = 1245

Dim blnReprintRight As Boolean
Dim blnR_P As Boolean
Dim blnUnRefreshData As Boolean
Dim mlngListID As Long
Dim blnIsSaleDataBook As Boolean    '是否是销货清单标志

'有关方法ShowfrmPrintReceipt的参数lngReceiptListID说明
'商品采购 :   1(2)
'直运采购 :   2(3)
'受托入库 :   3(4)
'受托结算 :   4(5)
'加工入库 :   5(6)
'加工费用 :   6(7)
'采购发票 :   7(8,(2,3,4,5,6,7,9,10,11 : *开票标志为真时,为发票))
'自制入库 :   8(9)
'盘赢入库 :   9(10)
'其它入库 :   10(11)
'
'商品销售 :   11(13)
'直运销售 :   12(14)
'委托出库 :   13(15)
'委托结算 :   14(16)
'加工出库 :   15(17)
'分期出库 :   16(18)
'分期结算 :   17(19)
'销售发票 :   18(20,(13,14,15,16,17,18,19,21,22,23,24: *开票标志为真时,为发票)
'领用出库 :   19(21)
'成本调整 :   20(22)
'盘亏出库 :   21(23)
'其它出库 :   22(24)
'
'采购订单 :   23(1)
'销售订单 :   24(12)
'应收单   :   25(36,37,38)
'应付单   :   26(34,35)
'收款单   :   27(40)
'付款单   :   28(39)
'记帐凭证 :   29(41,54,55)
'调拨单   :       30(28)
'调价单   :       31(29)
'拆卸组装单:  32(30,31)
'商品盘点表:  33(33)
'入库成本表:  34(32)
'委托调拨  :  35(26)
'固资变动  :  36(48,49,50)
'固资卡片  :  37(51)
'固资期初  :  38(53)
'库存期初  :  39(42)
'受托期初  :  40(43)
'委托期初  :  41(44)
'分期期初  :  42(45)
'直运期初  :  43(46)
'加工期初  :  44(47)
'采购期初  :  45(52)

'销售收款   : 56
'采购付款   : 57
'销货清单   : 58

'
'方法及函数
'

'产生付款方式列表记录集
Public Sub ShowfrmPrintReceipt(Optional intReceiptListType As Integer)
  mintReceiptListType = intReceiptListType
  blnIsSaleDataBook = False
  
  If mintReceiptListType = 58 Then
    mlngListID = GetListID
    blnIsSaleDataBook = True
  End If

  Me.Hide
  RefreshData1
  Utility.LoadFormResPicture Me
  Me.Show vbModal
End Sub
'*************************************************************************
'以下函数暂时取消暂时
'Private Function GetFilterList(ByVal lngReceiptID As Long, ByVal strTableName As String, _
'  Optional ByVal BeginDate As String = "", Optional ByVal EndDate As String = "") As rdoResultset
'
'    Dim recRecordset As rdoResultset
'    Dim strSelectOfSql As String
'    Dim strFromOfSql As String
'    Dim strWhereOfSql As String
'    Dim strSql As String
'
'    If BeginDate = "" Then BeginDate = "1899-01-01"
'    If EndDate = "" Then EndDate = "9999-12-31"
'    strSelectOfSql = mclsGrid.ListSet.GetSelect
'    strFromOfSql = mclsGrid.ListSet.FromOfSql
'    strWhereOfSql = mclsGrid.ListSet.WhereOfSql
'
'
'    If strTableName = "Activity" Then
'        strSelectOfSql = "select Activity.lngActivityID as id," & strSelectOfSql
'        If strWhereOfSql <> "" Then
'           strWhereOfSql = "WHERE Activity.lngReceiptTypeID=" & lngReceiptID & _
'                          " and format(Activity.strDate,'yyyy-mm-dd')>='" & BeginDate & _
'                          "' and format(Activity.strDate,'yyyy-mm-dd')<='" & EndDate & _
'                          "' and " & strWhereOfSql
'        Else
'           strWhereOfSql = "WHERE Activity.lngReceiptTypeID=" & lngReceiptID & _
'                         " and format(Activity.strDate,'yyyy-mm-dd')>='" & BeginDate & _
'                         "' and format(Activity.strDate,'yyyy-mm-dd')<='" & EndDate & "'"
'        End If
'    Else
'        strSelectOfSql = "select ItemActivity.lngActivityID as id," & strSelectOfSql
'        If strWhereOfSql <> "" Then
'           strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID=" & lngReceiptID & _
'                           " and format(ItemActivity.strDate,'yyyy-mm-dd')>='" & BeginDate & _
'                           "' and format(ItemActivity.strDate,'yyyy-mm-dd')<='" & EndDate & _
'                           "' and " & strWhereOfSql
'        Else
'           strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID=" & lngReceiptID & _
'                  " and format(ItemActivity.strDate,'yyyy-mm-dd')>='" & BeginDate & _
'                  "' and format(ItemActivity.strDate,'yyyy-mm-dd')<='" & EndDate & "'"
'        End If
'    End If
'
'    strSql = strSelectOfSql & " " & strFromOfSql & " " & strWhereOfSql
'    Set recRecordset = gclsBase.BaseDB.OpenResultset(strSql, dbOpenSnapshot)
'
'    '列表是否为空
'    If recRecordset.RowCount = 0 Then
'        msgPrintReceipt.HighLight = flexHighlightNever
'    Else
'        msgPrintReceipt.HighLight = flexHighlightAlways
'    End If
'    Set GetFilterList = recRecordset
'End Function
Private Function GetFilterList1(ByVal intReceiptListType As Integer, ByVal strTableName As String, _
  Optional ByVal BeginDate As String = "", Optional ByVal EndDate As String = "") As rdoResultset
    
    Dim recRecordset As rdoResultset
    Dim strSelectOfSql As String
    Dim strFromOfSql As String
    Dim strWhereOfSql As String
    Dim strSql As String
    Dim strReceiptType As String  '单据类型条件字符串
    
    If BeginDate = "" Then BeginDate = "1899-01-01"
    If EndDate = "" Then EndDate = "9999-12-31"
    strSelectOfSql = mclsGrid.ListSet.GetSelect
    strFromOfSql = mclsGrid.ListSet.FromOfSql
    If intReceiptListType = 58 Then     '如果是“销货清单”
        strWhereOfSql = mclsGrid.ListSet.WhereOfSql 'Filter.GetInitWhere(mlngListID, 1)
    Else
        strWhereOfSql = mclsGrid.ListSet.WhereOfSql
    End If
    
    '先确定是否有此项目权限
    If mintReceiptListType = 27 Or mintReceiptListType = 56 Then
        If blnR_P Then
            blnReprintRight = IsCanRePrint(GetReceiptTypeName(56))
        Else
            blnReprintRight = IsCanRePrint(GetReceiptTypeName(27))
        End If
    ElseIf mintReceiptListType = 28 Or mintReceiptListType = 57 Then
        If blnR_P Then
            blnReprintRight = IsCanRePrint(GetReceiptTypeName(57))
        Else
            blnReprintRight = IsCanRePrint(GetReceiptTypeName(28))
        End If
    Else
        blnReprintRight = IsCanRePrint(GetReceiptTypeName(mintReceiptListType))
    End If
    
    If blnReprintRight = False Then
        Select Case UCase(strTableName)
        Case UCase("Activity"), UCase("ItemActivity"), UCase("PurchaseOrder"), UCase("SaleOrder"), _
            UCase("Voucher"), UCase("CostPrice"), UCase("StockTaking")
            If Trim(strWhereOfSql) <> "" Then
                strWhereOfSql = strWhereOfSql & " AND blnIsPrinted=0 "
            Else
                strWhereOfSql = " blnIsPrinted=0 "
            End If
        End Select
    End If
    
    strReceiptType = GetReceiptTypeSQL(intReceiptListType) '获得相应的单据类型查询子句
    
    If strTableName = "Activity" Then
        strSelectOfSql = "select Activity.lngActivityID as id," & strSelectOfSql
        If strWhereOfSql <> "" Then
           strWhereOfSql = "WHERE Activity.lngReceiptTypeID " & strReceiptType & _
                          " and TO_DATE(Activity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd') " & _
                          " and TO_DATE(Activity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd') " & _
                          " AND blnIsSpecial = " & IIf(blnR_P, 1, 0) & " AND " & strWhereOfSql
        Else
           strWhereOfSql = "WHERE Activity.lngReceiptTypeID " & strReceiptType & _
                         " and TO_DATE(Activity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd') " & _
                         " and TO_DATE(Activity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd') " & _
                         " AND blnIsSpecial = " & IIf(blnR_P, 1, 0)
        End If
    Else
      Select Case intReceiptListType
         Case 32  '拆卸组装单  (指定业务类型ID(入库))
            strSelectOfSql = "select ItemActivity.lngActivityID as id," & strSelectOfSql
            If strWhereOfSql <> "" Then
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" & _
                               " and ItemActivity.lngActivityTypeID IN(30,32) and " & strWhereOfSql
            Else
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
                      & " and ItemActivity.lngActivityTypeID IN(30,32)"
            End If
         Case 35  '代销调拨单 (指定业务类型ID(出库))
            strSelectOfSql = "select ItemActivity.lngActivityID as id," & strSelectOfSql
            If strWhereOfSql <> "" Then
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" & _
                               " and ItemActivity.lngActivityTypeID IN(25) and " & strWhereOfSql
            Else
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
                      & " and ItemActivity.lngActivityTypeID IN(25)"
            End If
         Case 30  '商品调拨单 (指定业务类型ID(出库))
            strSelectOfSql = "select ItemActivity.lngActivityID as id," & strSelectOfSql
            If strWhereOfSql <> "" Then
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" & _
                               " and ItemActivity.lngActivityTypeID IN(28) and " & strWhereOfSql
            Else
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
                      & " and ItemActivity.lngActivityTypeID IN(28)"
            End If
         Case 58    '销货清单对话框
            strSelectOfSql = "SELECT ItemActivity.lngActivityID AS lngID," & strSelectOfSql
            If strWhereOfSql <> "" Then
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType _
                                & "  AND TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>= TO_DATE('" & BeginDate _
                                & "','YYYY-MM-DD') AND TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<= TO_DATE('" & EndDate _
                                & "','YYYY-MM-DD') AND " & strWhereOfSql
            Else
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType _
                                & "  AND TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>= TO_DATE('" & BeginDate _
                                & "','YYYY-MM-DD') AND TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<= TO_DATE('" & EndDate & "','YYYY-MM-DD')"
            End If
            
         Case Else
            strSelectOfSql = "select ItemActivity.lngActivityID as id," & strSelectOfSql
            If strWhereOfSql <> "" Then
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                               " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" & _
                               " and " & strWhereOfSql
            Else
               strWhereOfSql = "WHERE ItemActivity.lngReceiptTypeID " & strReceiptType & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" & _
                      " and TO_DATE(ItemActivity.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')"
            End If
      End Select
    End If
    
    strSql = strSelectOfSql & " " & strFromOfSql & " " & strWhereOfSql
    Set recRecordset = gclsBase.BaseDB.OpenResultset(strSql, rdOpenDynamic, rdConcurValues)
    
    '列表是否为空
    If recRecordset.RowCount = 0 Then
        msgPrintReceipt.HighLight = flexHighlightNever
    Else
        msgPrintReceipt.HighLight = flexHighlightAlways
    End If
    Set GetFilterList1 = recRecordset
End Function
Private Function GetReceiptName(intReceiptListType As Integer) As String
Select Case intReceiptListType
           Case 1  '商品采购
             GetReceiptName = "2"
           Case 2  '直运采购
             GetReceiptName = "3"

⌨️ 快捷键说明

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