📄 clslistsale.cls
字号:
End If
If Not mclsSales.DeleteSales(lngActivityID, , , blnPushOut) Then Exit Sub
If blnIsInvoice Then
If intFormType = 18 And lngActivityTypeID <> 18 Then
gclsSys.SendMessage CStr(mfrmSale.hWnd), 32 + lngActivityTypeID
ElseIf intFormType = 11 Or intFormType = 12 Or intFormType = 14 Then
gclsSys.SendMessage CStr(mfrmSale.hWnd), 50
End If
End If
If blnPushOut Then
mfrmSale.ToolRefresh
Exit Sub
End If
'从Grid中删除本行
mfrmSale.ToolRefresh
End Sub
Private Sub mfrmSale_ListEdite()
Dim lngActivityID As Long
mfrmSale.Enabled = False
lngActivityID = mfrmSale.ListID
mblnFinish = True
frmEdit.ShowAOldBill lngActivityID, , intFormType + 2 '调用接口
mblnFinish = False
mfrmSale.Enabled = True
End Sub
Private Sub mfrmSale_oListInActive()
Dim strSql As String
Dim blnPushOut As Boolean
Dim lngActivityID As Long
Dim strMsg As String
lngActivityID = mfrmSale.ListID
If lngActivityID = 0 Then Exit Sub
If mfrmSale.IsInActive Then Exit Sub
If Not GetItemStatus(lngActivityID) Then Exit Sub
If Not blnChange Then
cMsgBox "不能作废由他人制作的单据!"
Exit Sub
End If
If ShowMsg(mfrmSale.hWnd, "本张" & strTypeName & "作废后将不能取消作废,您确实要作废吗?", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_SYSTEMMODAL, "提示信息") <> IDYES Then Exit Sub
If Not mclsSales.DeleteSales(lngActivityID, True, , blnPushOut) Then Exit Sub
If blnPushOut Then
mfrmSale.ToolRefresh
Exit Sub
End If
mfrmSale.ToolRefresh
End Sub
Private Sub mfrmSale_ListInActive(blnLevel As Boolean, blnSuceess As Boolean)
Dim strSql As String
Dim blnPushOut As Boolean
Dim lngActivityID As Long
Dim strMsg As String
blnLevel = False
blnSuceess = False
lngActivityID = mfrmSale.ListID
If lngActivityID = 0 Then Exit Sub
If mfrmSale.IsInActive Then Exit Sub
If Not GetItemStatus(lngActivityID) Then Exit Sub
If Not blnChange Then
cMsgBox "不能作废由他人制作的单据!"
Exit Sub
End If
If ShowMsg(mfrmSale.hWnd, "本张" & strTypeName & "作废后将不能取消作废,您确实要作废吗?", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2 + MB_SYSTEMMODAL, "提示信息") <> IDYES Then Exit Sub
If Not mclsSales.DeleteSales(lngActivityID, True, , blnPushOut) Then Exit Sub
If blnPushOut Then
blnSuceess = True
mfrmSale.ToolRefresh
Exit Sub
End If
'mfrmSale.ToolRefresh
blnSuceess = True
End Sub
Private Sub mfrmSale_ListNew()
mblnFinish = True
frmEdit.ShowANewTypeBill intFormType + 2
mblnFinish = False
End Sub
Private Sub mfrmSale_ListPrintReceipt()
frmPrintReceipt.ShowfrmPrintReceipt intFormType
End Sub
Private Sub mfrmSale_ListReorpt(ByVal Index As Integer)
Select Case Index
Case 0:
Select Case intFormType - 10
Case 1 '商品销售
#If conVersionType = 16 Then
Report.ShowSumReport 1459, 670
#Else
Report.ShowSumReport 1595, 719 '商品销售汇总表
#End If
Case 2 '直运销售
Report.ShowSumReport 1601, 725 '直运销售汇总表
Case 3 '代销出库
Report.ShowSumReport 1611, 735 '代销出库商品汇总表
Case 4 '代销结算
Report.ShowSumReport 1613, 737 '代销结算商品汇总表
Case 5 '加工出库
Report.ShowSumReport 1553, 578 '加工出库商品汇总表
Case 6 '分期出库
Report.ShowSumReport 1603, 727 '分期发出商品汇总表
Case 7 '分期结算
Report.ShowSumReport 1605, 729 '分期结算商品汇总表
Case 8 '销售发票
Report.ShowStandardReport 1620, 744 '销售发票一览表
Case 9 '领用出库
Report.ShowSumReport 1319, 762 '领用出库商品汇总表
' Case 10 '成本调整单一览表
Case 11 '盘亏出库
'Report.ShowSumReport 1323, 581 '商品盘亏汇总表
Case 12 '其它出库
' Report.ShowSumReport 1632, 568 '其它出库商品汇总表
End Select
Case 1:
Select Case intFormType - 10
Case 1 '商品销售
#If conVersionType = 16 Then
Report.ShowStandardReport 1461, 668
#Else
Report.ShowStandardReport 1596, 720 '单位销售汇总表
#End If
Case 2 '直运销售
Report.ShowStandardReport 1602, 726 '直运销售明细表
Case 3 '代销出库
Report.ShowStandardReport 1612, 736 '代销出库单位汇总表
Case 4 '代销结算
Report.ShowStandardReport 1614, 738 '代销出库单位汇总表
Case 5 '加工出库
Report.ShowStandardReport 1554, 567 '加工出库单位汇总表
Case 6 '分期出库
Report.ShowStandardReport 1604, 728 '分期发出单位汇总表
Case 7 '分期结算
Report.ShowStandardReport 1606, 730 '分期结算单位汇总表
Case 8
Report.ShowSumReport 1619, 743
Case 9 '领用出库
Report.ShowStandardReport 1301, 761 '领用出库商品明细表
Case 11 '盘亏出库
'Report.ShowStandardReport 1304, 569 '商品盘亏明细表
Case 12 '其它出库
'Report.ShowStandardReport 1630, 580 '其它出库商品明细表
End Select
Case 2
Select Case intFormType - 10
Case 8
Report.ShowStandardReport 1621, 745
End Select
End Select
End Sub
Private Sub mfrmSale_ListShowAll()
With mfrmSale
If .chkShowall = 0 Then
.ShowAll(0) = "ItemActivity.blnIsVoid=0"
Else
.ShowAll(0) = ""
End If
'.ToolRefresh
End With
End Sub
Private Function UpdateIsActive(ByVal intTab As Integer, ByVal strCode As String, ByVal blnIsInActive As Boolean, ByVal blnYes As Boolean) As Boolean
Dim strSql As String
Select Case intTab
Case 1
strSql = "UPDATE Currencys SET blnIsInActive = " & IIf(blnIsInActive, 1, 0) & " WHERE lngCurrencyID = " & lngID
Case 2
strSql = "UPDATE VoucherType SET blnIsInActive = " & IIf(blnIsInActive, 1, 0) & " WHERE lngVoucherTypeID = " & lngID
Case 3
strSql = "UPDATE PaymentMethod SET blnIsInActive = " & IIf(blnIsInActive, 1, 0) & " WHERE lngPaymentMethodID = " & lngID
Case 4
strSql = "UPDATE Term SET blnIsInActive = " & IIf(blnIsInActive, 1, 0) & " WHERE lngTermID = " & lngID
End Select
UpdateIsActive = gclsBase.ExecSQL(strSql)
End Function
Private Function ListIsInActive(ByVal intTab As Integer, ByVal lngID As Long, strCode As String) As Boolean
Dim recTmp As rdoResultset
Dim strSql As String
Select Case intTab
Case 1
strSql = "Select blnIsInActive,strCurrencysCode from Currencys Where lngCurrencyID=" & lngID
Case 2
strSql = "Select blnIsInActive,strVoucherTypeCode from VoucherType Where lngVoucherTypeID=" & lngID
Case 3
strSql = "Select blnIsInActive,strPaymentMethodCode from PaymentMethod Where lngPaymentMethodID=" & lngID
Case 4
strSql = "Select blnIsInActive,strTermCode from Term Where lngTermID=" & lngID
End Select
Set recTmp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If Not recTmp.EOF Then
ListIsInActive = IIf(recTmp!blnIsInActive = 1, True, False)
strCode = recTmp!strAccountCode
End If
End Function
Private Sub mfrmSale_ListUserMenu(ByVal Index As Integer)
If mfrmSale.blnIsReceptionWriteoff Then
If Index = 4 Then
Dim lngTypeID As Long
lngTypeID = frmWriteOffBill.WriteOffBill(intFormType + 2, mfrmSale.ListID, mfrmSale.hWnd)
If lngTypeID > 0 Then ShowBill1 intFormType + 2, lngTypeID, True
End If
End If
If intFormType = 18 Then
If Index = 9 Then
frmPrintReceipt.ShowfrmPrintReceipt 58
End If
End If
End Sub
Private Function GetlngActivityTypeID(lngActivityID As Long) As Long
Dim strSql As String
Dim recTemplete As rdoResultset
strSql = "SELECT lngActivityTypeID From ItemActivity where lngActivityID=" & lngActivityID
Set recTemplete = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If recTemplete.RowCount > 0 Then GetlngActivityTypeID = recTemplete!lngActivityTypeID
End Function
Private Function GetItemStatus(lngActivityID As Long) As Boolean
Dim strSql As String
Dim recTemp As rdoResultset
strSql = "SELECT ItemActivity.lngVoucherID, ItemActivity.lngOperatorID, ItemActivity.blnIsInvoice From ItemActivity" _
& " WHERE (ItemActivity.lngActivityID)=" & lngActivityID
Set recTemp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenForwardOnly)
If recTemp.BOF And recTemp.EOF Then
cMsgBox "请刷新列表后再执行!"
Exit Function
End If
'1
' If recTemp(0) > 0 Then
' blnIsVouchered = True
' Else
' blnIsVouchered = False
' End If
'2
If gclsBase.OperatorID = recTemp(1) Then
blnChange = True
Else
blnChange = False
End If
'3
blnIsInvoice = IIf(recTemp(2) = 1, True, False)
Set recTemp = Nothing
GetItemStatus = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -