1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-05 15:02:32 +02:00
parent a3269e304b
commit f8715d76de
2 changed files with 35 additions and 3 deletions

View file

@ -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