mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Proper string formatting, no more hardcoded $ signs
This commit is contained in:
+17
-25
@@ -23,38 +23,30 @@ end)
|
||||
function ShowBillsMenu()
|
||||
|
||||
ESX.TriggerServerCallback('esx_billing:getBills', function(bills)
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
local elements = {}
|
||||
|
||||
for i=1, #bills, 1 do
|
||||
table.insert(elements, {label = bills[i].label .. ' - <span style="color: red;">$' .. bills[i].amount .. '</span>', value = bills[i].id})
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:red;">%s</span>'):format(bills[i].label, _U('invoices_item', ESX.Math.GroupDigits(bills[i].amount))),
|
||||
billID = bills[i].id
|
||||
})
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'billing',
|
||||
{
|
||||
title = _U('invoices'),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
},
|
||||
function(data, menu)
|
||||
|
||||
menu.close()
|
||||
|
||||
local billId = data.current.value
|
||||
|
||||
ESX.TriggerServerCallback('esx_billing:payBill', function()
|
||||
ShowBillsMenu()
|
||||
end, billId)
|
||||
|
||||
end,
|
||||
function(data, menu)
|
||||
menu.close()
|
||||
end
|
||||
)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing',
|
||||
{
|
||||
title = _U('invoices'),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
ESX.TriggerServerCallback('esx_billing:payBill', function()
|
||||
ShowBillsMenu()
|
||||
end, data.current.billID)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user