📄 clsgetdrug.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 = "clsGetDrug"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
'摆药明细
Public ADVSerial As String
Public Num As Integer
Public ItemCode As String
Public ItemName As String
Public model As String
Public ModelAmount As Double
Public PreMarkDate As String
Public ADVFreqID As String
Public ADVUsID As String
Public unit As String
Public Cprice As Currency
Public gprice As Currency
Public BeginDate As String
Public EndDate As String
Public Mount As Integer
Public Flag As Integer '药品字典的信息
Public Status As Integer '1 -- 选中 2 -- 记帐 0 -未
Public IsTemp As Boolean
Public DcCode As String
Public SFlag As Integer '第一位=1 为自带药,第二位=1 为材料费
Public Amount As Integer
Public batchid As String
Public NotStoreAmount As Boolean
Public CanKeep As Boolean
Public Sub GetStoreAmount()
Dim tmprs As Recordset
Dim TotalAmount As Integer
NotStoreAmount = False
Set tmprs = gdbobj.GetNewRs("select house_drugtmp.BatchID,house_drugtmp.Amount,Cprice,Gprice from house_drugtmp " _
& "inner join house_DrugBus on house_DrugBus.itemcode=house_drugtmp.itemcode " _
& " and house_drugbus.dscode=house_drugtmp.dscode and house_drugbus.batchid=house_drugtmp.batchid " _
& "where house_drugtmp.dscode='" & gtydSysConfig.DepCode & "' and house_drugtmp.itemcode='" & ItemCode & "'and house_drugtmp.amount<>0")
Do While Not tmprs.EOF
If Not CanKeep Then Exit Do
TotalAmount = TotalAmount + tmprs!Amount
tmprs.MoveNext
Loop
If TotalAmount >= Mount Then
tmprs.MoveFirst
Do While Not tmprs.EOF
batchid = tmprs!batchid
If gtydSysConfig.IfDecStore Then
Cprice = tmprs!Cprice
gprice = tmprs!gprice
End If
If Mount < tmprs!Amount Then
Call gdbobj.DBExec("update house_drugtmp set amount=amount-" & Mount _
& " where dscode='" & gtydSysConfig.DepCode & "' and itemcode='" & ItemCode & "' and batchid='" & batchid & "'")
Exit Do
Else
Call gdbobj.DBExec("update house_drugtmp set amount=0 where dscode='" & gtydSysConfig.DepCode _
& "'and itemcode='" & ItemCode & "'and batchid='" & batchid & "'")
Mount = tmprs!Amount
End If
tmprs.MoveNext
Loop
Else
NotStoreAmount = True
End If
End Sub
Public Property Get UpMode() As Integer '进位方式 0- 次 1-天 2- 频率周期 3-摆药周期
Select Case (Flag And 192)
Case 0
UpMode = 0
Case 64
UpMode = 1
Case 128
UpMode = 2
Case 192
UpMode = 3
End Select
End Property
Public Property Get UnitModelAmount() As Double
If model = "" Or (SFlag And 2) = 2 Then
UnitModelAmount = 1
Else
UnitModelAmount = Val(model)
End If
End Property
Public Property Get Fair() As Currency
Fair = Format(Mount * Cprice, "0.00")
End Property
Public Property Get gmoney() As Currency
gmoney = Format(Mount * gprice, "0.00")
End Property
Public Property Get InFair() As Currency
InFair = Fair
End Property
Public Sub GetMount(ByVal Days As Integer) '摆药结束日期
Dim TmpEndDate As String
If Amount = 0 Then
Mount = gfnGetMount(PreMarkDate, Days, EndDate, ADVFreqID, ModelAmount, UnitModelAmount, UpMode, IsTemp)
Else
Mount = gfnGetMountA(PreMarkDate, Days, EndDate, ADVFreqID, Amount, UpMode, IsTemp)
End If
End Sub
Public Property Get FreqDes() As String
If ADVUsID = "" Then
FreqDes = gADVFreqsObj(ADVFreqID).Des
Else
If Not (gADVUsagesObj(ADVUsID) Is Nothing) Then
FreqDes = gADVFreqsObj(ADVFreqID).Des & "(" & gADVUsagesObj(ADVUsID).Des & ")"
Else
FreqDes = gADVFreqsObj(ADVFreqID).Des
End If
End If
End Property
Public Property Get ModelUnit() As String
Dim i As Integer
For i = 1 To Len(model)
If Not (IsNumeric(mID(model, i, 1)) Or mID(model, i, 1) = ".") Then
Exit For
End If
Next i
ModelUnit = mID(model, i, Len(model))
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -