From 7b2566b6546edea97f0a72995e5d7e214543c94d Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 17 Sep 2024 13:59:58 -0400 Subject: [PATCH] Remove all reminense of Account Types next is deleting the DB Tables for account types --- account_add_modal.php | 22 ----- account_edit_modal.php | 21 ----- accounts.php | 7 +- invoice_payment_add_bulk_modal.php | 3 +- invoice_payment_add_modal.php | 3 +- post.php | 2 - post/account.php | 6 +- post/account_type.php | 68 --------------- report_balance_sheet.php | 110 ------------------------ report_collections.php | 131 ----------------------------- reports_side_nav.php | 12 --- setup.php | 24 +----- 12 files changed, 8 insertions(+), 401 deletions(-) delete mode 100644 post/account_type.php delete mode 100644 report_balance_sheet.php delete mode 100644 report_collections.php diff --git a/account_add_modal.php b/account_add_modal.php index dfc7bccf..9af3da36 100644 --- a/account_add_modal.php +++ b/account_add_modal.php @@ -22,28 +22,6 @@ -
- -
-
- -
- -
-
-
diff --git a/account_edit_modal.php b/account_edit_modal.php index b521c839..58df3b62 100644 --- a/account_edit_modal.php +++ b/account_edit_modal.php @@ -21,27 +21,6 @@
-
- -
-
- -
- -
-
-
diff --git a/accounts.php b/accounts.php index e2fb7a15..9703d683 100644 --- a/accounts.php +++ b/accounts.php @@ -12,8 +12,7 @@ $url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM accounts - LEFT JOIN account_types ON account_types.account_type_id = accounts.account_type - WHERE (account_name LIKE '%$q%' OR account_type_name LIKE '%$q%') + WHERE (account_name LIKE '%$q%') AND account_archived_at IS NULL ORDER BY $sort $order LIMIT $record_from, $record_to" ); @@ -44,7 +43,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); "> Name - Type Currency Balance Action @@ -59,8 +57,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $opening_balance = floatval($row['opening_balance']); $account_currency_code = nullable_htmlentities($row['account_currency_code']); $account_notes = nullable_htmlentities($row['account_notes']); - $account_type = intval($row['account_type']); - $account_type_name = nullable_htmlentities($row['account_type_name']); $sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id"); $row = mysqli_fetch_array($sql_payments); @@ -79,7 +75,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - diff --git a/invoice_payment_add_bulk_modal.php b/invoice_payment_add_bulk_modal.php index 90c13ee2..aa036489 100644 --- a/invoice_payment_add_bulk_modal.php +++ b/invoice_payment_add_bulk_modal.php @@ -59,9 +59,8 @@ - Select an Account - $account_id, - 'name' => $row['account_name'], - 'type' => $row['account_type_name'], - 'balance' => $balance - ]; -} - -function display_account_section($mysqli, $accounts, $type) { - foreach ($accounts[$type] as $account) { - global $currency_format; - global $currency_code; - $currency_code = getAccountCurrencyCode($mysqli, $account['id']); - echo ""; - echo "{$account['type']}"; - echo "{$account['name']}"; - echo "" . numfmt_format_currency($currency_format, $account['balance'], $currency_code) . ""; - echo ""; - } -} - -?> - -
-
-

Balance Sheet

-
- -
-
-
-
- -
-

- -

-

Balance Sheet

-
As of
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Total Assets
Total Liabilities
Total Equities
- -
-
-
- - \ No newline at end of file diff --git a/report_collections.php b/report_collections.php deleted file mode 100644 index 3eb51c70..00000000 --- a/report_collections.php +++ /dev/null @@ -1,131 +0,0 @@ - 0 THEN - (IFNULL(SUM(invoices.invoice_amount), 0) - IFNULL(SUM(payments.payment_amount), 0) - IFNULL(recurring_totals.recurring_monthly_total, 0)) / recurring_totals.recurring_monthly_total - ELSE - 0 - END AS months_behind - FROM - clients - LEFT JOIN - invoices - ON - clients.client_id = invoices.invoice_client_id - AND invoices.invoice_status NOT LIKE 'Draft' - AND invoices.invoice_status NOT LIKE 'Cancelled' - LEFT JOIN - (SELECT - payment_invoice_id, - SUM(payment_amount) as payment_amount - FROM payments - GROUP BY payment_invoice_id) as payments - ON - invoices.invoice_id = payments.payment_invoice_id - LEFT JOIN - contacts - ON - clients.client_id = contacts.contact_client_id AND contacts.contact_billing = 1 - LEFT JOIN - (SELECT - recurring_client_id, - SUM(recurring_amount) AS recurring_monthly_total - FROM recurring - WHERE recurring_status = 1 AND recurring_frequency = 'month' - GROUP BY recurring_client_id) as recurring_totals - ON - clients.client_id = recurring_totals.recurring_client_id - GROUP BY - clients.client_id, - clients.client_name, - contacts.contact_phone, - recurring_totals.recurring_monthly_total - HAVING - balance > 0 AND months_behind >= 2 - ORDER BY - months_behind DESC"; - - $result_client_balance_report = mysqli_query($mysqli, $sql_client_balance_report); - - $currency_row = mysqli_fetch_array(mysqli_query($mysqli,"SELECT company_currency FROM companies WHERE company_id = 1")); - $company_currency = nullable_htmlentities($currency_row['company_currency']); - -?> - -
-
-

Collections

-
- -
-
-
-
-
- - - - - - - - - - - - - "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - ?> - -
Client NameBalanceBilling Contact PhoneMonthly Recurring AmountPast Due BalanceMonths Past Due
$client_name$formatted_balance$billing_contact_phone$formatted_recurring_monthly_total$formatted_behind_amount$months_behind
-
-
-
-
- - diff --git a/reports_side_nav.php b/reports_side_nav.php index f4190fc6..718278b7 100644 --- a/reports_side_nav.php +++ b/reports_side_nav.php @@ -70,18 +70,6 @@

Profit & Loss

- -