機房收費系統 結賬

2021-09-11 09:10:15 字數 3382 閱讀 1324

結賬是對這一段時間裡支出的乙個彙總,能清晰的知道自己今天賺了多少錢。

但這裡的結賬不是我們單純的認為的那種收費結賬,裡面有很多個環節步驟,就比如說操作員和管理原之間的區別是什麼:

操作員:相當於收銀員的型別,錢並不是到他那裡,而是個打工的。

管理員:真正的老闆,錢最後彙總到的地方。

再就是我們需要對各個表裡的東西有所了解:

1.售卡張數=購卡選項卡的記錄總數

2.退卡張數=退卡選項卡的記錄總數

3.充值金額=recharge表充值金額總數

4.臨時收費金額=student表未結賬的臨時使用者的金額總數

5.退卡金額=cancelcard表資訊的金額總數

6.總售卡數=售卡張數-退卡張數

7.應收金額=充值金額-退卡金額、

接下來就是我的部分**

private sub cmdok_click()

'購卡txtsql = "select*from student_info where userid='" & combouserid.text & "'" & "and " & _

"ischeck='" & "未結賬" & "' and date='" & date & "'"

set mrc_stu_sum = executesql(txtsql, msgtext)

if mrc_stu_sum.eof = false then

mrc_stu_sum.movefirst

end if

while not mrc_stu_sum.eof

mrc_stu_sum.fields(6) = "結賬"

mrc_stu_sum.update

mrc_stu_sum.movenext

wend

'關閉資料庫

mrc_stu_sum.close

'充值addmoney = 0

txtsql = "select*from recharge_info where userid='" & combouserid.text & "'" & "and " & _

"status='" & "未結賬" & "' and date='" & date & "'"

set mrc_re = executesql(txtsql, msgtext)

if mrc_re.eof = false then

mrc_re.movefirst

end if

while not mrc_re.eof

addmoney = addmoney + trim(mrc_re.fields(3))

mrc_re.fields(2) = "結賬"

mrc_re.update

mrc_re.movenext

wend

mrc_re.close

'退卡backcard = 0

txtsql = "select*from cancelcard_info where userid='" & combouserid.text & "'" & "and " &

"status='" & "未結賬" & "' and date='" & date & "'"

set mrc_stu_off = executesql(txtsql, msgtext)

if mrc_stu_off.eof = false then

mrc_stu_off.movefirst

end if

while not mrc_stu_off.eof

mrc_stu_off.fields(1) = "結賬"

mrc_stu_off.update

mrc_stu_off.movenext

wend

mrc_stu_off.close

'臨時使用者

txtsql = "select*from student_info where userid='" & combouserid.text & "'" & "and " & _

"ischeck='" & "未結賬" & "'" & "and " & _

"type='" & "臨時使用者" & "' and date='" & date & "'"

set mrc_stu_tem = executesql(txtsql, msgtext)

if mrc_stu_tem.eof = false then

mrc_stu_tem.movefirst

end if

while not mrc_stu_tem.eof

with flexgridtem

.rows = .rows + 1

.cellalignment = 4

.colalignment = 4

mrc_stu_tem.fields(6) = "結賬"

mrc_stu_tem.movenext

end with

wend

mrc_stu_tem.close

'下機txtsql = "select*from line_info where userid='" & combouserid.text & "'" & "and " & _

"statu='" & "未結賬" & "' and offdate='" & date & "'"

set mrc_line = executesql(txtsql, msgtext)

if mrc_line.eof = false then

mrc_line.movefirst

end if

while not mrc_line.eof

mrc_line.fields(11) = "結賬"

mrc_line.movenext

wend

mrc_line.close

'呼叫過程,新增表名

call addname

'臨時收費金額

txtsql = "select * from line_info where offdate='" & format(date, "yyyy-mm-dd") & "'" & _

"and userid='" & combouserid.text & "' and offdate='" & date & "'"

set mrc_line = executesql(txtsql, msgtext)

if mrc_line.eof then

temmoney = 0

else

while not mrc_line.eof

temmoney = temmoney + val(trim(mrc_line.fields(11)))

mrc_line.movenext

wend

end if

end sub

機房收費系統 之 結賬

結賬,顧名思義就是把錢算一下。這的結賬不是給每乙個卡號結賬,而是給乙個操作員結賬,算一下這個操作員一共賣卡張數,退卡張數,實收金額,應收金額等等。結賬的介面是這個樣子的,其中用到乙個選項卡 這個窗體相比較而言還有有點難度的。別看乙個小小的操作員使用者名稱,它不是一般的combo控制項,對於一般的co...

機房收費系統 之結賬

通過使用者名稱顯示真實姓名 txtsql select from user info where userid comboopuserid.text set mrc executesql txtsql,msgtext combooprealname.text mrc username mrc.clo...

機房收費系統 結賬之謎

在做結賬的時候,一直很困惑,對於計算consumecash心存疑慮 consumecash 註冊辦卡金額 充值金額 退卡金額 退卡金額 註冊辦卡金額 充值金額 consumecash cash 註冊辦卡金額 充值金額 consumecash 但是註冊辦卡金額 student info 中的cash ...