Adding two settings.
allow_employees - setup for migcsa
allow_membership_choice - on renew form allow member to choice the
membership level.
public function getListOfAccountEmployees( $member_id )
{
$accounts = array();
+ if ( !$this->config['settings']['allow_employees'] ) {
+ return $accounts;
+ }
// This may need to have filters setup in the contact plugin as well.
$employees = apply_filters( 'glm_contact_has_employees', '', $member_id );
// echo '<pre>$employees: ' . print_r( $employees, true ) . '</pre>';
'use' => 'a',
),
+ // Allow membership level choice
+ 'allow_membership_choice' => array(
+ 'field' => 'allow_membership_choice',
+ 'type' => 'checkbox',
+ 'use' => 'a',
+ ),
+
+ // Allow Employees
+ 'allow_employees' => array(
+ 'field' => 'allow_employees',
+ 'type' => 'checkbox',
+ 'use' => 'a',
+ ),
+
);
}
* version from this plugin.
*/
define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.16');
+define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.17');
// 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');
// echo '<pre>$employees: ' . print_r( $employees, true ) . '</pre>';
// Load DataClass for Management.
- require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataManagement.php';
+ require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataManagement.php';
$Management = new GlmDataBillingManagement( $this->wpdb, $this->config );
$management = $Management->getEntry( 1 );
// Need to see if there's an account for this member.
- require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataAccounts.php';
+ require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataAccounts.php';
$account = $Accounts->editEntry( $accountID );
break;
+++ /dev/null
--- Gaslight Media Billing Module
--- File Created: 11/08/2017
--- Database Version: 0.0.15
--- Database Creation Script
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
---
--- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
---
-
--- Billing Accounts
-CREATE TABLE {prefix}accounts (
- id INT NOT NULL AUTO_INCREMENT,
- archived BOOLEAN DEFAULT '0', -- Marks account as archived
- ref_dest INT NOT NULL, -- reference to member id
- ref_name TINYTEXT NOT NULL, -- Name of reference member
- billing_fname TINYTEXT NULL, -- Billing First Name
- billing_lname TINYTEXT NULL, -- Billing Last Name
- 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_phone TINYTEXT NULL, -- Billing Phone
- 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
- email TINYTEXT NULL, -- billing email
- PRIMARY KEY (id),
- INDEX(ref_dest),
- INDEX(ref_name(20)),
- INDEX(email(20))
-);
-
-----
-
--- transactions
-CREATE TABLE {prefix}transactions (
- id INT NOT NULL AUTO_INCREMENT,
- type INT NOT NULL, -- type of transaction (payment,invoice,etc)
- type_id INT NOT NULL, -- reference to type id
- account INT NOT NULL, -- reference to account id
- transaction_time DATETIME NOT NULL, -- datetime for the transaction
- current_invoice_total DECIMAL(8, 2) NOT NULL, -- invoice total
- current_payment_total DECIMAL(8, 2) NOT NULL, -- payment total
- PRIMARY KEY (id),
- INDEX(account),
- INDEX(type_id),
- INDEX(transaction_time)
-);
-
-----
-
--- Invoices
-CREATE TABLE {prefix}invoices (
- id INT NOT NULL AUTO_INCREMENT,
- transaction_time DATETIME NOT NULL, -- datetime for the invoice
- account INT NOT NULL, -- ref to account id
- amount_total DECIMAL(8, 2) NOT NULL, -- total amount for invoice
- balance DECIMAL(8, 2) NOT NULL, -- balance for this invoice
- due_date DATE NOT NULL, -- Due date for this invoice
- paid BOOLEAN DEFAULT '0', -- true/false if invoice is paid
- notes TINYTEXT, -- notes for this invoice
- recurring BOOLEAN DEFAULT '0', -- true/false if recurring
- recurrence INT NULL DEFAULT 0, -- recurrence type
- PRIMARY KEY (id),
- INDEX(account),
- INDEX(transaction_time),
- INDEX(due_date)
-);
-
-----
-
--- Line Item Types
-CREATE TABLE {prefix}invoice_types (
- id INT NOT NULL AUTO_INCREMENT,
- name TINYTEXT NOT NULL, -- name
- parent INT NOT NULL DEFAULT 0, -- 0 if top level otherwise ref to another line_item_type as it's parent
- member_type INT NOT NULL DEFAULT 0, -- Member Type assigned Default 0
- 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
- PRIMARY KEY (id)
-);
-
-----
-
--- Line Items
-CREATE TABLE {prefix}line_items (
- id INT NOT NULL AUTO_INCREMENT,
- invoice INT NOT NULL, -- reference to invoice
- line_item_type INT NOT NULL, -- reference to line item type
- name TEXT NOT NULL, -- line item name
- amount DECIMAL(8,2) DEFAULT '0.00', -- line item amount per item
- quantity INT DEFAULT 1, -- quantity
- total DECIMAL(8,2) DEFAULT '0.00', -- line item total
- recurring BOOLEAN DEFAULT '0', -- true/false if recurring
- recurrence INT NULL DEFAULT 0, -- recurrence type
- created DATE NULL, -- Date this line item was first created
- first_due_date DATE NULL, -- The first due date for this item
- next_due_date DATE NULL, -- Next Due Date for this item
- PRIMARY KEY (id),
- INDEX(account),
- INDEX(created),
- INDEX(first_due_date),
- INDEX(next_due_date)
-);
-
-----
-
--- payments
-CREATE TABLE {prefix}payments (
- id INT NOT NULL AUTO_INCREMENT,
- transaction_time DATETIME NOT NULL, -- datetime of payment
- account INT NOT NULL, -- ref to account table
- amount DECIMAL(8, 2) NOT NULL, -- payment amount
- payment_method TINYTEXT NOT NULL, -- payment method
- payment_data TINYTEXT NULL, -- additional payment info
- PRIMARY KEY (id)
-);
-
-----
-
--- pdfs
-CREATE TABLE {prefix}pdfs (
- id INT NOT NULL AUTO_INCREMENT,
- ref_type INT NOT NULL, -- reference type
- ref_dest INT NOT NULL, -- reference types id
- pdf MEDIUMTEXT NOT NULL, -- saved pdf
- PRIMARY KEY (id)
-);
-
-----
-
--- Notification Types
-CREATE TABLE {prefix}notification_types (
- id INT NOT NULL AUTO_INCREMENT,
- name TINYTEXT NOT NULL, -- name
- from_header TINYTEXT NOT NULL, -- from headers
- replyto TINYTEXT NULL, -- reply-to headers
- subject TINYTEXT NOT NULL, -- Subject
- message TEXT NOT NULL, -- Message
- send_by_date BOOLEAN NULL DEFAULT '0', -- true/false send by date based on due date
- send_by_action BOOLEAN NULL DEFAULT '0', -- send notice based on an action
- send_action INT NULL DEFAULT 0, -- (create invoice or receive payment)
- send_date_number INT NULL DEFAULT 0, -- number to apply to send by date
- send_date_period INT NULL DEFAULT 0, -- (days,weeks,months,years)
- send_date_when INT NULL DEFAULT 0, -- (before or after)
- PRIMARY KEY (id)
-);
-
-----
-
--- Notifications
-CREATE TABLE {prefix}notifications (
- id INT NOT NULL AUTO_INCREMENT,
- notification_type INT NOT NULL, -- ref to notification type
- account INT NOT NULL, -- ref to account
- from_replyto TINYTEXT NOT NULL, -- from reply-to header
- subject TEXT NOT NULL, -- subject
- message TEXT NOT NULL, -- message
- date_sent DATETIME NOT NULL, -- Date the notice was sent
- email_sent TINYTEXT NOT NULL, -- email used
- PRIMARY KEY (id)
-);
-
-----
-
--- Notification Queue
-CREATE TABLE {prefix}notification_queue (
- id INT NOT NULL AUTO_INCREMENT,
- notification_type INT NOT NULL, -- ref to notification type
- account INT NOT NULL, -- ref to account
- PRIMARY KEY (id)
-);
-
-----
-
--- Gateway Settings
-CREATE TABLE {prefix}gateway_settings (
- id INT NOT NULL AUTO_INCREMENT,
- name TEXT NOT NULL,
- login_id TINYTEXT NOT NULL,
- transaction_key TINYTEXT NOT NULL,
- PRIMARY KEY (id)
-);
-
-----
-
--- Invoice Payments
-CREATE TABLE {prefix}invoice_payments (
- id INT NOT NULL AUTO_INCREMENT,
- invoice INT NOT NULL, -- reference to invoice id
- payment INT NOT NULL, -- reference to payment id
- amount DECIMAL(8, 2) NOT NULL, -- payment amount
- PRIMARY KEY (id),
- INDEX(invoice)
-);
-
-----
-
--- Settings
-CREATE TABLE {prefix}settings (
- id INT NOT NULL AUTO_INCREMENT,
- 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_renewal INT NULL, -- Number of days before renewal date to allow renewals
- days_after_expired INT NULL, -- Number of days after renewal date expired
- PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Settings entry
-INSERT INTO {prefix}settings
- ( id, days_before_renewal ,days_after_expired )
- VALUES
- ( 1, 90, 30 );
-
-----
-
--- Management
-CREATE TABLE {prefix}management (
- id INT NOT NULL AUTO_INCREMENT,
- payment_methods SMALLINT NULL, -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
- proc_methods SMALLINT NULL, -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
- cc_accepts SMALLINT NULL, -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
- -- Authorize.net Credentials
- authorize_net_login TINYTEXT NULL,
- authorize_net_key TINYTEXT NULL,
- authorize_net_test TINYINT NULL, -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
- authorize_net_conf BOOLEAN NULL, -- Flag to send payment confirmation Email from Authorize.net
- authorize_net_merchant_email TINYTEXT NULL, -- E-Mail Authorize.net will send copy of confirmation E-Mail
- -- Merchant Solutions Credentials
- merchant_solutions_acctid TINYTEXT NULL, -- Merchant Solutions credentials
- merchant_solutions_merchantpin TINYTEXT NULL,
- merchant_solutions_test TINYINT NULL, -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
- merchant_solutions_conf BOOLEAN NULL, -- Flag to send payment confirmation Email
- merchant_solutions_merchant_email TINYTEXT NULL, -- Merchant Solutions will send copy of confirmation E-Mail
- PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Management entry
-INSERT INTO {prefix}management
- ( id )
- VALUES
- ( 1 );
--- /dev/null
+-- Gaslight Media Billing Module
+-- File Created: 11/08/2017
+-- Database Version: 0.0.15
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+-- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
+--
+
+-- Billing Accounts
+CREATE TABLE {prefix}accounts (
+ id INT NOT NULL AUTO_INCREMENT,
+ archived BOOLEAN DEFAULT '0', -- Marks account as archived
+ ref_dest INT NOT NULL, -- reference to member id
+ ref_name TINYTEXT NOT NULL, -- Name of reference member
+ billing_fname TINYTEXT NULL, -- Billing First Name
+ billing_lname TINYTEXT NULL, -- Billing Last Name
+ 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_phone TINYTEXT NULL, -- Billing Phone
+ 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
+ email TINYTEXT NULL, -- billing email
+ PRIMARY KEY (id),
+ INDEX(ref_dest),
+ INDEX(ref_name(20)),
+ INDEX(email(20))
+);
+
+----
+
+-- transactions
+CREATE TABLE {prefix}transactions (
+ id INT NOT NULL AUTO_INCREMENT,
+ type INT NOT NULL, -- type of transaction (payment,invoice,etc)
+ type_id INT NOT NULL, -- reference to type id
+ account INT NOT NULL, -- reference to account id
+ transaction_time DATETIME NOT NULL, -- datetime for the transaction
+ current_invoice_total DECIMAL(8, 2) NOT NULL, -- invoice total
+ current_payment_total DECIMAL(8, 2) NOT NULL, -- payment total
+ PRIMARY KEY (id),
+ INDEX(account),
+ INDEX(type_id),
+ INDEX(transaction_time)
+);
+
+----
+
+-- Invoices
+CREATE TABLE {prefix}invoices (
+ id INT NOT NULL AUTO_INCREMENT,
+ transaction_time DATETIME NOT NULL, -- datetime for the invoice
+ account INT NOT NULL, -- ref to account id
+ amount_total DECIMAL(8, 2) NOT NULL, -- total amount for invoice
+ balance DECIMAL(8, 2) NOT NULL, -- balance for this invoice
+ due_date DATE NOT NULL, -- Due date for this invoice
+ paid BOOLEAN DEFAULT '0', -- true/false if invoice is paid
+ notes TINYTEXT, -- notes for this invoice
+ recurring BOOLEAN DEFAULT '0', -- true/false if recurring
+ recurrence INT NULL DEFAULT 0, -- recurrence type
+ PRIMARY KEY (id),
+ INDEX(account),
+ INDEX(transaction_time),
+ INDEX(due_date)
+);
+
+----
+
+-- Line Item Types
+CREATE TABLE {prefix}invoice_types (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NOT NULL, -- name
+ parent INT NOT NULL DEFAULT 0, -- 0 if top level otherwise ref to another line_item_type as it's parent
+ member_type INT NOT NULL DEFAULT 0, -- Member Type assigned Default 0
+ 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
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Line Items
+CREATE TABLE {prefix}line_items (
+ id INT NOT NULL AUTO_INCREMENT,
+ invoice INT NOT NULL, -- reference to invoice
+ line_item_type INT NOT NULL, -- reference to line item type
+ name TEXT NOT NULL, -- line item name
+ amount DECIMAL(8,2) DEFAULT '0.00', -- line item amount per item
+ quantity INT DEFAULT 1, -- quantity
+ total DECIMAL(8,2) DEFAULT '0.00', -- line item total
+ recurring BOOLEAN DEFAULT '0', -- true/false if recurring
+ recurrence INT NULL DEFAULT 0, -- recurrence type
+ created DATE NULL, -- Date this line item was first created
+ first_due_date DATE NULL, -- The first due date for this item
+ next_due_date DATE NULL, -- Next Due Date for this item
+ PRIMARY KEY (id),
+ INDEX(account),
+ INDEX(created),
+ INDEX(first_due_date),
+ INDEX(next_due_date)
+);
+
+----
+
+-- payments
+CREATE TABLE {prefix}payments (
+ id INT NOT NULL AUTO_INCREMENT,
+ transaction_time DATETIME NOT NULL, -- datetime of payment
+ account INT NOT NULL, -- ref to account table
+ amount DECIMAL(8, 2) NOT NULL, -- payment amount
+ payment_method TINYTEXT NOT NULL, -- payment method
+ payment_data TINYTEXT NULL, -- additional payment info
+ PRIMARY KEY (id)
+);
+
+----
+
+-- pdfs
+CREATE TABLE {prefix}pdfs (
+ id INT NOT NULL AUTO_INCREMENT,
+ ref_type INT NOT NULL, -- reference type
+ ref_dest INT NOT NULL, -- reference types id
+ pdf MEDIUMTEXT NOT NULL, -- saved pdf
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Notification Types
+CREATE TABLE {prefix}notification_types (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NOT NULL, -- name
+ from_header TINYTEXT NOT NULL, -- from headers
+ replyto TINYTEXT NULL, -- reply-to headers
+ subject TINYTEXT NOT NULL, -- Subject
+ message TEXT NOT NULL, -- Message
+ send_by_date BOOLEAN NULL DEFAULT '0', -- true/false send by date based on due date
+ send_by_action BOOLEAN NULL DEFAULT '0', -- send notice based on an action
+ send_action INT NULL DEFAULT 0, -- (create invoice or receive payment)
+ send_date_number INT NULL DEFAULT 0, -- number to apply to send by date
+ send_date_period INT NULL DEFAULT 0, -- (days,weeks,months,years)
+ send_date_when INT NULL DEFAULT 0, -- (before or after)
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Notifications
+CREATE TABLE {prefix}notifications (
+ id INT NOT NULL AUTO_INCREMENT,
+ notification_type INT NOT NULL, -- ref to notification type
+ account INT NOT NULL, -- ref to account
+ from_replyto TINYTEXT NOT NULL, -- from reply-to header
+ subject TEXT NOT NULL, -- subject
+ message TEXT NOT NULL, -- message
+ date_sent DATETIME NOT NULL, -- Date the notice was sent
+ email_sent TINYTEXT NOT NULL, -- email used
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Notification Queue
+CREATE TABLE {prefix}notification_queue (
+ id INT NOT NULL AUTO_INCREMENT,
+ notification_type INT NOT NULL, -- ref to notification type
+ account INT NOT NULL, -- ref to account
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Gateway Settings
+CREATE TABLE {prefix}gateway_settings (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TEXT NOT NULL,
+ login_id TINYTEXT NOT NULL,
+ transaction_key TINYTEXT NOT NULL,
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Invoice Payments
+CREATE TABLE {prefix}invoice_payments (
+ id INT NOT NULL AUTO_INCREMENT,
+ invoice INT NOT NULL, -- reference to invoice id
+ payment INT NOT NULL, -- reference to payment id
+ amount DECIMAL(8, 2) NOT NULL, -- payment amount
+ PRIMARY KEY (id),
+ INDEX(invoice)
+);
+
+----
+
+-- Settings
+CREATE TABLE {prefix}settings (
+ id INT NOT NULL AUTO_INCREMENT,
+ 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_renewal INT NULL, -- Number of days before renewal date to allow renewals
+ 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
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Settings entry
+INSERT INTO {prefix}settings
+ ( id, days_before_renewal ,days_after_expired )
+ VALUES
+ ( 1, 90, 30 );
+
+----
+
+-- Management
+CREATE TABLE {prefix}management (
+ id INT NOT NULL AUTO_INCREMENT,
+ payment_methods SMALLINT NULL, -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
+ proc_methods SMALLINT NULL, -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
+ cc_accepts SMALLINT NULL, -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
+ -- Authorize.net Credentials
+ authorize_net_login TINYTEXT NULL,
+ authorize_net_key TINYTEXT NULL,
+ authorize_net_test TINYINT NULL, -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
+ authorize_net_conf BOOLEAN NULL, -- Flag to send payment confirmation Email from Authorize.net
+ authorize_net_merchant_email TINYTEXT NULL, -- E-Mail Authorize.net will send copy of confirmation E-Mail
+ -- Merchant Solutions Credentials
+ merchant_solutions_acctid TINYTEXT NULL, -- Merchant Solutions credentials
+ merchant_solutions_merchantpin TINYTEXT NULL,
+ merchant_solutions_test TINYINT NULL, -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
+ merchant_solutions_conf BOOLEAN NULL, -- Flag to send payment confirmation Email
+ merchant_solutions_merchant_email TINYTEXT NULL, -- Merchant Solutions will send copy of confirmation E-Mail
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Management entry
+INSERT INTO {prefix}management
+ ( id )
+ VALUES
+ ( 1 );
'0.0.14' => array('version' => '0.0.14', 'tables' => 14),
'0.0.15' => array('version' => '0.0.15', 'tables' => 14),
'0.0.16' => array('version' => '0.0.16', 'tables' => 14),
+ '0.0.17' => array('version' => '0.0.17', 'tables' => 14),
);
--- /dev/null
+-- Gaslight Media Billing Database
+-- File Created: 03/28/2018
+-- Database Version: 0.0.15
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Update the settings
+ALTER TABLE {prefix}settings ADD allow_membership_choice BOOLEAN DEFAULT '0'; -- If memberships can choose their membership levels when they renew
+
+----
+
+-- Update the settings
+ALTER TABLE {prefix}settings ADD allow_employees BOOLEAN DEFAULT '0'; -- If memberships have employees
Membership Class
</div>
<div class="glm-billing-input">
- <label>
+ {if $settings.allow_membership_choice}
{foreach $payable_types as $type}
<label>
<input type="radio" name="member_renewing" data-amount="{$type.amount}" value="{$type.id}"
{$type.name} {$type.amount}
</label>
{/foreach}
- </label>
+ {else}
+ <input type="hidden" name="member_renewing" data-amount="{$member_invoice.amount}" value="{$member_invoice.id}" />
+ {$member_invoice.name} {$member_invoice.amount}
+ {/if}
</div>
</div>
{/if}
// Calculate the total for this page.
// Get the member_renewing amount.
- var member_renewing_amount = parseFloat( $('input[name=member_renewing]:checked').data('amount') );
+ if ( $('input[name=member_renewing]:checked').length ) {
+ var member_renewing_amount = parseFloat( $('input[name=member_renewing]:checked').data('amount') );
+ } else {
+ var member_renewing_amount = parseFloat( $('input[name=member_renewing]').data('amount') );
+ }
+ console.log( member_renewing_amount );
+
// Get each employee and add their amounts.
$('input[name^=employees]').each(function(){
<input type="hidden" name="option2" value="submit">
<table class="glm-admin-table">
+ <tr>
+ <th style="text-align: right;" {if $billingSettings.fieldRequired.allow_membership_choice} class="glm-required"}{/if}>
+ Allow Membership Choice When renewing
+ </th>
+ <td>
+ <input type="checkbox" name="allow_membership_choice"{if $billingSettings.fieldData.allow_membership_choice.value} checked="checked"{/if}>
+ </td>
+ </tr>
+
+ <tr>
+ <th style="text-align: right;" {if $billingSettings.fieldRequired.allow_employees} class="glm-required"}{/if}>
+ Allow Employees
+ </th>
+ <td>
+ <input type="checkbox" name="allow_employees"{if $billingSettings.fieldData.allow_employees.value} checked="checked"{/if}>
+ </td>
+ </tr>
+
<tr>
<th style="text-align: right;" {if $billingSettings.fieldRequired.days_before_renewal} class="glm-required"}{/if}>
Membership Class
</div>
<div class="glm-billing-input">
- <label>
+ {if $settings.allow_membership_choice}
{foreach $payable_types as $type}
<label>
<input type="radio" name="member_renewing" data-amount="{$type.amount}" value="{$type.id}"
{$type.name} {$type.amount}
</label>
{/foreach}
- </label>
+ {else}
+ <input type="hidden" name="member_renewing" data-amount="{$member_invoice.amount}" value="{$member_invoice.id}" />
+ {$member_invoice.name} {$member_invoice.amount}
+ {/if}
</div>
</div>
{/if}
// Calculate the total for this page.
// Get the member_renewing amount.
- var member_renewing_amount = parseFloat( $('input[name=member_renewing]:checked').data('amount') );
+ if ( $('input[name=member_renewing]:checked').length ) {
+ var member_renewing_amount = parseFloat( $('input[name=member_renewing]:checked').data('amount') );
+ } else {
+ var member_renewing_amount = parseFloat( $('input[name=member_renewing]').data('amount') );
+ }
// Get each employee and add their amounts.
$('input[name^=employees]').each(function(){