diff --git a/resources/[soz]/soz-bank/server/main.lua b/resources/[soz]/soz-bank/server/main.lua index a10268480c..4a0a137269 100644 --- a/resources/[soz]/soz-bank/server/main.lua +++ b/resources/[soz]/soz-bank/server/main.lua @@ -79,8 +79,7 @@ QBCore.Functions.CreateCallback("banking:server:TransferMoney", function(source, local CurrentMoney = Player.Functions.GetMoney("money") amount = tonumber(amount) - - if accountSource == "player" then --Dépot + if accountSource == "player" then -- Dépot if amount <= CurrentMoney then if Player.Functions.RemoveMoney("money", amount) then Account.AddMoney(accountTarget, amount) @@ -96,7 +95,7 @@ QBCore.Functions.CreateCallback("banking:server:TransferMoney", function(source, return end end - elseif accountTarget == "player" then --Retrait + elseif accountTarget == "player" then -- Retrait local AccountMoney = Account(accountSource).money if amount <= AccountMoney then if Player.Functions.AddMoney("money", amount) then @@ -113,7 +112,7 @@ QBCore.Functions.CreateCallback("banking:server:TransferMoney", function(source, return end end - else --Transfert entre 2 comptes + else -- Transfert entre 2 comptes Account.TransfertMoney(accountSource, accountTarget, amount, function(success, reason) if success then exports["soz-core"]:AddBankTransaction(accountSource, accountTarget, amount) @@ -126,8 +125,7 @@ QBCore.Functions.CreateCallback("banking:server:TransferMoney", function(source, if Target then TriggerClientEvent("soz-core:client:notification:draw-advanced", Target.PlayerData.source, "Maze Banque", "Mouvement bancaire", - "Un versement vient d'être réalisé sur votre compte", - "CHAR_BANK_MAZE") + "Un versement vient d'être réalisé sur votre compte", "CHAR_BANK_MAZE") end end end diff --git a/resources/[soz]/soz-core/src/server/bank/bank.service.ts b/resources/[soz]/soz-core/src/server/bank/bank.service.ts index b21ca123e6..232e47a091 100644 --- a/resources/[soz]/soz-core/src/server/bank/bank.service.ts +++ b/resources/[soz]/soz-core/src/server/bank/bank.service.ts @@ -123,6 +123,7 @@ export class BankService { private sendTransactionToPhone(transaction: any, player: PlayerData | null) { if (player) { TriggerClientEvent(ClientEvent.PHONE_APP_BANK_TRANSACTION_CREATED, player.source, { + id: Number(transaction.id), emitterAccount: transaction.emitterAccount, emitterName: transaction.emitterName, targetAccount: transaction.targetAccount, diff --git a/resources/[soz]/soz-phone/src/server/bank/bank.db.ts b/resources/[soz]/soz-phone/src/server/bank/bank.db.ts index 08e8940380..925d22d71f 100644 --- a/resources/[soz]/soz-phone/src/server/bank/bank.db.ts +++ b/resources/[soz]/soz-phone/src/server/bank/bank.db.ts @@ -3,7 +3,7 @@ import { BankTransaction } from '../../../typings/app/bank'; export class _BankTransactionDB { async getTransactions(account: string): Promise { return await exports.oxmysql.query_async( - `SELECT emitterAccount, emitterName, targetAccount, targetName, amount, unix_timestamp(date)*1000 as date + `SELECT id, emitterAccount, emitterName, targetAccount, targetName, amount, unix_timestamp(date)*1000 as date FROM bank_transactions WHERE date > date_sub(now(), interval 7 day) AND (targetAccount = ? OR emitterAccount = ?) diff --git a/resources/[soz]/soz-phone/typings/app/bank.ts b/resources/[soz]/soz-phone/typings/app/bank.ts index b123fdaddd..9513236c65 100644 --- a/resources/[soz]/soz-phone/typings/app/bank.ts +++ b/resources/[soz]/soz-phone/typings/app/bank.ts @@ -4,6 +4,7 @@ export interface IBankCredentials { balance: number; } export interface BankTransaction { + id: number, amount: bigint; emitterAccount: string; targetAccount: string;