From 66c16d6cff1bef9c13c999d62ccedd202fe0da87 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 11 Oct 2023 14:46:44 -0400 Subject: [PATCH] Increment Database again to insert the account types for PR #734 Add Balance Sheet report --- database_updates.php | 21 +++++++++++++++++++-- database_version.php | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/database_updates.php b/database_updates.php index 97b42530..8407e94c 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1384,15 +1384,32 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.7'"); } + // Update DB to 0.8.8 + if (CURRENT_DATABASE_VERSION == '0.8.7') { + //Create Main Account Types + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Asset', account_type_id= '10', account_type_description = 'Assets are economic resources which are expected to benefit the business in the future.'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Liability', account_type_id= '20', account_type_description = 'Liabilities are obligations of the business entity. They are usually classified as current liabilities (due within one year or less) and long-term liabilities (due after one year).'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Equity', account_type_id= '30', account_type_description = 'Equity represents the owners stake in the business after liabilities have been deducted.'"); + //Create Secondary Account Types + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Current Asset', account_type_id= '11', account_type_description = 'Current assets are expected to be consumed within one year or less.'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Fixed Asset', account_type_id= '12', account_type_description = 'Fixed assets are expected to benefit the business for more than one year.'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Other Asset', account_type_id= '19', account_type_description = 'Other assets are assets that do not fit into any of the other asset categories.'"); + + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Current Liability', account_type_id= '21', account_type_description = 'Current liabilities are expected to be paid within one year or less.'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Long Term Liability', account_type_id= '22', account_type_description = 'Long term liabilities are expected to be paid after one year.'"); + mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Other Liability', account_type_id= '29', account_type_description = 'Other liabilities are liabilities that do not fit into any of the other liability categories.'"); + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.8'"); + } + // Be sure to change database_version.php to reflect the version you are updating to here // Please add this same comment block to the bottom of this file, and update the version number. // Uncomment Below Lines, to add additional database updates // - //if (CURRENT_DATABASE_VERSION == '0.8.7') { + //if (CURRENT_DATABASE_VERSION == '0.8.8') { // Insert queries here required to update to DB version 0.8.9 // // Then, update the database to the next sequential version - //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.8'"); + //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.9'"); //} // diff --git a/database_version.php b/database_version.php index 226d5b4a..714df7d1 100644 --- a/database_version.php +++ b/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "0.8.7"); +DEFINE("LATEST_DATABASE_VERSION", "0.8.8");