From 31409644e80d6318eacf88a042437982f9717e44 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 19 Nov 2018 16:29:34 -0500 Subject: [PATCH] WIP db updates for uptravel Working on additions to tables for uptravel.com. Will probably need more table updates. --- classes/data/dataSettings.php | 21 +++++++++ index.php | 2 +- ...0.0.26.sql => create_database_V0.0.27.sql} | 15 +++++-- setup/databaseScripts/dbVersions.php | 1 + .../update_database_V0.0.27.sql | 44 +++++++++++++++++++ views/admin/settings/billing.html | 26 +++++++++++ 6 files changed, 104 insertions(+), 5 deletions(-) rename setup/databaseScripts/{create_database_V0.0.26.sql => create_database_V0.0.27.sql} (94%) create mode 100644 setup/databaseScripts/update_database_V0.0.27.sql diff --git a/classes/data/dataSettings.php b/classes/data/dataSettings.php index 3864417..3e6dd3c 100644 --- a/classes/data/dataSettings.php +++ b/classes/data/dataSettings.php @@ -237,6 +237,27 @@ class GlmDataBillingSettings extends GlmDataAbstract 'use' => 'a', ), + // Enable Member Types + 'member_types_enabled' => array( + 'field' => 'member_types_enabled', + 'type' => 'checkbox', + 'use' => 'a', + ), + + // Enable Quickbooks + 'quickbooks_enabled' => array( + 'field' => 'quickbooks_enabled', + 'type' => 'checkbox', + 'use' => 'a', + ), + + // Enable Member Billing + 'member_billing_enabled' => array( + 'field' => 'member_billing_enabled', + 'type' => 'checkbox', + 'use' => 'a', + ), + ); } diff --git a/index.php b/index.php index 5263c2c..7d5a509 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.16'); -define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.26'); +define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.27'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_BILLING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0'); diff --git a/setup/databaseScripts/create_database_V0.0.26.sql b/setup/databaseScripts/create_database_V0.0.27.sql similarity index 94% rename from setup/databaseScripts/create_database_V0.0.26.sql rename to setup/databaseScripts/create_database_V0.0.27.sql index ba6f9be..b1f5522 100644 --- a/setup/databaseScripts/create_database_V0.0.26.sql +++ b/setup/databaseScripts/create_database_V0.0.27.sql @@ -1,6 +1,6 @@ -- Gaslight Media Billing Module --- File Created: 11/08/2017 --- Database Version: 0.0.26 +-- File Created: 11/19/2018 +-- Database Version: 0.0.27 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -36,6 +36,7 @@ CREATE TABLE {prefix}accounts ( payment_profile_card TINYTEXT NULL, -- Payment Profile Card (Authorize.net) email TINYTEXT NULL, -- billing email boss BOOLEAN DEFAULT '0', -- Boss flag + account_number TINYTEXT NULL, -- Account Number PRIMARY KEY (id), INDEX(ref_dest), INDEX(ref_name(20)), @@ -93,6 +94,9 @@ CREATE TABLE {prefix}invoice_types ( amount DECIMAL(8,2) NOT NULL DEFAULT '0.00', -- amount recurring BOOLEAN DEFAULT '0', -- true/false if recurring recurrence INT NULL DEFAULT 0, -- recurrence type + dynamic_amount BOOLEAN DEFAULT '0', -- true/false if amount is dynamic + qcode TINYTEXT NULL, -- qcode for quickbooks + category TINYTEXT NULL, -- quickbooks category PRIMARY KEY (id) ); @@ -240,6 +244,9 @@ CREATE TABLE {prefix}settings ( days_after_expired INT NULL, -- Number of days after renewal date expired allow_membership_choice BOOLEAN DEFAULT '0', -- If memberships can choose their membership levels when they renew allow_employees BOOLEAN DEFAULT '0', -- If memberships have employees + member_types_enabled BOOLEAN DEFAULT '1', -- member types determine invoice types + quickbooks_enabled BOOLEAN DEFAULT '0', -- QuickBooks enabled + member_billing_enabled BOOLEAN DEFAULT '1', -- Member have access to billing info tab PRIMARY KEY (id) ); @@ -247,9 +254,9 @@ CREATE TABLE {prefix}settings ( -- Set default billing Settings entry INSERT INTO {prefix}settings - ( id, days_before_renewal ,days_after_expired ) + ( id, days_before_renewal ,days_after_expired, member_types_enabled, quickbooks_enabled, member_billing_enabled ) VALUES - ( 1, 90, 30 ); + ( 1, 90, 30, true, false, true ); ---- diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 0c31fb0..0ca4626 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -40,5 +40,6 @@ $glmMembersBillingDbVersions = array( '0.0.24' => array('version' => '0.0.24', 'tables' => 15), '0.0.25' => array('version' => '0.0.25', 'tables' => 15), '0.0.26' => array('version' => '0.0.26', 'tables' => 15), + '0.0.27' => array('version' => '0.0.27', 'tables' => 15, 'date' => '11/19/2018'), ); diff --git a/setup/databaseScripts/update_database_V0.0.27.sql b/setup/databaseScripts/update_database_V0.0.27.sql new file mode 100644 index 0000000..4946273 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.27.sql @@ -0,0 +1,44 @@ +-- Gaslight Media Billing Database +-- File Created: 11/19/2018 +-- Database Version: 0.0.27 +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +-- Add account_number field to the accounts table +ALTER TABLE {prefix}accounts ADD account_number TINYTEXT NULL; + +---- + +-- Add billing_lname field to the accounts table +ALTER TABLE {prefix}invoice_types ADD dynamic_amount BOOLEAN DEFAULT '0'; + +---- + +-- Add qcode to invoice_types +ALTER TABLE {prefix}invoice_types ADD qcode TINYTEXT NULL; + +---- + +-- Add category to invoice_types +ALTER TABLE {prefix}invoice_types ADD category TINYTEXT NULL; + +---- + +-- Add member_types_enabled to settings +ALTER TABLE {prefix}settings ADD member_types_enabled BOOLEAN DEFAULT '1'; + +---- + +-- Add quickbooks_enabled to settings +ALTER TABLE {prefix}settings ADD quickbooks_enabled BOOLEAN DEFAULT '0'; + +---- + +-- Add member_billing_enabled to settings +ALTER TABLE {prefix}settings ADD member_billing_enabled BOOLEAN DEFAULT '1'; + +---- + +-- +UPDATE {prefix}settings SET member_types_enabled = true, quickbooks_enabled = false, member_billing_enabled = true; diff --git a/views/admin/settings/billing.html b/views/admin/settings/billing.html index 636ab88..d0deba1 100644 --- a/views/admin/settings/billing.html +++ b/views/admin/settings/billing.html @@ -38,6 +38,32 @@ + + + Use member types in Invoice Types + + + + + + + + + Enable Quickbooks + + + + + + + + + Enable Members billing tab (for members) + + + + + -- 2.17.1