diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-14 14:02:50 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-14 14:02:50 +0200 |
commit | a98bafed63f9322d54422861521c0c3c5d110d9a (patch) | |
tree | ca86cd09fd85055f8eb1ccfef10d8ed24c447145 /pages/money.inc | |
parent | 926714a89d3dcc2976228b9f0039a34b1e18f5e6 (diff) | |
download | pluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.tar.gz pluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.tar.bz2 pluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.zip |
Updated 7 files and added 4 files (automated)
Diffstat (limited to 'pages/money.inc')
-rw-r--r-- | pages/money.inc | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/pages/money.inc b/pages/money.inc index 69e732c..4d93398 100644 --- a/pages/money.inc +++ b/pages/money.inc @@ -15,25 +15,6 @@ $accounts = array_map(function ($i) { require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; -function calculateFullAmount($account, $asNumber = false, $gbpOnly = false): string|float|int { - global $rate; - $total = 0; - - foreach ($account["transactions"] as $transaction) { - $total += $transaction["amount"]; - } - - if ($asNumber) { - if ($gbpOnly && $account["currency"] === "eur") { - return $total * $rate; - } else { - return $total; - } - } else { - return number_format($total, 2, '.', ','); - } -} - global $parts; if (isset($parts[2])) { if (str_contains($parts[2], "/") || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/money/" . $parts[2] . ".json")) { @@ -77,7 +58,7 @@ if ((isset($_GET["create"]) || isset($_GET["delete"])) && isset($parts[2])) { ] ])); - array_unshift($account["transactions"], [ + if ((float)$_GET["amount"] !== 0.0) array_unshift($account["transactions"], [ "author" => $myId, "description" => $_GET["description"], "amount" => (float)$_GET["amount"], |