diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 48d424cea..e049ba795 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_bakerjob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_bakerjob/client/main.lua index 11b040121..10ca0373e 100644 --- a/server-data/resources/[bpt_addons]/bpt_bakerjob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_bakerjob/client/main.lua @@ -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')) @@ -224,8 +227,6 @@ function OpenMobileBakerActionsMenu() ESX.ShowNotification(_U('billing_sent')) end end - end, function(_, menu) - menu.close() end) end end) @@ -240,7 +241,7 @@ function IsInAuthorizedVehicle() return true end end - + return false end diff --git a/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/en.lua index 0aef6b517..1895fb7e6 100644 --- a/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/en.lua @@ -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' } \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/it.lua index 09139d85a..e1e971a61 100644 --- a/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_bakerjob/locales/it.lua @@ -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" } \ No newline at end of file