From ecd975391f6278a35e1cc2d15a118a8f56a6da81 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 26 Jul 2018 14:41:24 -0400 Subject: [PATCH] Database updates Adding new billing fields company position fax --- classes/data/dataAccounts.php | 24 +++++++++ index.php | 2 +- ...0.0.25.sql => create_database_V0.0.26.sql} | 6 ++- setup/databaseScripts/dbVersions.php | 1 + .../update_database_V0.0.26.sql | 20 ++++++++ views/admin/billing/editAccount.html | 51 +++++++++++++++---- 6 files changed, 93 insertions(+), 11 deletions(-) rename setup/databaseScripts/{create_database_V0.0.25.sql => create_database_V0.0.26.sql} (97%) create mode 100644 setup/databaseScripts/update_database_V0.0.26.sql diff --git a/classes/data/dataAccounts.php b/classes/data/dataAccounts.php index ad82ebb..17215f3 100644 --- a/classes/data/dataAccounts.php +++ b/classes/data/dataAccounts.php @@ -187,6 +187,22 @@ class GlmDataAccounts extends GlmDataAbstract 'required' => true, ), + // Billing Company + 'billing_company' => array( + 'field' => 'billing_company', + 'type' => 'text', + 'use' => 'a', + 'required' => false, + ), + + // Billing Position + 'billing_position' => array( + 'field' => 'billing_position', + 'type' => 'text', + 'use' => 'a', + 'required' => false, + ), + // Billing First Name 'billing_fname' => array( 'field' => 'billing_fname', @@ -253,6 +269,14 @@ class GlmDataAccounts extends GlmDataAbstract 'required' => false, ), + // Billing Fax + 'billing_fax' => array( + 'field' => 'billing_fax', + 'type' => 'text', + 'use' => 'a', + 'required' => false, + ), + // Customer Profile Id // 'customer_profile_id' => array( // 'field' => 'customer_profile_id', diff --git a/index.php b/index.php index b924cff..17f93dc 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.9'); -define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.25'); +define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.26'); // 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.25.sql b/setup/databaseScripts/create_database_V0.0.26.sql similarity index 97% rename from setup/databaseScripts/create_database_V0.0.25.sql rename to setup/databaseScripts/create_database_V0.0.26.sql index b9d7d70..ba6f9be 100644 --- a/setup/databaseScripts/create_database_V0.0.25.sql +++ b/setup/databaseScripts/create_database_V0.0.26.sql @@ -1,6 +1,6 @@ -- Gaslight Media Billing Module -- File Created: 11/08/2017 --- Database Version: 0.0.25 +-- Database Version: 0.0.26 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -18,12 +18,16 @@ CREATE TABLE {prefix}accounts ( invoice_type INT NOT NULL DEFAULT '0', -- Ref to Invoice Type id billing_fname TINYTEXT NULL, -- Billing First Name billing_lname TINYTEXT NULL, -- Billing Last Name + billing_company TINYTEXT NULL, -- Billing Company Name + billing_position TINYTEXT NULL, -- Billing Title/Position billing_addr1 TINYTEXT NULL, -- Billing Address 1 billing_addr2 TINYTEXT NULL, -- Billing Address 2 billing_city TINYTEXT NULL, -- Billing City billing_state TINYTEXT NULL, -- Billing State billing_zip TINYTEXT NULL, -- Billing Zip + billing_country TINYTEXT NULL, -- Billing Country billing_phone TINYTEXT NULL, -- Billing Phone + billing_fax TINYTEXT NULL, -- Billing Fax anniversary_date DATE NOT NULL, -- anniversary date - used for main invoice generation renewal_date DATE NULL, -- renewal date of account payment_data TEXT NULL, -- stored payment data diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 6177b2c..0c31fb0 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -39,5 +39,6 @@ $glmMembersBillingDbVersions = array( '0.0.23' => array('version' => '0.0.23', 'tables' => 15), '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), ); diff --git a/setup/databaseScripts/update_database_V0.0.26.sql b/setup/databaseScripts/update_database_V0.0.26.sql new file mode 100644 index 0000000..2f7f4c1 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.26.sql @@ -0,0 +1,20 @@ +-- Gaslight Media Billing Database +-- File Created: 2018-07-26 +-- Database Version: 0.0.26 +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +ALTER TABLE {prefix}accounts ADD billing_company TINYTEXT NULL; -- Billing Title/Position + +---- + +ALTER TABLE {prefix}accounts ADD billing_position TINYTEXT NULL; -- Billing Title/Position + +---- + +ALTER TABLE {prefix}accounts ADD billing_country TINYTEXT NULL; -- Billing Country + +---- + +ALTER TABLE {prefix}accounts ADD billing_fax TINYTEXT NULL; -- Billing Fax diff --git a/views/admin/billing/editAccount.html b/views/admin/billing/editAccount.html index 7d20414..614d11d 100644 --- a/views/admin/billing/editAccount.html +++ b/views/admin/billing/editAccount.html @@ -98,15 +98,32 @@
Billing Email
- + {if $account.fieldFail.email}

{$account.fieldFail.email}

{/if}
+
+
Billing Company
+
+ + {if $account.fieldFail.billing_company}

{$account.fieldFail.billing_company}

{/if}
+
+
+ +
+
Billing Position
+
+ + {if $account.fieldFail.billing_position}

{$account.fieldFail.billing_position}

{/if}
+
+
+ +
Billing First Name
- + {if $account.fieldFail.billing_fname}

{$account.fieldFail.billing_fname}

{/if}
@@ -114,7 +131,7 @@
Billing Last Name
- + {if $account.fieldFail.billing_lname}

{$account.fieldFail.billing_lname}

{/if}
@@ -122,7 +139,7 @@
Billing Address 1
- + {if $account.fieldFail.billing_addr1}

{$account.fieldFail.billing_addr1}

{/if}
@@ -130,7 +147,7 @@
Billing Address2
- + {if $account.fieldFail.billing_addr2}

{$account.fieldFail.billing_addr2}

{/if}
@@ -138,7 +155,7 @@
Billing City
- + {if $account.fieldFail.billing_city}

{$account.fieldFail.billing_city}

{/if}
@@ -146,7 +163,7 @@
Billing State
- {foreach $account.fieldData.billing_state.list as $s}