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 04a1096 commit c3e985f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
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
52. [bpt_ammujob]: Fixed the problem that prevented the creation of invoices @bitpredator
52. [bpt_ammujob]: Fixed the problem that prevented the creation of invoices @bitpredator
53. [bpt_bakerjob]: Fixed the problem that prevented the creation of invoices @bitpredator
21 changes: 11 additions & 10 deletions server-data/resources/[bpt_addons]/bpt_bakerjob/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,23 @@ end
function OpenMobileBakerActionsMenu()
local elements = {
{unselectable = true, icon = "fas fa-baker", title = _U('baker')},
{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-baker", 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 @@ -224,8 +227,6 @@ function OpenMobileBakerActionsMenu()
ESX.ShowNotification(_U('billing_sent'))
end
end
end, function(_, menu)
menu.close()
end)
end
end)
Expand All @@ -240,7 +241,7 @@ function IsInAuthorizedVehicle()
return true
end
end

return false
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ Locales['en'] = {
['comp_earned'] = 'your company earned $%s \n - you earned $%s',
['boss_actions'] = 'Boss actions',
['blip_baker'] = 'Baker.',
['baker'] = 'Baker'
['baker'] = 'Baker',
-- billing
['bill_amount'] = "Amount to bill..",
['confirm'] = "Confirm",
['amount'] = 'amount'
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ Locales['it'] = {
['comp_earned'] = 'la tua azienda ha guadagnato $%s \n - hai guadagnato $%s',
['boss_actions'] = 'Azioni del capo',
['blip_baker'] = 'Fornaio.',
['baker'] = 'Forno'
['baker'] = 'Forno',
-- billing
['bill_amount'] = "importo della fattura",
['confirm'] = "Conferma",
['amount'] = "Importo"
}

0 comments on commit c3e985f

Please sign in to comment.