Skip to content

Commit

Permalink
fix: Fixed the problem that prevented the creation of invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Dec 16, 2023
1 parent 7193eff commit 04a1096
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
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"
}

0 comments on commit 04a1096

Please sign in to comment.