From bf37ff78b1ecf7b385d5a6d25bbf0dad233c58b4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Sat, 17 Mar 2018 14:54:27 -0400 Subject: [PATCH] Add new db field for settings New setting days before invoice --- classes/data/dataSettings.php | 7 +++++ index.php | 2 +- ...0.0.12.sql => create_database_V0.0.13.sql} | 27 ++++++++++--------- setup/databaseScripts/dbVersions.php | 1 + .../update_database_V0.0.13.sql | 9 +++++++ views/admin/settings/billing.html | 19 +++++++++++++ 6 files changed, 51 insertions(+), 14 deletions(-) rename setup/databaseScripts/{create_database_V0.0.12.sql => create_database_V0.0.13.sql} (90%) create mode 100644 setup/databaseScripts/update_database_V0.0.13.sql diff --git a/classes/data/dataSettings.php b/classes/data/dataSettings.php index 5c97ed0..b02ac72 100644 --- a/classes/data/dataSettings.php +++ b/classes/data/dataSettings.php @@ -209,6 +209,13 @@ class GlmDataBillingSettings extends GlmDataAbstract 'use' => 'a', ), + // Days Before Create Invoice + 'days_before_create_invoice' => array( + 'field' => 'days_before_create_invoice', + 'type' => 'integer', + 'use' => 'a', + ), + ); } diff --git a/index.php b/index.php index 74c88ed..14ac901 100644 --- a/index.php +++ b/index.php @@ -38,7 +38,7 @@ * version from this plugin. */ define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.12'); +define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.13'); // 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.12.sql b/setup/databaseScripts/create_database_V0.0.13.sql similarity index 90% rename from setup/databaseScripts/create_database_V0.0.12.sql rename to setup/databaseScripts/create_database_V0.0.13.sql index ed69e1f..70ef9e0 100644 --- a/setup/databaseScripts/create_database_V0.0.12.sql +++ b/setup/databaseScripts/create_database_V0.0.13.sql @@ -201,19 +201,20 @@ CREATE TABLE {prefix}invoice_payments ( -- Settings CREATE TABLE {prefix}settings ( id INT NOT NULL AUTO_INCREMENT, - company_logo TINYTEXT NULL, - company_logo_height INT NULL, - company_name TINYTEXT NULL, - company_name2 TINYTEXT NULL, - company_addr1 TINYTEXT NULL, - company_addr2 TINYTEXT NULL, - company_city TINYTEXT NULL, - company_state TINYTEXT NULL, - company_zip TINYTEXT NULL, - company_phone TINYTEXT NULL, - company_email TINYTEXT NULL, - company_url TINYTEXT NULL, - payment_terms TEXT NULL, + company_logo TINYTEXT NULL, -- Image logo + company_logo_height INT NULL, -- Logo Height (only used if creating pdf) + company_name TINYTEXT NULL, -- Company Name + company_name2 TINYTEXT NULL, -- Company Name 2 + company_addr1 TINYTEXT NULL, -- Company Address 1 + company_addr2 TINYTEXT NULL, -- Company Address 2 + company_city TINYTEXT NULL, -- Company City + company_state TINYTEXT NULL, -- Company State + company_zip TINYTEXT NULL, -- Company Zip + company_phone TINYTEXT NULL, -- Company Phone + company_email TINYTEXT NULL, -- Company Email + company_url TINYTEXT NULL, -- Company URL + payment_terms TEXT NULL, -- Payment Terms + days_before_create_invoice INT NULL, -- Number of days before anniversary date to create invoice PRIMARY KEY (id) ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 41b4d67..c53cd54 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -26,5 +26,6 @@ $glmMembersBillingDbVersions = array( '0.0.10' => array('version' => '0.0.10', 'tables' => 14), '0.0.11' => array('version' => '0.0.11', 'tables' => 14), '0.0.12' => array('version' => '0.0.12', 'tables' => 14), + '0.0.13' => array('version' => '0.0.13', 'tables' => 14), ); diff --git a/setup/databaseScripts/update_database_V0.0.13.sql b/setup/databaseScripts/update_database_V0.0.13.sql new file mode 100644 index 0000000..147cfc9 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.13.sql @@ -0,0 +1,9 @@ +-- Gaslight Media Billing Database +-- File Created: 03/17/2017 +-- Database Version: 0.0.13 +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +-- Add payment_term field to the settings table +ALTER TABLE {prefix}settings ADD days_before_create_invoice INT NULL; -- Number of days before anniversary date to create invoice diff --git a/views/admin/settings/billing.html b/views/admin/settings/billing.html index 8ff0339..cd077d2 100644 --- a/views/admin/settings/billing.html +++ b/views/admin/settings/billing.html @@ -20,6 +20,25 @@ + + + + + +
+ Days Before Anniversary Date
+ to Create Invoice
+ Must be a number +
+ + {if $billingSettings.fieldFail.days_before_create_invoice}

{$billingSettings.fieldFail.days_before_create_invoice}

{/if}
+
Company Logo -- 2.17.1