From 40e9a65695915b3c2512a88a970130547e7393b1 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 17 Dec 2023 19:16:55 +0100 Subject: [PATCH] fix: Fixed the problem that prevented the creation of invoices --- .github/CHANGELOG.md | 3 ++- .../bpt_ballasjob/client/main.lua | 25 ++++++++++--------- .../[bpt_addons]/bpt_ballasjob/config.lua | 2 +- .../[bpt_addons]/bpt_ballasjob/locales/en.lua | 6 ++++- .../[bpt_addons]/bpt_ballasjob/locales/it.lua | 8 ++++-- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index e049ba795..d98c11d34 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -77,4 +77,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse 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 -53. [bpt_bakerjob]: Fixed the problem that prevented the creation of invoices @bitpredator \ No newline at end of file +53. [bpt_bakerjob]: Fixed the problem that prevented the creation of invoices @bitpredator +54. [bpt_ballasjob]: 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_ballasjob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_ballasjob/client/main.lua index 8c37e24bc..13158afe1 100644 --- a/server-data/resources/[bpt_addons]/bpt_ballasjob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_ballasjob/client/main.lua @@ -1,5 +1,5 @@ local HasAlreadyEnteredMarker -local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {} +local CurrentAction, CurrentActionMsg = nil, '' local LastZone RegisterNetEvent('esx:playerLoaded') @@ -77,20 +77,23 @@ end function OpenMobileBallasActionsMenu() local elements = { {unselectable = true, icon = "fas fa-ballas", title = _U('ballas')}, - {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 amount = tonumber(data.value) + local elements2 = { + {unselectable = true, icon = "fas fa-ballas", 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"} + } + + 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')) @@ -100,8 +103,6 @@ function OpenMobileBallasActionsMenu() ESX.ShowNotification(_U('billing_sent')) end end - end, function(_, menu) - menu.close() end) end end) @@ -152,7 +153,7 @@ CreateThread(function() if v.Type ~= -1 and distance < Config.DrawDistance then sleep = 0 if k == "" then - if inVeh then + if k == "" then DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) end diff --git a/server-data/resources/[bpt_addons]/bpt_ballasjob/config.lua b/server-data/resources/[bpt_addons]/bpt_ballasjob/config.lua index d3efbdcfe..f3aab3ba7 100644 --- a/server-data/resources/[bpt_addons]/bpt_ballasjob/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_ballasjob/config.lua @@ -1,7 +1,7 @@ Config = {} Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). Config.EnablePlayerManagement = true -- Enable society managing. -Config.Locale = 'it' +Config.Locale = 'en' Config.OxInventory = ESX.GetConfig().OxInventory Config.Zones = { diff --git a/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/en.lua index 90192319d..2220f3beb 100644 --- a/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/en.lua @@ -12,5 +12,9 @@ Locales['en'] = { ['deposit_stock'] = 'deposit stock', ['take_stock'] = 'take stock', ['have_deposited'] = 'have deposited', - ['quantity_invalid'] = 'quantity invalid' + ['quantity_invalid'] = 'quantity invalid', + -- billing + ['bill_amount'] = "Amount to bill..", + ['confirm'] = "Confirm", + ['amount'] = 'amount' } diff --git a/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/it.lua index 6a7000230..facda7e2f 100644 --- a/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_ballasjob/locales/it.lua @@ -12,5 +12,9 @@ Locales['it'] = { ['deposit_stock'] = 'Depositare', ['take_stock'] = 'Prendi', ['have_deposited'] = 'Hai depositato', - ['quantity_invalid'] = 'Qunatità non valida' -} + ['quantity_invalid'] = 'Qunatità non valida', + -- billing + ['bill_amount'] = "importo della fattura", + ['confirm'] = "Conferma", + ['amount'] = "Importo" +} \ No newline at end of file