📄 frmprintreceipt.frm
字号:
Case 25 '应收单
GetReceiptTypeSQL = "IN(" & CboEntryFormat.ItemData(CboEntryFormat.ListIndex) & ")"
Case 26 '应付单
GetReceiptTypeSQL = "IN(" & CboEntryFormat.ItemData(CboEntryFormat.ListIndex) & ")"
Case 27, 56 '收款单
GetReceiptTypeSQL = "IN(40)"
Case 28, 57 '付款单
GetReceiptTypeSQL = "IN(39)"
Case 29 '凭证
GetReceiptTypeSQL = "IN(" & CboEntryFormat.ItemData(CboEntryFormat.ListIndex) & ")"
Case 30 '调拨单
GetReceiptTypeSQL = "IN(28)"
Case 31 '调价单
GetReceiptTypeSQL = "IN(29)"
Case 32 '拆卸组装单
GetReceiptTypeSQL = "IN(" & CboEntryFormat.ItemData(CboEntryFormat.ListIndex) & ")"
Case 33 '商品盘点表
GetReceiptTypeSQL = "IN(33)"
Case 34 '入库成本表
GetReceiptTypeSQL = "IN(32)"
Case 35 '委托调拨
GetReceiptTypeSQL = "IN(26)"
Case 36 '固资变动
GetReceiptTypeSQL = "IN(" & CboEntryFormat.ItemData(CboEntryFormat.ListIndex) & ")"
Case 37 '固资卡片
GetReceiptTypeSQL = "IN(51)"
Case 38 '固资期初
GetReceiptTypeSQL = "IN(53)"
Case 39 '库存期初
GetReceiptTypeSQL = "IN(42)"
Case 40 '受托期初
GetReceiptTypeSQL = "IN(43)"
Case 41 '委托期初
GetReceiptTypeSQL = "IN(44)"
Case 42 '分期期初
GetReceiptTypeSQL = "IN(45)"
Case 43 '直运期初
GetReceiptTypeSQL = "IN(46)"
Case 44 '加工期初
GetReceiptTypeSQL = "IN(47)"
Case 45 '采购期初
GetReceiptTypeSQL = "IN(52)"
End Select
GetReceiptTypeSQL = GetReceiptTypeSQL '& ")"
End Function
Private Function GetTableFilterList1(ByVal strTableName As String, _
Optional ByVal BeginDate As String = "", Optional ByVal EndDate As String = "", _
Optional ByVal intReceiptListType As Integer) As rdoResultset
Dim recRecordset As rdoResultset
Dim strSelectOfSql As String
Dim strFromOfSql As String
Dim strWhereOfSql As String
Dim strOrderOfSql As String
Dim strSql As String
Dim bytAlterType As Integer
'先确定是否有此项目权限
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 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 = "FixedCard" Then
strSelectOfSql = "select FixedCard.lngFixedCardID as id," & strSelectOfSql
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(FixedAlter.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(FixedAlter.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and " & strWhereOfSql
Else
strWhereOfSql = "WHERE TO_DATE(FixedAlter.strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(FixedAlter.strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')"
End If
Else
strSelectOfSql = "select " & strTableName & ".lng" & strTableName & "ID as id," & strSelectOfSql
Select Case intReceiptListType
Case 36 '固资变动(48,49,50)
Select Case CboEntryFormat.ItemData(CboEntryFormat.ListIndex)
Case 48
bytAlterType = 1
Case 49
bytAlterType = 2
Case 50
bytAlterType = 3
End Select
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and fixedAlter.blnIsInit=0 and fixedAlter.bytAlterType=" & bytAlterType & " and " & strWhereOfSql
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and fixedAlter.blnIsInit=0 and fixedAlter.bytAlterType=" & bytAlterType
End If
Case 38 '固资期初
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and fixedAlter.bytAlterType=1 and fixedAlter.blnIsInit=1 and " & strWhereOfSql
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and fixedAlter.bytAlterType=1 and fixedAlter.blnIsInit=1"
End If
Case 29 '凭证
Select Case CboEntryFormat.ListIndex
Case 0 '记帐凭证
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and " & strWhereOfSql & " And VoucherType.strVoucherFormat=" & "'" & "0" & "'"
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " And VoucherType.strVoucherFormat=" & "'" & "0" & "'"
End If
Case 1 '收款凭证
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and " & strWhereOfSql & " And VoucherType.strVoucherFormat=" & "'" & "1" & "'"
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " And VoucherType.strVoucherFormat=" & "'" & "1" & "'"
End If
Case 2 '付款凭证
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and " & strWhereOfSql & " And VoucherType.strVoucherFormat=" & "'" & "2" & "'"
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " And VoucherType.strVoucherFormat=" & "'" & "2" & "'"
End If
End Select
Case Else
If strWhereOfSql <> "" Then
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')" _
& " and " & strWhereOfSql
Else
strWhereOfSql = "WHERE TO_DATE(" _
& strTableName & ".strDate,'yyyy-mm-dd')>=" & "TO_DATE('" & BeginDate & "','yyyy-mm-dd')" _
& " and TO_DATE(" & strTableName & ".strDate,'yyyy-mm-dd')<=" & "TO_DATE('" & EndDate & "','yyyy-mm-dd')"
End If
End Select
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
If intReceiptListType = 29 Then '如果是凭证
strOrderOfSql = " Order By Voucher.intYear,Voucher.bytPeriod,Voucher.lngVoucherTypeID,Voucher.intVoucherNO"
strSql = strSelectOfSql & " " & strFromOfSql & " " & strWhereOfSql & strOrderOfSql
Else
''' strOrderOfSql = " Order By intYear,bytPeriod,strReceiptNO,lngReceiptNO"
strSql = strSelectOfSql & " " & strFromOfSql & " " & strWhereOfSql '& strOrderOfSql
End If
Set recRecordset = gclsBase.BaseDB.OpenResultset(strSql, rdOpenDynamic, rdConcurValues)
'列表是否为空
If recRecordset.RowCount = 0 Then
msgPrintReceipt.HighLight = flexHighlightNever
Else
msgPrintReceipt.HighLight = flexHighlightAlways
End If
Set GetTableFilterList1 = recRecordset
End Function
' 付款方式ID
Public Property Get ReceiptID() As Long
With msgPrintReceipt
If .Row > 0 And .ColSel <> 0 Then ReceiptID = CLng(.TextArray(.Row * .Cols))
End With
End Property
Private Sub CboEntryFormat_Click()
If mblnIsRefreshData = True Then
RefreshData1
End If
mblnIsRefreshData = True
End Sub
Private Sub cboReceiptName_Click()
If mclsGrid.ListSet.ListID > 0 Then
Filter.DelSelectedCond mclsGrid.ListSet.ListID, 1
End If
RefreshData1
End Sub
'判断单据是否有查询权限
Private Function IsHaveRight(ByVal strReceiptName As String) As Boolean
IsHaveRight = False
Select Case strReceiptName
Case "采购订单"
If Not IsCanDo(50, gclsBase.OperatorID) Then Exit Function
Case "采购发票"
If Not IsCanDo(62, gclsBase.OperatorID) Then Exit Function
Case "直运采购"
If Not IsCanDo(54, gclsBase.OperatorID) Then Exit Function
Case "受托入库"
If Not IsCanDo(56, gclsBase.OperatorID) Then Exit Function
Case "受托结算"
If Not IsCanDo(58, gclsBase.OperatorID) Then Exit Function
Case "加工入库"
If Not IsCanDo(107, gclsBase.OperatorID) Then Exit Function
Case "加工费用"
If Not IsCanDo(109, gclsBase.OperatorID) Then Exit Function
Case "自制入库"
If Not IsCanDo(97, gclsBase.OperatorID) Then Exit Function
Case "盘盈入库"
If Not IsCanDo(129, gclsBase.OperatorID) Then Exit Function
Case "其它入库"
If Not IsCanDo(99, gclsBase.OperatorID) Then Exit Function
Case "销售订单"
If Not IsCanDo(69, gclsBase.OperatorID) Then Exit Function
Case "销售发票"
If Not IsCanDo(124, gclsBase.OperatorID) Then Exit Function
Case "直运销售"
If Not IsCanDo(72, gclsBase.OperatorID) Then Exit Function
Case "委托出库"
If Not IsCanDo(75, gclsBase.OperatorID) Then Exit Function
Case "委托结算"
If Not IsCanDo(77, gclsBase.OperatorID) Then Exit Function
Case "加工出库"
If Not IsCanDo(105, gclsBase.OperatorID) Then Exit Function
Case "分期出库"
If Not IsCanDo(82, gclsBase.OperatorID) Then Exit Function
Case "分期结算"
If Not IsCanDo(84, gclsBase.OperatorID) Then Exit Function
Case "领用出库"
If Not IsCanDo(101, gclsBase.OperatorID) Then Exit Function
Case "成本调整"
If Not IsCanDo(127, gclsBase.OperatorID) Then Exit Function
Case "盘亏出库"
If Not IsCanDo(130, gclsBase.OperatorID) Then Exit Function
Case "其它出库"
If Not IsCanDo(103, gclsBase.OperatorID) Then Exit Function
Case "代销调拨"
If Not IsCanDo(80, gclsBase.OperatorID) Then Exit Function
Case "商品调拨"
If Not IsCanDo(89, gclsBase.OperatorID) Then Exit Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -