@@ -910,43 +910,6 @@ function getTotalTax($tax_name, $year, $mysqli)
910910 return $ row ['total_tax ' ] ?? 0 ;
911911}
912912
913- //Get account currency code
914- function getAccountCurrencyCode ($ mysqli , $ account_id )
915- {
916- $ sql = mysqli_query ($ mysqli , "SELECT account_currency_code FROM accounts WHERE account_id = $ account_id " );
917- $ row = mysqli_fetch_array ($ sql );
918- return nullable_htmlentities ($ row ['account_currency_code ' ]);
919- }
920-
921- function calculateAccountBalance ($ mysqli , $ account_id )
922- {
923- $ sql_account = mysqli_query ($ mysqli , "SELECT * FROM accounts LEFT JOIN account_types ON accounts.account_type = account_types.account_type_id WHERE account_archived_at IS NULL AND account_id = $ account_id ORDER BY account_name ASC; " );
924- $ row = mysqli_fetch_array ($ sql_account );
925- $ opening_balance = floatval ($ row ['opening_balance ' ]);
926- $ account_id = intval ($ row ['account_id ' ]);
927-
928- $ sql_payments = mysqli_query ($ mysqli , "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $ account_id " );
929- $ row = mysqli_fetch_array ($ sql_payments );
930- $ total_payments = floatval ($ row ['total_payments ' ]);
931-
932- $ sql_revenues = mysqli_query ($ mysqli , "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $ account_id " );
933- $ row = mysqli_fetch_array ($ sql_revenues );
934- $ total_revenues = floatval ($ row ['total_revenues ' ]);
935-
936- $ sql_expenses = mysqli_query ($ mysqli , "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $ account_id " );
937- $ row = mysqli_fetch_array ($ sql_expenses );
938- $ total_expenses = floatval ($ row ['total_expenses ' ]);
939-
940- $ balance = $ opening_balance + $ total_payments + $ total_revenues - $ total_expenses ;
941-
942- if ($ balance == '' ) {
943- $ balance = '0.00 ' ;
944- }
945-
946- return $ balance ;
947- }
948-
949-
950913function generateReadablePassword ($ security_level )
951914{
952915 // Cap security level at 5
0 commit comments