forked from Simnation/Main
ed
This commit is contained in:
parent
a3269e304b
commit
f8715d76de
2 changed files with 35 additions and 3 deletions
|
@ -65,6 +65,24 @@ lib.callback.register('billing:server:getBillStatus', function(source, billId)
|
|||
return nil
|
||||
end)
|
||||
|
||||
-- Add a callback to get all bill statuses for a player
|
||||
lib.callback.register('billing:server:getAllBillStatuses', function(source)
|
||||
local src = source
|
||||
local player = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
if not player then return nil end
|
||||
|
||||
local citizenId = player.PlayerData.citizenid
|
||||
|
||||
-- Get all bill statuses for this player
|
||||
local result = MySQL.query.await('SELECT * FROM billing_accounts WHERE receiver_id = ?', {citizenId})
|
||||
if result and #result > 0 then
|
||||
return result
|
||||
end
|
||||
|
||||
return {}
|
||||
end)
|
||||
|
||||
-- Add a new callback for handling bill responses
|
||||
lib.callback.register('billing:server:handleBillResponse', function(source, data)
|
||||
local src = source
|
||||
|
@ -117,7 +135,9 @@ lib.callback.register('billing:server:handleBillResponse', function(source, data
|
|||
|
||||
return true
|
||||
elseif data.action == 'later' then
|
||||
-- No action needed, bill remains in system
|
||||
-- Simply close the prompt without any action
|
||||
-- The bill will remain in the system as unpaid
|
||||
-- No need to update anything in the database
|
||||
return true
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue