mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
FIX - polish banking interactions and transaction details
This commit is contained in:
@@ -1040,6 +1040,12 @@ Locales["en"] = {
|
||||
recipientPhone = "Phone number", recipientPhonePlaceholder = "Enter the recipient's number",
|
||||
chooseContact = "Choose from contacts", noContacts = "No contacts saved yet.",
|
||||
amount = "Amount", amountPlaceholder = "Enter an amount",
|
||||
transactionDetails = "Transaction details", transactionDate = "Date",
|
||||
transactionDirection = "Direction", transactionReference = "Reference",
|
||||
notifications = {
|
||||
receivedTitle = "Money received",
|
||||
received = "You received {amount} from {sender}.",
|
||||
},
|
||||
transactions = {
|
||||
deposit = "Cash deposit", withdrawal = "Cash withdrawal",
|
||||
transfer_in = "Incoming transfer", transfer_out = "Outgoing transfer",
|
||||
|
||||
@@ -894,8 +894,8 @@ RegisterNetEvent("sky_phone:calls:changed", function()
|
||||
SendNUIMessage({ type = "calls:changed" })
|
||||
end)
|
||||
|
||||
RegisterNetEvent("sky_phone:banking:changed", function()
|
||||
SendNUIMessage({ type = "banking:changed" })
|
||||
RegisterNetEvent("sky_phone:banking:changed", function(data)
|
||||
SendNUIMessage({ type = "banking:changed", data = data })
|
||||
end)
|
||||
|
||||
RegisterNetEvent("sky_phone:billing:changed", function()
|
||||
|
||||
@@ -79,8 +79,8 @@ local function record_transaction(identifier, kind, amount, label, reference)
|
||||
]], { identifier, kind, amount, label or "", reference or "" })
|
||||
end
|
||||
|
||||
local function notify_changed(source)
|
||||
TriggerClientEvent("sky_phone:banking:changed", source)
|
||||
local function notify_changed(source, data)
|
||||
TriggerClientEvent("sky_phone:banking:changed", source, data)
|
||||
end
|
||||
|
||||
local function online_source_for_phone(number)
|
||||
@@ -149,9 +149,15 @@ Bridge.Callbacks.Register("sky_phone:banking:transfer", function(source, data)
|
||||
end
|
||||
|
||||
local reference = ("phone-transfer-%s-%s"):format(os.time(), source)
|
||||
local sender_name = player_name(source)
|
||||
record_transaction(identifier, "transfer_out", amount, player_name(target), reference)
|
||||
record_transaction(target_identifier, "transfer_in", amount, player_name(source), reference)
|
||||
notify_changed(target)
|
||||
record_transaction(target_identifier, "transfer_in", amount, sender_name, reference)
|
||||
notify_changed(target, {
|
||||
kind = "transfer_in",
|
||||
amount = amount,
|
||||
currency = Config.Banking.Currency,
|
||||
sender = sender_name,
|
||||
})
|
||||
return { success = true, data = overview(source, identifier) }
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user