Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed the problem that prevented the creation of invoices #583

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
48. fix: No such export getSharedObject in resource es_extended @bitpredator
49. [bpt_bakerjob]: refactor: bpt_bakerjob inventory implementation @bitpredator
50. [bpt_ballasjob]: refactor: bpt_ballasjob inventory implementation @bitpredator
51. [bpt_ballasjob]: feat: bpt_ballasjob\locales\en.lua @bitpredator
51. [bpt_ballasjob]: feat: bpt_ballasjob\locales\en.lua @bitpredator
52. [bpt_ammujob]: Fixed the problem that prevented the creation of invoices @bitpredator
19 changes: 10 additions & 9 deletions server-data/resources/[bpt_addons]/bpt_ammujob/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,23 @@ end
function OpenMobileAmmuActionsMenu()
local elements = {
{unselectable = true, icon = "fas fa-ammu", title = _U('ammu')},
{icon = "fas fa-scroll", title = _U('billing'), value = "billing"}
{icon = "fas fa-scroll", title = _U('billing'), value = "billing"},
}

ESX.OpenContext("right", elements, function(_,element)
ESX.OpenContext("right", elements, function(_, element)
if element.value == "billing" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
title = _U('invoice_amount')
}, function(data, menu)
local elements2 = {
{unselectable = true, icon = "fas fa-ammu", title = element.title},
{title = _U('amount'), input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = _U('bill_amount')},
{icon = "fas fa-check-double", title = _U('confirm'), value = "confirm"}
}

local amount = tonumber(data.value)
ESX.OpenContext("right", elements2, function(menu2)
local amount = tonumber(menu2.eles[2].inputValue)
if amount == nil then
ESX.ShowNotification(_U('amount_invalid'))
else
menu.close()
ESX.CloseContext()
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification(_U('no_players_near'))
Expand All @@ -228,8 +231,6 @@ function OpenMobileAmmuActionsMenu()
ESX.ShowNotification(_U('billing_sent'))
end
end
end, function(_, menu)
menu.close()
end)
end
end)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ Locales['en'] = {
['no_players_near'] = 'no players nearby',
['boss_actions'] = 'Boss actions',
['blip_ammu'] = 'Armory.',
['ammu'] = 'ammu'
['ammu'] = 'ammu',
-- billing
['bill_amount'] = "Amount to bill..",
['confirm'] = "Confirm"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ Locales['it'] = {
['no_players_near'] = 'nessun giocatore nelle vicinanze',
['boss_actions'] = 'Azioni del capo',
['blip_ammu'] = 'Armeria.',
['ammu'] = 'ammu'
['ammu'] = 'ammu',
-- billing
['bill_amount'] = "importo della fattura",
['confirm'] = "Conferma"
}
Loading