THAI: Added Payment Code can control pay buttons state

This commit is contained in:
Kenta420 2025-01-17 15:26:40 +07:00
parent c1c8c69b62
commit 3d176f4313
7 changed files with 329 additions and 289 deletions

View file

@ -232,106 +232,127 @@
DEBUGVAR QRCODE99KBANK
Var EnableCCard = "Invisible"
Var InvisibleCCard = "Enable"
DEBUGVAR credit_card_enable
If credit_card_enable = "Enable" Then
Var InvisibleCCard = "Invisible"
EndIf
If Seeker = "next" Then
Var SeekerCurr = "curr"
If SeekerCurr.CreditCard = 1 Then
Var InvisibleCCard = "Enable"
EndIf
EndIf
If InvisibleCCard = "Invisible" Then
Var EnableCCard = "Enable"
EndIf
Var Cancel_Img = "/CancelOrder.png"
Var PressCancel_CashPopup = 0
Var CashButtonState = "Disable"
Var PromptPayButtonState = "Disable"
Var TaobinCreditButtonState = "Disable"
Var CreditCardButtonState = "Disable"
Var CouponButtonState = "Disable"
Var EWalletButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
If PaymentEnableAll = "true" Then
Var CashButtonState = "Enable"
Var PromptPayButtonState = "Enable"
Var TaobinCreditButtonState = "Enable"
Var CreditCardButtonState = "Enable"
Var CouponButtonState = "Enable"
Var EWalletButtonState = "Enable"
Var ThirdPartyCodeButtonState = "Enable"
Else
If CSH_CashEnable = "true" Then
Var CashButtonState = "Enable"
EndIf
If KBA_CashOtherEnable = "true" Then
Var PromptPayButtonState = "Enable"
EndIf
If TAO_CreditEnable = "true" Then
Var TaobinCreditButtonState = "Enable"
EndIf
If CRD_CreditCardEnable = "true" Then
Var CreditCardButtonState = "Enable"
EndIf
If CPD_CouponCodeEnable = "true" Then
Var CouponButtonState = "Enable"
EndIf
If E_WalletEnable = "true" Then
Var EWalletButtonState = "Enable"
EndIf
EndIf
If RoadShow = "true" Then
Var PayState1 = "Enable"
Var PayState2 = "Invisible"
Var PayState3 = "Invisible"
Var PayState4 = "Invisible"
Var PayState5 = "Invisible"
Var PayState6 = "Invisible"
Var CashButtonState = "Invisible"
Var PromptPayButtonState = "Invisible"
Var TaobinCreditButtonState = "Invisible"
Var CreditCardButtonState = "Invisible"
Var CouponButtonState = "Invisible"
Var EWalletButtonState = "Invisible"
Var ThirdPartyCodeButtonState = "Invisible"
Var showRemaining = "Free"
Else
Var PayState1 = "Enable"
DEBUGVAR credit_card_enable
If credit_card_enable = "Enable" Then
Else
Var CreditCardButtonState = "Invisible"
EndIf
If Seeker = "next" Then
Var SeekerCurr = "curr"
If SeekerCurr.CreditCard = 1 Then
Var CreditCardButtonState = "Invisible"
EndIf
EndIf
If cash_disable = "1" Then
Var PayState1 = "Press"
Var CashButtonState = "Disable"
EndIf
If Seeker.IntVendingCampaign = 0 Then
Var PayState2 = "Enable"
Var PayState4 = "Enable"
Var PayState5 = "Enable"
Var PayState6 = "Enable"
Var CouponButtonState = "Enable"
Else
SAVELOG "Cash only IntVendingCampaign"
Var PayState2 = "Disable"
Var PayState4 = "Enable"
Var PayState5 = "Enable"
Var PayState6 = "Disable"
Var CouponButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
If From15THBPro = 1 Then
Var PayState4 = "Enable"
EndIf
If E_WalletEnable = "true" Then
If FromRerunPro = 1 Then
Var PayState4 = "Enable"
EndIf
Else
Var EWalletButtonState = "Disable"
EndIf
EndIf
Var PayState3 = "Enable"
If From15THBPro = 1 Then
Var PayState2 = "Disable"
Var PayState3 = "Enable"
Var PayState5 = "Disable"
Var PayState6 = "Disable"
;Var PayState4 = "Disable"
EndIf
DEBUGVAR CoinAmount
If CoinAmount > 0 Then
SAVELOG "Cash only CoinAmount"
Var PayState2 = "Disable"
Var PayState3 = "Disable"
Var PayState4 = "Disable"
Var PayState5 = "Disable"
Var PayState6 = "Disable"
Var CoinInFlag = 1
Var PromptPayButtonState = "Disable"
Var TaobinCreditButtonState = "Disable"
Var CreditCardButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
If CPD_CouponCodeEnable = "true" Then
Else
Var CouponButtonState = "Disable"
EndIf
If E_WalletEnable = "true" Then
Else
Var EWalletButtonState = "Disable"
EndIf
;Var CoinInFlag = 1
EndIf
If Seeker.IntVendingCredit > 0 Then
SAVELOG "Cash only IntVendingCredit"
Var PayState2 = "Disable"
Var PayState4 = "Disable"
Var PayState5 = "Disable"
Var PayState6 = "Disable"
If From15THBPro = 1 Then
Var PayState3 = "Disable"
EndIf
Var TaobinCreditButtonState = "Disable"
Var CreditCardButtonState = "Disable"
Var CouponButtonState = "Disable"
Var EWalletButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
EndIf
@ -372,7 +393,9 @@
Var X_Diff = 113
;113
If EnableCCard = "Enable" Then
If CreditCardButtonState = "Invisible" Then
Else
Var X_CASH1 = 216 - 113
Var X_CASH2 = 439 - 113
Var X_CASH3 = 664 - 113
@ -440,12 +463,20 @@
If CoinInOK = 0 Then
Var RemainAmount = PayAmount - CoinAmount
If CashButtonState = "Enable" Then
Var RemainAmount = PayAmount - CoinAmount
Else
Var RemainAmount = PayAmount
EndIf
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCampaign
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCredit
If CashButtonState = "Enable" Then
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCampaign
Var SumCoinAmount = SumCoinAmount + Seeker.IntVendingCredit
Else
Var SumCoinAmount = 0
EndIf
If SumCoinAmount >= PayAmount Then
SAVELOG "CoinInOk First"
@ -518,11 +549,12 @@
If SELLONLINE = 0 Then
SAVELOG "Cash only NetworkStatus down"
Var PayState2 = "Disable"
Var PayState3 = "Disable"
Var PayState4 = "Disable"
Var PayState5 = "Disable"
Var PayState6 = "Disable"
Var PromptPayButtonState = "Disable"
Var TaobinCreditButtonState = "Disable"
Var CreditCardButtonState = "Disable"
Var CouponButtonState = "Disable"
Var EWalletButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
Var PayOfflineMode = 1
@ -540,7 +572,7 @@
DEBUGVAR NOCashFlag
If NOCashFlag = 1 Then
Var PayState1 = "Disable"
Var CashButtonState = "Disable"
EndIf
;cancel order
@ -567,7 +599,8 @@
;If DisableUsingCode = "true" Then
If DisableUsingCode = "-" Then
SAVELOG "Diable code because using topping."
Var PayState2 = "Disable"
Var CouponButtonState = "Disable"
Var ThirdPartyCodeButtonState = "Disable"
Var pay_with_code_image = DirImage + "/bd_pay_with_code.png"
Else
@ -587,13 +620,6 @@
Machine DoorClose
If ShoppyPayEnable = "true" Then
Else
Var PayState5 = "Disable"
Var PayState6 = "Disable"
EndIf
If web_readyOK = "true" Then
Var web_readyOK = "false"
@ -1237,17 +1263,6 @@
DEBUGVAR MenuCautionImageStage0
If IgnoreCollectPointByMe = 1 Then
SAVELOG "Diable code because IgnoreCollectPointByMe = 1."
Var PayState2 = "Disable"
EndIf
;for test
;Var PayState2 = "Enable"
;Var PayState3 = "Enable"
;Var PayState4 = "Enable"
;Var PayState5 = "Enable"
</EventOpen>
<EventActionOk>
@ -1999,8 +2014,8 @@
If RoadShow = "true" Then
Else
Var PayState3 = "Disable"
Var PayState5 = "Disable"
Var TaobinCreditButtonState = "Disable"
Var EWalletButtonState = "Disable"
EndIf
Var LOADING_STATE = "Invisible"
@ -2444,116 +2459,115 @@
Var CoinInFlag = 1
DEBUGVAR CoinInOK
If ViewBill > 0 Then
If CashButtonEnable = "true" Then
Var CoinInFlag = 1
If PayOfflineMode = 1 Then
Var alphaState3_offline = "Enable"
;CoinVending BILLREJECT
Else
If ViewBill > 0 Then
If PayOfflineMode = 1 Then
Var alphaState3_offline = "Enable"
;CoinVending BILLREJECT
Else
If Seeker.StoreCreditFlag = 1 Then
CoinVending BILLSTACKALL
Else
If Seeker.StoreCreditFlag = 1 Then
CoinVending BILLSTACKALL
Else
Var RemainAmount = PayAmount - CoinAmount
Var RemainAmount = RemainAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
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
If ViewBill >= RemainAmount Then
Var RemainAmountKeep = ViewBill - RemainAmount
Else
Var RemainAmountKeep = ViewBill
EndIf
DEBUGVAR Timeout
Var Timeout = 0
DEBUGVAR Timeout
Var Timeout = 0
Var RemainAmountStr = "" + RemainAmount
Var showRemaining = charOfBaht + RemainAmountStr
Var RemainAmountStr = "" + RemainAmount
Var showRemaining = charOfBaht + RemainAmountStr
If SELLONLINE = 1 Then
Var alphaState3 = "Enable"
Else
Var alphaState3_offline = "Enable"
EndIf
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
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
EndIf
Var SumCoinAmount = CoinAmount + Seeker.IntVendingCampaign
Var SumCoinAmount = SumCoinAmount + Seeker.IntVendingCredit
EndIf
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=90"
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
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=90"
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
Var RemainAmount = PayAmount - Seeker.IntVendingCampaign
Var RemainAmount = RemainAmount - Seeker.IntVendingCredit
Var RemainAmountStr = "" + RemainAmount
EndIf
@ -2706,10 +2720,10 @@
<Button>
<X> X_CASH1 </X>
<Y> 1276 </Y>
<State> PayState1</State>
<State> CashButtonState </State>
<Filename> FilenameShowbuttonCashBN </Filename>
<FilenamePress> FilenameShowbuttonCashBP </FilenamePress>
<FilenameDisable> FilenameShowbuttonCashBP </FilenameDisable>
<FilenameDisable> FilenameShowbuttonCashBD </FilenameDisable>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
@ -2747,10 +2761,10 @@
<Button>
<X> 216 </X>
<Y> 1499</Y>
<State> PayState2</State>
<State> CouponButtonState </State>
<Filename> Var( DirImage + "/bn_pay_with_code.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_pay_with_code.png") </FilenamePress>
<FilenameDisable> pay_with_code_image </FilenameDisable>
<FilenameDisable> Var( DirImage + "/bd_pay_with_code.png") </FilenameDisable>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
@ -2772,19 +2786,7 @@
<Button>
<X> X_CASH2 </X>
<Y> 1276 </Y>
<State>
eval(
Var shouldEnable = "Disable"
If KBA_CashOtherEnable = "true" Then
Var shouldEnable = "Enable"
Else
If EnableCashOtherAll = "true" Then
Var shouldEnable = "Enable"
EndIf
EndIf
Var return = shouldEnable
)
</State>
<State> PromptPayButtonState </State>
<Filename> Var( DirImage + "/bn_prompt_pay.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_prompt_pay.png") </FilenamePress>
<FilenameDisable> Var( DirImage + "/bd_prompt_pay.png") </FilenameDisable>
@ -2896,15 +2898,6 @@ eval(
EndIf
EndIf
EndIf
; If CoinInFlag = 0 Then
; Var BG_Menu_Page4 = "ROOT/image/BG_PromptPay_Page4.bmp"
; Var PayState1 = "Enable"
; Var PayState2 = "PressForever"
; Var QRChannel = 1
; Open "ROOT/taobin_project/xml/page_payment_qr.xml"
;
; EndIf
</EventClick>
</Button>
@ -2913,22 +2906,10 @@ eval(
<Button>
<X> X_CASH3 </X>
<Y> 1276 </Y>
<State>
eval(
Var shouldEnable = "Disable"
If TAO_CashOtherEnable = "true" Then
Var shouldEnable = "Enable"
Else
If EnableCashOtherAll = "true" Then
Var shouldEnable = "Enable"
EndIf
EndIf
Var return = shouldEnable
)
</State>
<State> TaobinCreditButtonState </State>
<Filename> Var( DirImage + "/bn_pay_with_credit.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_pay_with_credit.png") </FilenamePress>
<FilenameDisable> pay_with_credit_image </FilenameDisable>
<FilenameDisable> Var( DirImage + "/bd_pay_with_credit.png") </FilenameDisable>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
@ -2953,7 +2934,7 @@ eval(
<Button>
<X> 775 </X>
<Y> 1276 </Y>
<State> EnableCCard</State>
<State> CreditCardButtonState </State>
<Filename> Var( DirImage + "/bn_pay_with_ccard.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_pay_with_ccard.png") </FilenamePress>
<FilenameDisable> Var( DirImage + "/bd_pay_with_ccard.png") </FilenameDisable>
@ -2982,7 +2963,7 @@ eval(
<Button>
<X> 439 </X>
<Y> 1499 </Y>
<State> PayState5</State>
<State> EWalletButtonState </State>
<Filename> Var( DirImage + "/bn_pay_with_ewallet.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_pay_with_ewallet.png") </FilenamePress>
<FilenameDisable> Var( DirImage + "/bd_pay_with_ewallet.png") </FilenameDisable>
@ -3008,10 +2989,10 @@ eval(
<Button>
<X> 664 </X>
<Y> 1499 </Y>
<State> PayState2</State>
<State> ThirdPartyCodeButtonState </State>
<Filename> Var( DirImage + "/bn_pay_with_codeOther.png") </Filename>
<FilenamePress> Var( DirImage + "/bp_pay_with_codeOther.png") </FilenamePress>
<FilenameDisable> Var( DirImage + "/bp_pay_with_codeOther.png") </FilenameDisable>
<FilenameDisable> Var( DirImage + "/bd_pay_with_codeOther.png") </FilenameDisable>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>