📄 bos_icstockbillorderlist.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "BOS_ICStockBillOrderList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "This is ListEvents Interface Class, made by K3BOSPLUGINSWIZAED"
'**********************************************************************
'2005-11-04 李伟
'调拨通知单的叙事薄插进
'功能:调拨通知单的关闭,反关闭
'**********************************************************************
'定义 ListEvents 接口. 必须具有的声明, 以此来获得事件
Private WithEvents m_ListInterface As ListEvents
Attribute m_ListInterface.VB_VarHelpID = -1
Public Sub Show(ByVal oListInterface As Object)
'ListEvents 接口实现
'注意: 此方法必须存在, 请勿修改
Set m_ListInterface = oListInterface
End Sub
Private Sub Class_Terminate()
'释放接口对象
'注意: 此方法必须存在, 请勿修改
Set m_ListInterface = Nothing
End Sub
Private Sub m_ListInterface_AfterSelList(ByVal RsId As ADODB.Recordset, VectList As KFO.IVector)
Dim Dic_Select As KFO.Dictionary
Dim rs9 As ADODB.Recordset
Set Dic_Select = VectList.Item(1)
g_lngFID = Dic_Select.GetValue("FID") '单据id复制给变量,给检斤单用
g_lngFEntryID = Dic_Select.GetValue("FEntryID") '单据分录ID给变量,给检斤单用
If Balance_Select = False Then
Set Rs1 = m_ListInterface.K3Lib.GetData("select count(t1.fid) as NoQmCount from t_ST_SC_BalanceBillentry t1 inner join t_ST_SC_BalanceBill t2 on t2.fid=t1.fid and t2.fstatus_wl=0 where t1.fclassid_src='200000137' and t1.Fid_src=" & g_lngFID)
If Rs1.Fields(0) > 0 Then
MsgBox "所选调拔通知单有" & Rs1.Fields(0) & "张对应检斤单没有经过质检!", , "金蝶提示"
End If
End If
Set rs9 = m_ListInterface.K3Lib.GetData("Select FBillNO from ICStockBillORder where FID=" & g_lngFID)
g_strBillNo_SRC = rs9.Fields(0)
Set Dic_Select = Nothing
Set rs9 = Nothing
End Sub
Private Sub m_ListInterface_MenuBarClick(ByVal BOSTool As K3ClassEvents.BOSTool, Cancel As Boolean)
Select Case BOSTool.ToolName
Case "mnuClose"
'此处添加处理 关闭 菜单对象的 Click 事件
My_Close
Case "mnuUnClose"
My_Unclose
Case Else
End Select
End Sub
Private Sub My_Close()
On Error GoTo ErrMy_Close
Dim dic_SelectRow As KFO.Dictionary
Dim lngID As Long
Dim lngEntryID As Long
Dim rs As ADODB.Recordset
Dim strSql As String
Set dic_SelectRow = m_ListInterface.GetCurrentSelRowInfo
lngID = dic_SelectRow.GetValue("FID")
lngEntryID = dic_SelectRow.GetValue("FEntryID")
Set rs = m_ListInterface.K3Lib.GetData("Select ICstockBillOrderEntry.FQty,ICstockBillOrderEntry.FBalanceWeight,ICstockBillOrder.Fchecker," & vbCrLf & _
"ICstockBillOrderEntry.FClose from ICstockBillOrderEntry join ICstockBillOrder on " & vbCrLf & _
"ICstockBillOrder.FID=ICstockBillOrderEntry.FID where ICstockBillOrderEntry.FID=" & lngID & " and ICstockBillOrderEntry.FEntryID=" & lngEntryID)
With rs
If .Fields("FClose") = 1 Then MsgBox "该分录已经关闭", vbInformation, "金蝶提示": Exit Sub
If .Fields("FChecker") = 0 Then MsgBox "该单据还未审核,不能关闭", vbInformation, "金蝶提示": Exit Sub
If .Fields("FBalanceWeight") = 0 Then MsgBox "该分录检斤数量为零,不能关闭", vbInformation, "金蝶提示": Exit Sub
If .Fields("FBalanceWeight") < .Fields("FQty") Then
If MsgBox("该分录检斤数量未达到调拨数量," & vbCrLf & _
"是否关闭?", vbYesNo, "金蝶提示") = vbYes Then
strSql = "Update ICstockBillOrderEntry set FClose=1 " & vbCrLf & _
"where FID=" & lngID & " and FEntryID=" & lngEntryID & vbCrLf & _
"Update ICstockBillOrderEntry set FAuxQty=FBalanceWeight/FChangeRate " & vbCrLf & _
"where FChangeRate>0 and FID=" & lngID & " and FEntryID=" & lngEntryID
m_ListInterface.K3Lib.GetData (strSql)
MsgBox "关闭完成", vbInformation, "金蝶提示"
End If
End If
End With
Exit Sub
ErrMy_Close:
MsgBox err.Description, vbCritical, "金蝶提示"
End Sub
Private Sub My_Unclose()
On Error GoTo errMy_Unclose
Dim dic_SelectRow As KFO.Dictionary
Dim lngID As Long
Dim lngEntryID As Long
Dim rs As ADODB.Recordset
Dim strSql As String
Set dic_SelectRow = m_ListInterface.GetCurrentSelRowInfo
lngID = dic_SelectRow.GetValue("FID")
lngEntryID = dic_SelectRow.GetValue("FEntryID")
Set rs = m_ListInterface.K3Lib.GetData("Select FQty, FBalanceWeight,FClose ,FFlag_StockBill from ICstockBillOrderEntry where " & vbCrLf & _
"FID=" & lngID & " and FEntryID=" & lngEntryID)
With rs
If .Fields("FClose") = 0 Then MsgBox "该单据还未关闭", vbInformation, "金蝶提示": Exit Sub
If .Fields("FFlag_StockBill") = 1 Then MsgBox "该单据已经被调拨单引用,不能反关闭", vbInformation, "金蝶提示": Exit Sub
If .Fields("FClose") = 1 And .Fields("FBalanceWeight") < .Fields("FQty") Then
If MsgBox("确实要反关闭该条分录吗?", vbYesNo, "金蝶提示") = vbYes Then
strSql = "Update ICstockBillOrderEntry set FClose=0 " & vbCrLf & _
"where FID=" & lngID & " and FEntryID=" & lngEntryID & vbCrLf & _
"Update ICstockBillOrderEntry set FAuxQty=FBalanceWeight/FChangeRate " & vbCrLf & _
"where FChangeRate>0 and FID=" & lngID & " and FEntryID=" & lngEntryID
m_ListInterface.K3Lib.GetData (strSql)
MsgBox "反关闭完成", vbInformation, "金蝶提示"
End If
End If
If .Fields("FClose") = 1 And .Fields("FBalanceWeight") >= .Fields("FQty") Then
MsgBox "该分录检斤数量已经达到调拨数量,不能反关闭", vbInformation, "金蝶提示"
End If
End With
Exit Sub
errMy_Unclose:
MsgBox err.Description, vbCritical, "金蝶提示"
End Sub
Private Sub m_ListInterface_MenuBarInitialize(ByVal oMenuBar As K3ClassEvents.MenuBar)
Dim oTool As K3ClassEvents.BOSTool
Dim oBand As K3ClassEvents.BOSBand
'*************** 开始新增 BOS 菜单 ***************
'新增 取皮重 菜单对象,并设置属性
Set oTool = oMenuBar.BOSTools.Add("mnuClose")
With oTool
.Caption = "关闭"
.ToolTipText = "关闭"
.Description = "关闭"
.ShortcutKey = 3
.Visible = True
.Enabled = True
.BeginGroup = False
'.ToolPicture = "C:\Documents and Settings\liwei\桌面\取数2.bmp"
.ToolPicture = App.Path & "\get.ico"
.SetPicture 0, vbButtonFace
End With
Set oBand = oMenuBar.BOSBands("BandToolBar")
oBand.BOSTools.InsertAfter "mnuCaculate", oTool '将菜单对象插入指定工具栏
Set oTool = oMenuBar.BOSTools.Add("mnuUnClose")
With oTool
.Caption = "反关闭"
.ToolTipText = "反关闭"
.Description = "反关闭"
.ShortcutKey = 3
.Visible = True
.Enabled = True
.BeginGroup = False
'.ToolPicture = "C:\Documents and Settings\liwei\桌面\取数2.bmp"
.ToolPicture = App.Path & "\get.ico"
.SetPicture 0, vbButtonFace
End With
Set oBand = oMenuBar.BOSBands("BandToolBar")
oBand.BOSTools.InsertAfter "mnuCaculate", oTool '将菜单对象插入指定工具栏
Set oTool = Nothing
Set oBand = Nothing
'------------------------------------------------------------------
''序时薄选单隐藏按钮
If m_ListInterface.List.ShowMode = 2 Then
''关闭
Set oBand = oMenuBar.BOSBands("BandToolBar")
Set oTool = oMenuBar.BOSTools("mnuClose")
With oTool
.Visible = False
.Enabled = False
End With
''反关闭
Set oBand = oMenuBar.BOSBands("BandToolBar")
Set oTool = oMenuBar.BOSTools("mnuUnClose")
With oTool
.Visible = False
.Enabled = False
End With
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -