THAI: Update loading and prevent insert cash while pressed pay with credit card

This commit is contained in:
Kenta420 2025-04-21 17:05:00 +07:00
parent 3762cdbb8b
commit 9fa4e9a943

View file

@ -142,9 +142,13 @@
Var PayAmount = PriceDrink
Var LOADING_STATE = "Invisible"
Var AlphaPopupLoadingState = "Invisible"
; Below original
; On open
Var CreditCardLoading = 0
Var CreditCardLoadingTimeout = 0
SAVELOG "payment case 1"
Var cancelState = "Invisible"
@ -1964,7 +1968,14 @@
; popup will close after 30 second
Var Timeout = 90
Var PopupTimeoutEnable = "Invisible"
Var cancelButtonQRPopupState = "Enable"
If alphaState = "Enable" Then
Var cancelButtonQRPopupState = "Enable"
EndIf
Var AlphaPopupLoadingState = "Invisible"
Var LOADING_STATE = "Invisible"
Var CreditCardLoading = 0
CoinVending XBILL
Else
Var Timeout = 0
EndIf
@ -2400,6 +2411,26 @@
If KBankCashlessMachine = 1 Then
If alphaState = "Enable" Then
If ReqPayInfoFromCashOther = 2 Then
If CreditCardLoading = 1 Then
If CreditCardLoadingTimeout > 0 Then
Var CreditCardLoadingTimeout = CreditCardLoadingTimeout - 1
Else
Var AlphaPopupLoadingState = "Invisible"
Var LOADING_STATE = "Invisible"
Var PopupTimeoutEnable = "Enable"
Var PopupTimeout = 20
Var CreditCardLoading = 0
If CoinAmount > 0 Then
Change CoinAmount
EndIf
If ViewBill > 0 Then
CoinVending BILLREJECT
EndIf
EndIf
EndIf
If PopupTimeoutEnable = "Enable" Then
If PopupTimeout > 0 Then
Var PopupTimeout = PopupTimeout - 1
@ -2563,122 +2594,122 @@
DEBUGVAR CoinInOK
If CashButtonState = "Enable" Then
Var CoinInFlag = 1
If ViewBill > 0 Then
If PayOfflineMode = 1 Then
Var alphaState3_offline = "Enable"
;CoinVending BILLREJECT
Else
If Seeker.StoreCreditFlag = 1 Then
CoinVending BILLSTACKALL
Else
Var RemainAmount = PayAmount - CoinAmount
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
If ViewBill >= RemainAmount Then
Var RemainAmountKeep = ViewBill - RemainAmount
Else
Var RemainAmountKeep = ViewBill
EndIf
DEBUGVAR Timeout
Var Timeout = 0
Var RemainAmountStr = "" + RemainAmount
Var showRemaining = charOfBaht + RemainAmountStr
If SELLONLINE = 1 Then
Var alphaState3 = "Enable"
Else
Var alphaState3_offline = "Enable"
EndIf
If show_eng = "true" Then
PlayLong "/mnt/sdcard/coffeevending/taobin_project/sound_eng/The_change_has_run_out.mp3"
Else
PlayLong "/mnt/sdcard/coffeevending/taobin_project/sound_thai/The_change_has_run_out.mp3"
EndIf
EndIf
EndIf
Else
If CoinInOK = 0 Then
Var RemainAmount = PayAmount - CoinAmount
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCampaign
Var SumCoinAmount = SumCoinAmount + Seeker.IntVendingCredit
If SumCoinAmount >= PayAmount Then
;Var VendingQRCode = "ERROR"
CoinVending OFF
VendingQR OFF
Var Canout = SumCoinAmount - PayAmount
If Canout = 0 Then
Var RemainAmountStr = 0
Else
If show_eng = "true" Then
Var RemainAmountStr = "Change " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=90"
Else
Var FlagalphaState2 = 1
Var RemainAmountStr = "ทอน " + Canout
EndIf
If LanguageShow = "MYANMAR" Then
Var RemainAmountStr = "ငွေပြောင်းပါ။ " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=60"
EndIf
If LanguageShow = "MSC" Then
Var RemainAmountStr = "找钱 " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=60"
EndIf
EndIf
Var CancleState = "Disable"
Var CoinInOK = 1
Var CoinInCounter = 0
Else
Var RemainAmountStr = "" + RemainAmount
EndIf
DEBUGVAR Timeout
Var Timeout = 0
;Var RemainAmount = 0
Var showRemaining = charOfBaht + RemainAmountStr
Var alphaState2 = "Enable"
Var alphaState2t = alphaState2
If FlagalphaState2 = 1 Then
Var alphaState2t = "Invisible"
EndIf
EndIf
EndIf
If CreditCardLoading = 1 Then
; do nothing
Else
If ViewBill > 0 Then
CoinVending BILLREJECT
EndIf
If CashButtonState = "Enable" Then
Var CoinInFlag = 1
Var RemainAmount = PayAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var RemainAmountStr = "" + RemainAmount
If ViewBill > 0 Then
If PayOfflineMode = 1 Then
Var alphaState3_offline = "Enable"
;CoinVending BILLREJECT
Else
If Seeker.StoreCreditFlag = 1 Then
CoinVending BILLSTACKALL
Else
Var RemainAmount = PayAmount - CoinAmount
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
If ViewBill >= RemainAmount Then
Var RemainAmountKeep = ViewBill - RemainAmount
Else
Var RemainAmountKeep = ViewBill
EndIf
DEBUGVAR Timeout
Var Timeout = 0
Var RemainAmountStr = "" + RemainAmount
Var showRemaining = charOfBaht + RemainAmountStr
If SELLONLINE = 1 Then
Var alphaState3 = "Enable"
Else
Var alphaState3_offline = "Enable"
EndIf
If show_eng = "true" Then
PlayLong "/mnt/sdcard/coffeevending/taobin_project/sound_eng/The_change_has_run_out.mp3"
Else
PlayLong "/mnt/sdcard/coffeevending/taobin_project/sound_thai/The_change_has_run_out.mp3"
EndIf
EndIf
EndIf
Else
If CoinInOK = 0 Then
Var RemainAmount = PayAmount - CoinAmount
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCampaign
Var SumCoinAmount = SumCoinAmount + Seeker.IntVendingCredit
If SumCoinAmount >= PayAmount Then
;Var VendingQRCode = "ERROR"
CoinVending OFF
VendingQR OFF
Var Canout = SumCoinAmount - PayAmount
If Canout = 0 Then
Var RemainAmountStr = 0
Else
If show_eng = "true" Then
Var RemainAmountStr = "Change " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=90"
Else
Var FlagalphaState2 = 1
Var RemainAmountStr = "ทอน " + Canout
EndIf
If LanguageShow = "MYANMAR" Then
Var RemainAmountStr = "ငွေပြောင်းပါ။ " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=60"
EndIf
If LanguageShow = "MSC" Then
Var RemainAmountStr = "找钱 " + Canout
Var RemainAmountStr = RemainAmountStr + "###size=60"
EndIf
EndIf
Var CancleState = "Disable"
Var CoinInOK = 1
Var CoinInCounter = 0
Else
Var RemainAmountStr = "" + RemainAmount
EndIf
DEBUGVAR Timeout
Var Timeout = 0
;Var RemainAmount = 0
Var showRemaining = charOfBaht + RemainAmountStr
Var alphaState2 = "Enable"
Var alphaState2t = alphaState2
If FlagalphaState2 = 1 Then
Var alphaState2t = "Invisible"
EndIf
EndIf
EndIf
Else
If ViewBill > 0 Then
CoinVending BILLREJECT
EndIf
Var RemainAmount = PayAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var RemainAmountStr = "" + RemainAmount
EndIf
Refresh
EndIf
Refresh
</EventCoin>
<EventVDCancle>
If CoinInFlag = 1 Then
@ -3063,14 +3094,19 @@
If KBankCashlessMachine = 1 Then
Var QR_POPUP = "/img_popup8_with_service_charge.png"
Var cancelButtonQRPopupState = "Invisible"
Var PopupTimeoutEnable = "Enable"
Var PopupTimeout = 20
Var AlphaPopupLoadingState = "Enable"
Var LOADING_STATE = "Enable"
Var CreditCardLoading = 1
Var CreditCardLoadingTimeout = 3
VendingQR OFF
CoinVending OFF
Coin CARD
Else
Var QR_POPUP = "/img_popup8.png"
Var cancelButtonQRPopupState = "Enable"
Coin CARD
EndIf
Var alphaState = "Enable"
Coin CARD
Var ReqPayInfoFromCashOther = 2
EndIf
EndIf
@ -3289,11 +3325,14 @@ eval(
Var CancelingPopupFlag = "Enable"
Var CancelingPopupCountDown = 0
If KBankCashlessMachine = 1 Then
If ServiceCharge > 0 Then
Var ServiceCharge = 0
EndIf
EndIf
If KBankCashlessMachine = 1 Then
If ReqPayInfoFromCashOther = 2 Then
If ServiceCharge > 0 Then
Var ServiceCharge = 0
EndIf
CoinVending XBILL
EndIf
EndIf
Refresh
EndIf
@ -3635,6 +3674,13 @@ eval(
;<Filename> Var( DirImage + "/loading.gif" )</Filename>
;</GIF>
<Image>
<X> 249 </X>
<Y> 748 </Y>
<State> AlphaPopupLoadingState </State>
<Filename> "ROOT/taobin_project/image/page_payment/alpha_popup.png" </Filename>
</Image>
<GIF>
<X> 493 </X>
<Y> 968 </Y>