working with more ui elemnents and bring in management
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 18 Jul 2019 20:54:21 +0000 (16:54 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 18 Jul 2019 20:54:21 +0000 (16:54 -0400)
Bringing in management to the billing side.

13 files changed:
classes/data/dataManagement.php
models/admin/billing/management.php [new file with mode: 0644]
models/admin/billing/settings.php
setup/standardTemplateParams.php [new file with mode: 0644]
setup/validActions.php
views/admin/billing/accountSearchForm.html
views/admin/billing/editInvoiceType.html
views/admin/billing/editNotificationType.html
views/admin/billing/header.html
views/admin/billing/invoiceTypes.html
views/admin/billing/management.html [new file with mode: 0644]
views/admin/billing/notifications.html
views/admin/billing/settings.html

index 673b503..1493018 100644 (file)
@@ -160,8 +160,8 @@ class GlmDataBillingManagement extends GlmDataAbstract
             'authorize_net_test' => array (
                 'field'   => 'authorize_net_test',
                 'type'    => 'list',
-                'list'    => $this->config['proc_test_mode'],
-                'default' => $this->config['proc_test_mode_numb']['Local Approval Test'],
+                'list'    => $this->config['billing_proc_test_mode'],
+                'default' => $this->config['billing_proc_test_mode_numb']['Local Approval Test'],
                 'use'     => 'a'
             ),
 
@@ -198,8 +198,8 @@ class GlmDataBillingManagement extends GlmDataAbstract
             'merchant_solutions_test' => array (
                 'field'   => 'merchant_solutions_test',
                 'type'    => 'list',
-                'list'    => $this->config['proc_test_mode'],
-                'default' => $this->config['proc_test_mode_numb']['Local Approval Test'],
+                'list'    => $this->config['billing_proc_test_mode'],
+                'default' => $this->config['billing_proc_test_mode_numb']['Local Approval Test'],
                 'use'     => 'a'
             ),
 
diff --git a/models/admin/billing/management.php b/models/admin/billing/management.php
new file mode 100644 (file)
index 0000000..1ec0c00
--- /dev/null
@@ -0,0 +1,293 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members DB - Billing Add-on - Management Billing Tab
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author     Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  billing.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+// Load Management Billing data abstract
+require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH.'/data/dataManagement.php';
+
+/**
+ * GlmMembersAdmin_management_billing
+ *
+ * PHP version 5
+ *
+ * @category Model
+ * @package GLM Member DB
+ * @author    Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *            @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott
+ *            Exp $
+ */
+class GlmMembersAdmin_billing_management extends GlmDataBillingManagement
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * dbh Postgres database connection
+     *
+     * @var mixed
+     * @access public
+     */
+    public $config;
+    /**
+     * settings used for the schema and tablenames
+     *
+     * @var mixed
+     * @access public
+     */
+//    public $settings = array();
+//    /**
+//     * billing
+//     *
+//     * @var bool
+//     * @access public
+//     */
+//    public $billing = array();
+
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+        parent::__construct(false, false);
+
+    }
+
+    /**
+     * modelAction
+     *
+     * @param bool $actionData
+     * @access public
+     * @return void
+     */
+    public function modelAction( $actionData = false )
+    {
+
+        $option              = false;
+        $settingsUpdated     = false;
+        $settingsUpdateError = false;
+        $regSettings         = false;
+        $view                = 'management';
+        $importResults       = false;
+        $totalImports        = false;
+        $numberProcessed     = false;
+        $totalMembers        = false;
+
+        // Enqueue GLMA Foundation
+        wp_enqueue_style( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/css/foundation-6.min.css' );
+        wp_enqueue_script( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/js/foundation-6.min.js' );
+
+        // echo '<pre>Config: ' . print_r( $this->config, true ) . '</pre>';
+        // General settings are always stored in a record with ID=1.
+        $id = 1;
+
+        // Determine if current user can edit configurations
+        if ( !current_user_can( 'glm_members_management' ) ) {
+            return array(
+                'status'           => false,
+                'menuItemRedirect' => 'error',
+                'modelRedirect'    => 'index',
+                'view'             => 'admin/error/index.html',
+                'data'             => array(
+                    'reason' => 'User does not have rights to make configuration changes.'
+                )
+            );
+        }
+
+        // Check for submission option
+        $option = '';
+        if ( isset( $_REQUEST['option'] ) ) {
+            $option = $_REQUEST['option'];
+        }
+
+        if ( !isset( $option ) ) {
+            $option = '';
+        }
+
+        switch( $option ) {
+
+            // Update the settings and redisplay the form
+            case 'submit':
+
+                // Update the general settings
+                $regSettings = $this->updateEntry( $id );
+
+                // Check if we were successful
+                if ( $regSettings['status'] ) {
+
+                    $settingsUpdated = true;
+                    $regSettings     = $this->editEntry( $id );
+
+                } else {
+                    $settingsUpdateError = true;
+                }
+
+                break;
+
+            case 'verifyBillingData':
+                $view = 'verifyBillingData';
+                if ( isset( $_REQUEST['option2'] ) ) {
+                    $option2 = $_REQUEST['option2'];
+                }
+                if ( !isset( $option2 ) ) {
+                    $option2 = '';
+                }
+                switch ( $option2 ) {
+                case 'verify':
+                    require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/verifyBillingData.php';
+                    // die('here');
+                    break;
+                default:
+                    break;
+                }
+                break;
+
+            case 'importBillingData':
+                $view = 'importBillingData';
+                if ( isset( $_REQUEST['option2'] ) ) {
+                    $option2 = $_REQUEST['option2'];
+                }
+                if ( !isset( $option2 ) ) {
+                    $option2 = '';
+                }
+                switch ( $option2 ) {
+                case 'import':
+                    require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/importBillingData.php';
+                    // die('here');
+                    break;
+                default:
+                    break;
+                }
+                break;
+
+            case 'importAccounts':
+                $view = 'importAccounts';
+                if ( isset( $_REQUEST['option2'] ) ) {
+                    $option2 = $_REQUEST['option2'];
+                }
+                if ( !isset( $option2 ) ) {
+                    $option2 = '';
+                }
+                switch ( $option2 ) {
+                case 'import':
+                    require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/importAccounts.php';
+                    break;
+                default:
+                    break;
+                }
+                break;
+
+            case 'createInvoices':
+                $view = 'createInvoices';
+                if ( isset( $_REQUEST['option2'] ) ) {
+                    $option2 = $_REQUEST['option2'];
+                }
+                if ( !isset( $option2 ) ) {
+                    $option2 = '';
+                }
+                switch ( $option2 ) {
+                case 'create':
+                    require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/createInvoices.php';
+                    break;
+                default:
+                    break;
+                }
+                break;
+
+            // Default is to get the current settings and display the form
+            default:
+
+                // Try to get the first (should be only) entry for general settings.
+                $regSettings = $this->editEntry( $id );
+
+                // Check if we didn't get the settings
+                if ($regSettings === false) {
+
+                    $errorMsg = "Unable to load the Billing management settings";
+
+                    trigger_error($errorMsg, E_USER_NOTICE);
+
+                    return array(
+                        'status'           => false,
+                        'menuItemRedirect' => 'error',
+                        'modelRedirect'    => 'index',
+                        'view'             => 'admin/error/index.html',
+                        'data'             => array(
+                            'reason' => $errorMsg
+                        )
+                    );
+                }
+
+                break;
+
+        }
+
+        // Compile template data
+        $template_data = array(
+            'regSettings'         => $regSettings,
+            'settingsUpdated'     => $settingsUpdated,
+            'settingsUpdateError' => $settingsUpdateError,
+            'option'              => $option,
+            'importResults'       => $importResults,
+            'totalImports'        => $totalImports,
+            'numberProcessed'     => $numberProcessed,
+            'start'               => ( isset( $start ) ? $start : false ),
+            'totalMembers'        => $totalMembers,
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status'           => true,
+            'menuItemRedirect' => false,
+            'modelRedirect'    => false,
+            'view'             => 'admin/billing/' . $view . '.html',
+            'data'             => $template_data
+        );
+    }
+}
index cfb6758..79d6e7e 100644 (file)
@@ -110,7 +110,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings
         $option2               = false;
         $enable_members        = $this->config['settings']['enable_members'];
 
-        if (isset($_REQUEST['option'])) {
+        if ( isset( $_REQUEST['option'] ) ) {
             $option = $_REQUEST['option'];
         }
 
@@ -118,7 +118,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings
         wp_enqueue_style( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/css/foundation-6.min.css' );
         wp_enqueue_script( 'Foundation6', GLM_MEMBERS_PLUGIN_URL . '/js/foundation-6.min.js' );
 
-        switch ($option) {
+        switch ( $option ) {
 
             case 'settings':
 
@@ -142,11 +142,11 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings
 
                 // Check for submission option
                 $option2 = '';
-                if (isset($_REQUEST['option2'])) {
+                if ( isset( $_REQUEST['option2'] ) ) {
                     $option2 = $_REQUEST['option2'];
                 }
 
-                switch($option2) {
+                switch ( $option2 ) {
 
                     // Update the settings and redisplay the form
                     case 'submit':
@@ -164,7 +164,7 @@ class GlmMembersAdmin_billing_settings extends GlmDataBillingSettings
 
                         // Update the billing settings settings
                         $billing_settings = $this->updateEntry(1);
-                        if ($billing_settings['status']) {
+                        if ( $billing_settings['status'] ) {
                             $settings_updated = true;
                         } else {
                             $settings_update_error = true;
diff --git a/setup/standardTemplateParams.php b/setup/standardTemplateParams.php
new file mode 100644 (file)
index 0000000..d91438f
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members DB - Main Mmebers Add-on - Standard Template Parameters
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link     http://dev.gaslightmedia.com/
+ */
+
+/*
+ * Standard template parameters available to all templates
+ *
+ * This file is "required" by both the front and admin controllers
+ * inside the controller() function. As such, this runs in the
+ * context of those controllers.
+ *
+ */
+
+// Common to both admin and front-end
+$smarty->templateAssign('glmPluginName', GLM_MEMBERS_BILLING_PLUGIN_NAME );
+
+if ( current_user_can( 'glm_members_management' ) ) {
+    $smarty->templateAssign('glmMemberManager', true);
+} else {
+    $smarty->templateAssign('glmMemberManager', false);
+}
index 9bc8f6f..f75376a 100644 (file)
@@ -100,6 +100,7 @@ $glmMembersBillingAddOnValidActions = array(
             'settings'      => GLM_MEMBERS_BILLING_PLUGIN_SLUG,
             'invoiceTypes'  => GLM_MEMBERS_BILLING_PLUGIN_SLUG,
             'notifications' => GLM_MEMBERS_BILLING_PLUGIN_SLUG,
+            'management'    => GLM_MEMBERS_BILLING_PLUGIN_SLUG,
         ),
         'member' => array(
             'billing' => GLM_MEMBERS_BILLING_PLUGIN_SLUG,
index 4e50188..121ace2 100644 (file)
@@ -89,18 +89,18 @@ jQuery(document).ready(function($) {
 
                 <div class="cell small-12 medium-3">
                     <label>Member Account:</label>
-                    <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
+                    <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}" />
                     <input id="account_name" type="text" name="searchName" value="{if $searchName}{$searchName}{/if}" />
                 </div>
 
                 <div class="cell small-12 medium-3">
                     <label>From Date: </label>
-                    <input type="text" name="fromDate" value="{$fromDate}" class="glm-date-input">
+                    <input type="text" name="fromDate" value="{$fromDate}" class="glm-date-input" />
                 </div>
 
                 <div class="cell small-12 medium-3">
                     <label>To Date: </label>
-                    <input type="text" name="toDate" value="{$toDate}" class="glm-date-input">
+                    <input type="text" name="toDate" value="{$toDate}" class="glm-date-input" />
                 </div>
 
                 <div class="cell small-12 medium-3">
index 0afdae7..b3ae16b 100644 (file)
 ]}
 {include file='ui/f6/grid-start.html'}
 
-    {* Set $data to $invoiceType *}
-    {* This is for using the UI elements *}
-    {$data = $invoiceType}
-
-    {* Invoice Type Updated *}
-    {$ui = [
-        'label'  => 'Invoice Type Updated',
-        'active' => $invoiceTypeUpdated,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Invoice Type Added *}
-    {$ui = [
-        'label'  => 'Invoice Type Added',
-        'active' => $invoiceTypeAdded,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Invoice Type Update Error *}
-    {$ui = [
-        'label'  => 'Invoice Type Update Error',
-        'active' => $invoiceTypeUpdateError,
-        'type'   => 'alert'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Invoice Type Insert Error *}
-    {$ui = [
-        'label'  => 'Invoice Type Added',
-        'active' => $invoiceTypeAdded,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Form Start *}
-    {$ui = [
-        'id'     => 'billing-invoice-type-form',
-        'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes",
-        'method' => 'post',
-        'file'   => false
-    ]}
-    {include file="ui/f6/form-start.html"}
-
-    {* Callout Errors *}
-    {include file='ui/f6/errorCallout.html'}
-
-    <input type="hidden" name="glm_action" value="invoiceTypes">
-
-    {if isset($data.fieldData.id)}
-        <input type="hidden" name="option" value="update">
-        <input id="edit-id" type="hidden" name="id" value="{$data.fieldData.id}">
-    {else}
-        <input type="hidden" name="option" value="addNew">
-    {/if}
-
-    <div class="grid-x grid-margin-x">
-
-        <fieldset class="fieldset cell small-12 medium-6">
-            <legend>Invoice Type</legend>
-
-            <div class="grid-x grid-margin-x">
-
-                {* Invoice Type Name *}
-                {$ui = [
-                    'value'       => $data.fieldData.name,
-                    'field'       => 'name',
-                    'label'       => 'Invoice Type Name',
-                    'required'    => $data.fieldRequired.name,
-                    'errorText'   => 'Invoice Type Name is Required',
-                    'dataError'   => $data.fieldFail.name
-                ]}
-                {include file='ui/f6/text.html'}
-
-                {* Parent *}
-                {$ui = [
-                    'value'     => $data.fieldData.parent.value,
-                    'field'     => 'parent',
-                    'label'     => 'Parent',
-                    'list'      => $invoiceTypes,
-                    'l_label'   => 'name',
-                    'l_value'   => 'id',
-                    'l_blank'   => true,
-                    'required'  => $data.fieldRequired.parent,
-                    'errorText' => 'Parent is Required',
-                    'dataError' => $data.fieldFail.parent
-                ]}
-                {include file='ui/f6/select.html'}
-
-                {* Member Type *}
-                {$ui = [
-                    'value'     => $data.fieldData.member_type.value,
-                    'field'     => 'member_type',
-                    'label'     => 'Member Type',
-                    'list'      => $memberTypes,
-                    'l_label'   => 'name',
-                    'l_value'   => 'id',
-                    'l_blank'   => true,
-                    'required'  => $data.fieldRequired.member_type,
-                    'errorText' => 'Member Type is Required',
-                    'dataError' => $data.fieldFail.member_type
-                ]}
-                {include file='ui/f6/select.html'}
-
-                {* Amount *}
-                {$ui = [
-                    'value'       => $data.fieldData.amount,
-                    'field'       => 'amount',
-                    'label'       => 'Amount',
-                    'pattern'     => 'number',
-                    'required'    => $data.fieldRequired.amount,
-                    'errorText'   => 'Amount is Required',
-                    'dataError'   => $data.fieldFail.amount
-                ]}
-                {include file='ui/f6/text.html'}
-
-                {* Dynamic Amount *}
-                {$ui = [
-                    'value'     => $data.fieldData.dynamic_amount.value,
-                    'field'     => 'dynamic_amount',
-                    'label'     => 'Dynamic Amount',
-                    'required'  => $data.fieldRequired.dynamic_amount,
-                    'errortext' => 'Dynamic Amount is Required',
-                    'helpText'  => 'Ask for the amount on Invoice Form',
-                    'dataError' => $data.fieldFail.dynamic_amount
-                ]}
-                {include file='ui/f6/checkbox.html'}
-
-                {* Recurring *}
-                {$ui = [
-                    'value'     => $data.fieldData.recurring.value,
-                    'field'     => 'recurring',
-                    'label'     => 'Recurring',
-                    'required'  => $data.fieldRequired.recurring,
-                    'errortext' => 'Recurring is Required',
-                    'dataError' => $data.fieldFail.recurring
-                ]}
-                {include file='ui/f6/checkbox.html'}
-
-                {* Recurrence *}
-                {$ui = [
-                    'value'     => $data.fieldData.recurrence,
-                    'field'     => 'recurrence',
-                    'label'     => 'Recurrence',
-                    'list'      => $recurrenceTypes,
-                    'l_blank'   => true,
-                    'required'  => $data.fieldRequired.recurrence,
-                    'errorText' => 'Recurrence is Required',
-                    'dataError' => $data.fieldFail.recurrence
-                ]}
-                {include file='ui/f6/select.html'}
-
-
-                {* Code *}
-                {$ui = [
-                    'value'       => $data.fieldData.qcode,
-                    'field'       => 'qcode',
-                    'label'       => 'Code',
-                    'required'    => $data.fieldRequired.qcode,
-                    'errorText'   => 'Code is Required',
-                    'dataError'   => $data.fieldFail.qcode
-                ]}
-                {include file='ui/f6/text.html'}
-
-                {* Category *}
-                {$ui = [
-                    'value'       => $data.fieldData.category,
-                    'field'       => 'category',
-                    'label'       => 'Category',
-                    'required'    => $data.fieldRequired.category,
-                    'errorText'   => 'Category is Required',
-                    'dataError'   => $data.fieldFail.category
-                ]}
-                {include file='ui/f6/text.html'}
-
-            </div>
-
-        </fieldset>
-
-    </div>
-
-    <button class="button primary" type="submit">{if isset( $data.fieldData.id )}Update{else}Add{/if} Invoice Type</button>
-
-    {include file='ui/f6/errorCallout.html'}
-
-
-    {include file='ui/f6/form-end.html'}
+{* Set $data to $invoiceType *}
+{* This is for using the UI elements *}
+{$data = $invoiceType}
+
+{* Invoice Type Updated *}
+{$ui = [
+    'label'  => 'Invoice Type Updated',
+    'active' => $invoiceTypeUpdated,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Invoice Type Added *}
+{$ui = [
+    'label'  => 'Invoice Type Added',
+    'active' => $invoiceTypeAdded,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Invoice Type Update Error *}
+{$ui = [
+    'label'  => 'Invoice Type Update Error',
+    'active' => $invoiceTypeUpdateError,
+    'type'   => 'alert'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Invoice Type Insert Error *}
+{$ui = [
+    'label'  => 'Invoice Type Added',
+    'active' => $invoiceTypeAdded,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Form Start *}
+{$ui = [
+    'id'     => 'billing-invoice-type-form',
+    'action' => "{$thisUrl}?page={$thisPage}&glm_action==invoiceTypes",
+    'method' => 'post',
+    'file'   => false
+]}
+{include file="ui/f6/form-start.html"}
+
+{* Callout Errors *}
+{include file='ui/f6/errorCallout.html'}
+
+<input type="hidden" name="glm_action" value="invoiceTypes">
+
+{if isset($data.fieldData.id)}
+    <input type="hidden" name="option" value="update">
+    <input id="edit-id" type="hidden" name="id" value="{$data.fieldData.id}">
+{else}
+    <input type="hidden" name="option" value="addNew">
+{/if}
+
+<div class="grid-x grid-margin-x">
+
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Invoice Type</legend>
+
+        <div class="grid-x grid-margin-x">
+
+            {* Invoice Type Name *}
+            {$ui = [
+                'value'       => $data.fieldData.name,
+                'field'       => 'name',
+                'label'       => 'Invoice Type Name',
+                'required'    => $data.fieldRequired.name,
+                'errorText'   => 'Invoice Type Name is Required',
+                'dataError'   => $data.fieldFail.name
+            ]}
+            {include file='ui/f6/text.html'}
+
+            {* Parent *}
+            {$ui = [
+                'value'     => $data.fieldData.parent.value,
+                'field'     => 'parent',
+                'label'     => 'Parent',
+                'list'      => $invoiceTypes,
+                'l_label'   => 'name',
+                'l_value'   => 'id',
+                'l_blank'   => true,
+                'required'  => $data.fieldRequired.parent,
+                'errorText' => 'Parent is Required',
+                'dataError' => $data.fieldFail.parent
+            ]}
+            {include file='ui/f6/select.html'}
+
+            {* Member Type *}
+            {$ui = [
+                'value'     => $data.fieldData.member_type.value,
+                'field'     => 'member_type',
+                'label'     => 'Member Type',
+                'list'      => $memberTypes,
+                'l_label'   => 'name',
+                'l_value'   => 'id',
+                'l_blank'   => true,
+                'required'  => $data.fieldRequired.member_type,
+                'errorText' => 'Member Type is Required',
+                'dataError' => $data.fieldFail.member_type
+            ]}
+            {include file='ui/f6/select.html'}
+
+            {* Amount *}
+            {$ui = [
+                'value'       => $data.fieldData.amount,
+                'field'       => 'amount',
+                'label'       => 'Amount',
+                'pattern'     => 'number',
+                'required'    => $data.fieldRequired.amount,
+                'errorText'   => 'Amount is Required',
+                'dataError'   => $data.fieldFail.amount
+            ]}
+            {include file='ui/f6/text.html'}
+
+            {* Dynamic Amount *}
+            {$ui = [
+                'value'     => $data.fieldData.dynamic_amount.value,
+                'field'     => 'dynamic_amount',
+                'label'     => 'Dynamic Amount',
+                'required'  => $data.fieldRequired.dynamic_amount,
+                'errortext' => 'Dynamic Amount is Required',
+                'helpText'  => 'Ask for the amount on Invoice Form',
+                'dataError' => $data.fieldFail.dynamic_amount
+            ]}
+            {include file='ui/f6/checkbox.html'}
+
+            {* Recurring *}
+            {$ui = [
+                'value'     => $data.fieldData.recurring.value,
+                'field'     => 'recurring',
+                'label'     => 'Recurring',
+                'required'  => $data.fieldRequired.recurring,
+                'errortext' => 'Recurring is Required',
+                'dataError' => $data.fieldFail.recurring
+            ]}
+            {include file='ui/f6/checkbox.html'}
+
+            {* Recurrence *}
+            {$ui = [
+                'value'     => $data.fieldData.recurrence,
+                'field'     => 'recurrence',
+                'label'     => 'Recurrence',
+                'list'      => $recurrenceTypes,
+                'l_blank'   => true,
+                'required'  => $data.fieldRequired.recurrence,
+                'errorText' => 'Recurrence is Required',
+                'dataError' => $data.fieldFail.recurrence
+            ]}
+            {include file='ui/f6/select.html'}
+
+
+            {* Code *}
+            {$ui = [
+                'value'       => $data.fieldData.qcode,
+                'field'       => 'qcode',
+                'label'       => 'Code',
+                'required'    => $data.fieldRequired.qcode,
+                'errorText'   => 'Code is Required',
+                'dataError'   => $data.fieldFail.qcode
+            ]}
+            {include file='ui/f6/text.html'}
+
+            {* Category *}
+            {$ui = [
+                'value'       => $data.fieldData.category,
+                'field'       => 'category',
+                'label'       => 'Category',
+                'required'    => $data.fieldRequired.category,
+                'errorText'   => 'Category is Required',
+                'dataError'   => $data.fieldFail.category
+            ]}
+            {include file='ui/f6/text.html'}
+
+        </div>
+
+    </fieldset>
+
+</div>
+
+<button class="button primary" type="submit">{if isset( $data.fieldData.id )}Update{else}Add{/if} Invoice Type</button>
+
+{include file='ui/f6/errorCallout.html'}
+
+
+{include file='ui/f6/form-end.html'}
 
 {include file='ui/f6/grid-end.html'}
 {* </div> *}
         })
         // form validation failed
         .on('forminvalid.zf.abide', function( ev, frm ) {
-            ev.preventDefault();
-            console.log( 'Form is not valid' );
+            //ev.preventDefault();
+            //console.log( 'Form is not valid' );
         })
         // form validation passed
         .on('formvalid.zf.abide', function( ev, frm ) {
-            ev.preventDefault();
-            console.log( 'Form is valid' );
+            //ev.preventDefault();
+            //console.log( 'Form is valid' );
         })
         // to preven form from submitting upon successful validation
         .on('submit', function( ev ) {
-            ev.preventDefault();
-            console.log( 'Submit for form intercepted' );
+            //ev.preventDefault();
+            //console.log( 'Submit for form intercepted' );
         });
     });
 </script>
index 840971b..4ecd3eb 100644 (file)
 
 {include file='admin/billing/header.html'}
 
-<div class="callout grid-container">
-
-    {* Set $data to $notification *}
-    {* This is for using the UI elements *}
-    {$data = $notification}
-
-    {* Notification Updated *}
-    {$ui = [
-        'label'  => 'Notification Updated',
-        'active' => $notificationUpdated,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Notification Added *}
-    {$ui = [
-        'label'  => 'Notification Added',
-        'active' => $notificationAdded,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Notification Update Error *}
-    {$ui = [
-        'label'  => 'Notification Update Error',
-        'active' => $notificationUpdateError,
-        'type'   => 'alert'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    {* Notification Insert Error *}
-    {$ui = [
-        'label'  => 'Notification Added',
-        'active' => $notificationAdded,
-        'type'   => 'success'
-    ]}
-    {include file="ui/f6/callout.html"}
-
-    <form action="{$thisUrl}?page={$thisPage}&glm_action=notifications" method="post" data-abide novalidate>
-        {if $notification_id}
-            <input type="hidden" name="option" value="update">
-            <input type="hidden" name="id" value="{$notification_id}">
-        {else}
-            <input type="hidden" name="option" value="insert">
-        {/if}
-
-        {include file='ui/f6/errorCallout.html'}
-
-        <div class="grid-container">
-            <div class="grid-x grid-margin-x">
-
-                <fieldset class="fieldset cell small-12 medium-6">
-                    <legend>Notification</legend>
-
-                        {* Name *}
-                        {$ui = [
-                            'value'       => $data.fieldData.name,
-                            'field'       => 'name',
-                            'label'       => 'Name',
-                            'required'    => $data.fieldRequired.name,
-                            'errorText'   => 'Name is Required',
-                            'dataError'   => $data.fieldFail.name
-                        ]}
-                        {include file='ui/f6/text.html'}
-
-                        <div class="grid-x grid-margin-x">
-                            <div class="cell small-12">
-                                <span class="label">Send Notification based on</span>
-                            </div>
+{$ui = [
+    'nowrap'          => false,
+    'backgroundColor' => '',
+    'sectionColor'    => ''
+]}
+{include file='ui/f6/grid-start.html'}
+
+{* <div class="callout grid-container"> *}
+
+{* Set $data to $notification *}
+{* This is for using the UI elements *}
+{$data = $notification}
+
+{* Notification Updated *}
+{$ui = [
+    'label'  => 'Notification Updated',
+    'active' => $notificationUpdated,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Notification Added *}
+{$ui = [
+    'label'  => 'Notification Added',
+    'active' => $notificationAdded,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Notification Update Error *}
+{$ui = [
+    'label'  => 'Notification Update Error',
+    'active' => $notificationUpdateError,
+    'type'   => 'alert'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Notification Insert Error *}
+{$ui = [
+    'label'  => 'Notification Added',
+    'active' => $notificationAdded,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+<form action="{$thisUrl}?page={$thisPage}&glm_action=notifications" method="post" data-abide novalidate>
+    {if $notification_id}
+        <input type="hidden" name="option" value="update">
+        <input type="hidden" name="id" value="{$notification_id}">
+    {else}
+        <input type="hidden" name="option" value="insert">
+    {/if}
+
+    {include file='ui/f6/errorCallout.html'}
+
+    <div class="grid-container">
+        <div class="grid-x grid-margin-x">
+
+            <fieldset class="fieldset cell small-12 medium-6">
+                <legend>Notification</legend>
+
+                    {* Name *}
+                    {$ui = [
+                        'value'       => $data.fieldData.name,
+                        'field'       => 'name',
+                        'label'       => 'Name',
+                        'required'    => $data.fieldRequired.name,
+                        'errorText'   => 'Name is Required',
+                        'dataError'   => $data.fieldFail.name
+                    ]}
+                    {include file='ui/f6/text.html'}
+
+                    <div class="grid-x grid-margin-x">
+                        <div class="cell small-12">
+                            <span class="label">Send Notification based on</span>
                         </div>
-
-                        <div class="grid-x grid-margin-x">
-                            <div class="cell small-12">
-                                <div class="grid-x grid-margin-x">
-                                    <div class="cell small-12 medium-shrink">
-                                        <label>Renewal Date</label>
-                                        <div class="switch">
-                                            <input class="switch-input" type="radio" id="send_by1" name="send_by" value="date" required{if $notification.fieldData.send_by_date.value} checked{/if}>
-                                            <label class="switch-paddle" for="send_by1"><span class="show-for-sr">Date</span></label>
-                                        </div>
-                                    </div>
-                                    <div class="cell small-12 medium-auto">
-                                        {* Number *}
-                                        {$ui = [
-                                            'value'       => $data.fieldData.send_date_number,
-                                            'field'       => 'send_date_number',
-                                            'label'       => 'Number',
-                                            'pattern'     => 'number',
-                                            'required'    => $data.fieldRequired.send_date_number,
-                                            'errorText'   => 'Number is Required to be numeric',
-                                            'dataError'   => $data.fieldFail.send_date_number
-                                        ]}
-                                        {include file='ui/f6/text.html'}
-                                    </div>
-                                    <div class="cell small-12 medium-auto">
-                                        {* Period *}
-                                        {$ui = [
-                                            'value'     => $data.fieldData.send_date_period,
-                                            'field'     => 'send_date_period',
-                                            'label'     => 'Period',
-                                            'list'      => $send_date_period,
-                                            'l_blank'   => false,
-                                            'required'  => $data.fieldRequired.send_date_period,
-                                            'errorText' => 'Period is Required',
-                                            'dataError' => $data.fieldFail.send_date_period
-                                        ]}
-                                        {include file='ui/f6/select.html'}
-                                    </div>
-                                    <div class="cell small-12 medium-auto">
-                                        {* When *}
-                                        {$ui = [
-                                            'value'     => $data.fieldData.send_date_when,
-                                            'field'     => 'send_date_when',
-                                            'label'     => 'When',
-                                            'list'      => $send_date_when,
-                                            'l_blank'   => false,
-                                            'required'  => $data.fieldRequired.send_date_when,
-                                            'errorText' => 'When is Required',
-                                            'dataError' => $data.fieldFail.send_date_when
-                                        ]}
-                                        {include file='ui/f6/select.html'}
+                    </div>
+
+                    <div class="grid-x grid-margin-x">
+                        <div class="cell small-12">
+                            <div class="grid-x grid-margin-x">
+                                <div class="cell small-12 medium-shrink">
+                                    <label>Renewal Date</label>
+                                    <div class="switch">
+                                        <input class="switch-input" type="radio" id="send_by1" name="send_by" value="date" required{if $notification.fieldData.send_by_date.value} checked{/if}>
+                                        <label class="switch-paddle" for="send_by1"><span class="show-for-sr">Date</span></label>
                                     </div>
                                 </div>
+                                <div class="cell small-12 medium-auto">
+                                    {* Number *}
+                                    {$ui = [
+                                        'value'       => $data.fieldData.send_date_number,
+                                        'field'       => 'send_date_number',
+                                        'label'       => 'Number',
+                                        'pattern'     => 'number',
+                                        'required'    => $data.fieldRequired.send_date_number,
+                                        'errorText'   => 'Number is Required to be numeric',
+                                        'dataError'   => $data.fieldFail.send_date_number
+                                    ]}
+                                    {include file='ui/f6/text.html'}
+                                </div>
+                                <div class="cell small-12 medium-auto">
+                                    {* Period *}
+                                    {$ui = [
+                                        'value'     => $data.fieldData.send_date_period,
+                                        'field'     => 'send_date_period',
+                                        'label'     => 'Period',
+                                        'list'      => $send_date_period,
+                                        'l_blank'   => false,
+                                        'required'  => $data.fieldRequired.send_date_period,
+                                        'errorText' => 'Period is Required',
+                                        'dataError' => $data.fieldFail.send_date_period
+                                    ]}
+                                    {include file='ui/f6/select.html'}
+                                </div>
+                                <div class="cell small-12 medium-auto">
+                                    {* When *}
+                                    {$ui = [
+                                        'value'     => $data.fieldData.send_date_when,
+                                        'field'     => 'send_date_when',
+                                        'label'     => 'When',
+                                        'list'      => $send_date_when,
+                                        'l_blank'   => false,
+                                        'required'  => $data.fieldRequired.send_date_when,
+                                        'errorText' => 'When is Required',
+                                        'dataError' => $data.fieldFail.send_date_when
+                                    ]}
+                                    {include file='ui/f6/select.html'}
+                                </div>
                             </div>
-                            <div class="cell small-12">
-                                <div class="grid-x grid-margin-x">
-                                    <div class="cell small-12 medium-shrink">
-                                        <label>Immediate Action</label>
-                                        <div class="switch">
-                                            <input class="switch-input" type="radio" id="send_by2" name="send_by" value="action" required{if $notification.fieldData.send_by_action.value} checked{/if}>
-                                            <label class="switch-paddle" for="send_by2"><span class="show-for-sr">Action</span></label>
-                                        </div>
+                        </div>
+                        <div class="cell small-12">
+                            <div class="grid-x grid-margin-x">
+                                <div class="cell small-12 medium-shrink">
+                                    <label>Immediate Action</label>
+                                    <div class="switch">
+                                        <input class="switch-input" type="radio" id="send_by2" name="send_by" value="action" required{if $notification.fieldData.send_by_action.value} checked{/if}>
+                                        <label class="switch-paddle" for="send_by2"><span class="show-for-sr">Action</span></label>
                                     </div>
-                                    <div class="cell small-12 medium-auto">
-
-                                        {* Send Action *}
-                                        {$ui = [
-                                            'value'     => $data.fieldData.send_action,
-                                            'field'     => 'send_action',
-                                            'label'     => 'Send Action',
-                                            'list'      => $send_action,
-                                            'l_blank'   => false,
-                                            'required'  => $data.fieldRequired.send_action,
-                                            'errorText' => 'Send Action is Required',
-                                            'dataError' => $data.fieldFail.send_action
-                                        ]}
-                                        {include file='ui/f6/select.html'}
+                                </div>
+                                <div class="cell small-12 medium-auto">
+
+                                    {* Send Action *}
+                                    {$ui = [
+                                        'value'     => $data.fieldData.send_action,
+                                        'field'     => 'send_action',
+                                        'label'     => 'Send Action',
+                                        'list'      => $send_action,
+                                        'l_blank'   => false,
+                                        'required'  => $data.fieldRequired.send_action,
+                                        'errorText' => 'Send Action is Required',
+                                        'dataError' => $data.fieldFail.send_action
+                                    ]}
+                                    {include file='ui/f6/select.html'}
 
-                                    </div>
                                 </div>
                             </div>
                         </div>
+                    </div>
+
+                    {* To Email *}
+                    {$ui = [
+                        'value'       => $data.fieldData.to_email,
+                        'field'       => 'to_email',
+                        'label'       => 'To Email',
+                        'pattern'     => 'email',
+                        'required'    => $data.fieldRequired.to_email,
+                        'errorText'   => 'To Email is Required to be valid email',
+                        'helpText'    => 'Leave this field blank to send notice to proper {$account.email} address',
+                        'dataError'   => $data.fieldFail.to_email
+                    ]}
+                    {include file='ui/f6/text.html'}
+
+                    {* Subject *}
+                    {$ui = [
+                        'value'       => $data.fieldData.subject,
+                        'field'       => 'subject',
+                        'label'       => 'Subject',
+                        'required'    => $data.fieldRequired.subject,
+                        'errorText'   => 'Subject is Required',
+                        'dataError'   => $data.fieldFail.subject
+                    ]}
+                    {include file='ui/f6/text.html'}
+
+                    {* From *}
+                    {$ui = [
+                        'value'       => $data.fieldData.from_header,
+                        'field'       => 'from_header',
+                        'label'       => 'From',
+                        'pattern'     => 'email',
+                        'required'    => $data.fieldRequired.from_header,
+                        'errorText'   => 'From is Required to be valid email',
+                        'dataError'   => $data.fieldFail.from_header
+                    ]}
+                    {include file='ui/f6/text.html'}
+
+                    {* Reply To *}
+                    {$ui = [
+                        'value'       => $data.fieldData.replyto,
+                        'field'       => 'replyto',
+                        'label'       => 'Reply To',
+                        'required'    => $data.fieldRequired.replyto,
+                        'errorText'   => 'Reply To is Required',
+                        'dataError'   => $data.fieldFail.replyto
+                    ]}
+                    {include file='ui/f6/text.html'}
+
+                    {* Message *}
+                    {$ui = [
+                        'value'     => $data.fieldData.message,
+                        'field'     => 'message',
+                        'label'     => 'Message',
+                        'height'    => '250',
+                        'required'  => $data.fieldRequired.message,
+                        'errortext' => 'Message is Required',
+                        'dataError' => $data.fieldFail.message
+                    ]}
+                    {include file='ui/f6/editor.html'}
+
+
+
+                    <button class="button primary" type="submit">{if $notification_id}Update{else}Add{/if} Notification Type</button>
+
+                </fieldset>
+
+
+                <fieldset class="fieldset small-12 medium-6">
+
+                    <legend>Merge Tag Description</legend>
+
+                        <h4>Merge Tags</h4>
+                        <p>The "merge tags" listed below may be used in the E-Mail message content
+                        to include certain information about the Account or Invoice. Be sure to
+                        include the "{literal}{{/literal}" and "{literal}}{/literal}" and "$" characters exactly as show.</p>
+
+                        {html_table loop=$mergeTagsBilling cols=2 table_attr='border=0 width=400' caption='Billing Examples'}
+
+                        {html_table loop=$mergeTagsContact cols=2 table_attr='border=0 width=400' caption='Contact Examples'}
+
+                        {html_table loop=$mergeTagsInvoice cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Create Invoice'}
+
+                        {html_table loop=$mergeTagsPayment cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Received Payment'}
+
+                </fieldset>
 
-                        {* To Email *}
-                        {$ui = [
-                            'value'       => $data.fieldData.to_email,
-                            'field'       => 'to_email',
-                            'label'       => 'To Email',
-                            'pattern'     => 'email',
-                            'required'    => $data.fieldRequired.to_email,
-                            'errorText'   => 'To Email is Required to be valid email',
-                            'helpText'    => 'Leave this field blank to send notice to proper {$account.email} address',
-                            'dataError'   => $data.fieldFail.to_email
-                        ]}
-                        {include file='ui/f6/text.html'}
-
-                        {* Subject *}
-                        {$ui = [
-                            'value'       => $data.fieldData.subject,
-                            'field'       => 'subject',
-                            'label'       => 'Subject',
-                            'required'    => $data.fieldRequired.subject,
-                            'errorText'   => 'Subject is Required',
-                            'dataError'   => $data.fieldFail.subject
-                        ]}
-                        {include file='ui/f6/text.html'}
-
-                        {* From *}
-                        {$ui = [
-                            'value'       => $data.fieldData.from_header,
-                            'field'       => 'from_header',
-                            'label'       => 'From',
-                            'pattern'     => 'email',
-                            'required'    => $data.fieldRequired.from_header,
-                            'errorText'   => 'From is Required to be valid email',
-                            'dataError'   => $data.fieldFail.from_header
-                        ]}
-                        {include file='ui/f6/text.html'}
-
-                        {* Reply To *}
-                        {$ui = [
-                            'value'       => $data.fieldData.replyto,
-                            'field'       => 'replyto',
-                            'label'       => 'Reply To',
-                            'required'    => $data.fieldRequired.replyto,
-                            'errorText'   => 'Reply To is Required',
-                            'dataError'   => $data.fieldFail.replyto
-                        ]}
-                        {include file='ui/f6/text.html'}
-
-                        {* Message *}
-                        {$ui = [
-                            'value'     => $data.fieldData.message,
-                            'field'     => 'message',
-                            'label'     => 'Message',
-                            'height'    => '250',
-                            'required'  => $data.fieldRequired.message,
-                            'errortext' => 'Message is Required',
-                            'dataError' => $data.fieldFail.message
-                        ]}
-                        {include file='ui/f6/editor.html'}
-
-
-
-                        <button class="button primary" type="submit">{if $notification_id}Update{else}Add{/if} Notification Type</button>
-
-                    </fieldset>
-
-
-                    <fieldset class="fieldset small-12 medium-6">
-
-                        <legend>Merge Tag Description</legend>
-
-                            <h4>Merge Tags</h4>
-                            <p>The "merge tags" listed below may be used in the E-Mail message content
-                            to include certain information about the Account or Invoice. Be sure to
-                            include the "{literal}{{/literal}" and "{literal}}{/literal}" and "$" characters exactly as show.</p>
-
-                            {html_table loop=$mergeTagsBilling cols=2 table_attr='border=0 width=400' caption='Billing Examples'}
-
-                            {html_table loop=$mergeTagsContact cols=2 table_attr='border=0 width=400' caption='Contact Examples'}
-
-                            {html_table loop=$mergeTagsInvoice cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Create Invoice'}
-
-                            {html_table loop=$mergeTagsPayment cols=2 table_attr='border=0 width=400' caption='Only available using Immediate Action - Received Payment'}
-
-                    </fieldset>
-
-            </div>
         </div>
+    </div>
 
-        {include file='ui/f6/errorCallout.html'}
+    {include file='ui/f6/errorCallout.html'}
 
-    </form>
+</form>
 
-</div>
+{* </div> *}
+{include file='ui/f6/grid-end.html'}
 
 <script>
 jQuery(document).ready(function($){
index ce1df0a..234a966 100644 (file)
         <li class="tabs-title{if $thisAction==notifications} is-active{/if}">
             <a href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=notifications">Notifications</a>
         </li>
+        {if $glmMemberManager}
+            <li class="tabs-title{if $thisAction==management} is-active{/if}">
+                <a href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=management">Management</a>
+            </li>
+        {/if}
     </ul>
 
     <div class="">
index f2c5c3b..6bddcac 100644 (file)
                 <th>Dynamic Amount</th>
                 <th>Recurring</th>
                 <th>Recurrence</th>
-                <th>&nbsp;</th>
             </tr>
         </thead>
         <tbody>
             {if $haveInvoiceTypes}
                 {assign var="i" value="0"}
                 {foreach $invoiceTypes as $t}
-                    {if $i++ is odd by 1}
-                        <tr>
-                    {else}
-                        <tr class="alternate">
-                    {/if}
+                    <tr class="glm-invoiceType-row{if $t@iteration is div by 2} alternate{/if}" data-id="{$t.id}">
                         <td>{$t.id}</td>
                         <td>
                             <div{if $t.parent.value} class="glm-indent"{/if}>
                         <td>{if $t.dynamic_amount.value}Yes{else}No{/if}</td>
                         <td>{if $t.recurring.value}Yes{else}No{/if}</td>
                         <td>{if $t.recurrence}{$recurrenceTypes[$t.recurrence]}{/if}</td>
-                        <td>
-                            <div class="deleteInvoiceTypeButton button button-secondary glm-button-small glm-right"
-                                data-invoiceTypeID="{$t.id}">Delete</div>
+                    </tr>
+                    <tr id="invoiceType-container-{$t.id}" class="glm-invoiceType-links glm-hidden{if $t@iteration is div by 2} alternate{/if}">
+                        <td colspan="6">
+                            <span class="account-dashboard-link">
+                                <a class="deleteInvoiceTypeButton" data-invoiceTypeID="{$t.id}">Delete</a>
+                            </span>
                         </td>
                     </tr>
                 {/foreach}
 <script>
 jQuery(document).ready(function($) {
 
+     var invoiceTypeHoverId  = false;
+
+    $('.glm-invoiceType-row').mouseenter( function(){
+        // Hide all
+        $( '.glm-invoiceType-links' ).addClass( 'glm-hidden' );
+
+        invoiceTypeHoverId = $(this).data('id');
+        $( '#invoiceType-container-' + invoiceTypeHoverId ).removeClass( 'glm-hidden' );
+    });
+    $('.glm-admin-table-inner').mouseleave( function() {
+        $( '#invoiceType-container-' + invoiceTypeHoverId ).addClass( 'glm-hidden' );
+    });
+
     $("#newInvoiceTypeDialog").dialog({
         autoOpen: false,
         minWidth: 600,
diff --git a/views/admin/billing/management.html b/views/admin/billing/management.html
new file mode 100644 (file)
index 0000000..f993106
--- /dev/null
@@ -0,0 +1,411 @@
+{* Billing Management *}
+{include file='admin/billing/header.html'}
+
+{$ui = [
+    'nowrap'          => false,
+    'backgroundColor' => '',
+    'sectionColor'    => ''
+]}
+{include file='ui/f6/grid-start.html'}
+
+{$data = $regSettings}
+
+<h3 class="subheader">Management</h3>
+
+{* Notification Updated *}
+{$ui = [
+    'label'  => 'Settings Updated',
+    'active' => $settingsUpdated,
+    'type'   => 'success'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Notification Update Error *}
+{$ui = [
+    'label'  => 'Settings Update Error',
+    'active' => $settingsUpdateError,
+    'type'   => 'alert'
+]}
+{include file="ui/f6/callout.html"}
+
+{* Form Start *}
+{$ui = [
+    'id'     => 'glm-billing-management-form',
+    'action' => "{$thisUrl}?page={$thisPage}",
+    'method' => 'post'
+]}
+{include file="ui/f6/form-start.html"}
+
+<input type="hidden" name="glm_action" value="management">
+<input type="hidden" name="option" value="submit">
+
+<div class="grid-x grid-margin-x">
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Dashboard Settings</legend>
+
+        {* Show Pending Renewals on the Dashboard *}
+        {$ui = [
+            'value'     => $data.fieldData.dashboard_pending_renewals.value,
+            'field'     => 'dashboard_pending_renewals',
+            'label'     => 'Show Pending Renewals on the Dashboard',
+            'required'  => $data.fieldRequired.dashboard_pending_renewals,
+            'errorText' => 'Show Pending Renewals on the Dashboard is Required',
+            'dataError' => $data.fieldFail.dashboard_pending_renewals
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+        {* Show Overdue renewals on the Dashboard *}
+        {$ui = [
+            'value'     => $data.fieldData.dashboard_overdue_renewals.value,
+            'field'     => 'dashboard_overdue_renewals',
+            'label'     => 'Show Overdue renewals on the Dashboard',
+            'required'  => $data.fieldRequired.dashboard_overdue_renewals,
+            'errorText' => 'Show Overdue renewals on the Dashboard is Required',
+            'dataError' => $data.fieldFail.dashboard_overdue_renewals
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+        {* Show Overdue Invoices on the Dashboard *}
+        {$ui = [
+            'value'     => $data.fieldData.dashboard_overdue_invoices.value,
+            'field'     => 'dashboard_overdue_invoices',
+            'label'     => 'Show Overdue Invoices on the Dashboard',
+            'required'  => $data.fieldRequired.dashboard_overdue_invoices,
+            'errorText' => 'Show Overdue Invoices on the Dashboard is Required',
+            'dataError' => $data.fieldFail.dashboard_overdue_invoices
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Templates</legend>
+
+        {* Use UPTRA Invoice Template *}
+        {$ui = [
+            'value'     => $data.fieldData.uptravel_invoice_template.value,
+            'field'     => 'uptravel_invoice_template',
+            'label'     => 'Use UPTRA Invoice Template',
+            'required'  => $data.fieldRequired.uptravel_invoice_template,
+            'errorText' => 'Use UPTRA Invoice Template is Required',
+            'dataError' => $data.fieldFail.uptravel_invoice_template
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+        {* Use UPTRA Payment Form *}
+        {$ui = [
+            'value'     => $data.fieldData.uptravel_payment_form.value,
+            'field'     => 'uptravel_payment_form',
+            'label'     => 'Use UPTRA Payment Form',
+            'required'  => $data.fieldRequired.uptravel_payment_form,
+            'errorText' => 'Use UPTRA Payment Form is Required',
+            'dataError' => $data.fieldFail.uptravel_payment_form
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Payment Methods</legend>
+
+        {* Payment Methods (Bitmap) *}
+        {$ui = [
+            'value'     => $data.fieldData.payment_methods.bitmap,
+            'field'     => 'payment_methods',
+            'label'     => 'Payment Methods',
+            'required'  => false,
+            'errorText' => ' is Required',
+            'dataError' => $data.fieldFail.payment_methods
+        ]}
+        {include file='ui/f6/bitmap.html'}
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Credit Cards Accepted</legend>
+
+        {* Credit Cards Accepted (Bitmap) *}
+        {$ui = [
+            'value'     => $data.fieldData.cc_accepts.bitmap,
+            'field'     => 'cc_accepts',
+            'label'     => 'Credit Cards Accepted',
+            'required'  => false,
+            'errorText' => ' is Required',
+            'dataError' => $data.fieldFail.cc_accepts
+        ]}
+        {include file='ui/f6/bitmap.html'}
+
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6">
+        <legend>Credit Card Processor</legend>
+
+        {* Credit Card Processor *}
+        {$ui = [
+            'value'     => $data.fieldData.proc_methods.value,
+            'field'     => 'proc_methods',
+            'label'     => 'Credit Card Processor',
+            'list'      => $data.fieldData.proc_methods.list,
+            'l_label'   => 'name',
+            'l_value'   => 'value',
+            'l_blank'   => true,
+            'required'  => $data.fieldRequired.proc_methods,
+            'errorText' => 'Credit Card Processor is Required',
+            'dataError' => $data.fieldFail.proc_methods
+        ]}
+        {include file='ui/f6/select.html'}
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6 authorize-net">
+        <legend>Authorize.net</legend>
+
+        {* Login *}
+        {$ui = [
+            'value'       => $data.fieldData.authorize_net_login,
+            'field'       => 'authorize_net_login',
+            'label'       => 'Login',
+            'required'    => $data.fieldRequired.authorize_net_login,
+            'errorText'   => 'Login is Required',
+            'dataError'   => $data.fieldFail.authorize_net_login
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Key *}
+        {$ui = [
+            'value'       => $data.fieldData.authorize_net_key,
+            'field'       => 'authorize_net_key',
+            'label'       => 'Key',
+            'required'    => $data.fieldRequired.authorize_net_key,
+            'errorText'   => 'Key is Required',
+            'dataError'   => $data.fieldFail.authorize_net_key
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Test Mode *}
+        {$ui = [
+            'value'     => $data.fieldData.authorize_net_test.value,
+            'field'     => 'authorize_net_test',
+            'label'     => 'Test Mode',
+            'list'      => $data.fieldData.authorize_net_test.list,
+            'l_label'   => 'name',
+            'l_value'   => 'value',
+            'l_blank'   => true,
+            'required'  => $data.fieldRequired.authorize_net_test,
+            'errorText' => 'Test Mode is Required',
+            'dataError' => $data.fieldFail.authorize_net_test
+        ]}
+        {include file='ui/f6/select.html'}
+
+        {* Send Confirmation E-Mail *}
+        {$ui = [
+            'value'     => $data.fieldData.authorize_net_conf.value,
+            'field'     => 'authorize_net_conf',
+            'label'     => 'Send Confirmation E-Mail',
+            'required'  => $data.fieldRequired.authorize_net_conf,
+            'errorText' => 'Send Confirmation E-Mail is Required',
+            'dataError' => $data.fieldFail.authorize_net_conf
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+        {* Mechan Email *}
+        {$ui = [
+            'value'       => $data.fieldData.authorize_net_merchant_email,
+            'field'       => 'authorize_net_merchant_email',
+            'label'       => 'Mechan Email',
+            'required'    => $data.fieldRequired.authorize_net_merchant_email,
+            'errorText'   => 'Mechan Email is Required',
+            'dataError'   => $data.fieldFail.authorize_net_merchant_email
+        ]}
+        {include file='ui/f6/text.html'}
+
+    </fieldset>
+
+    <fieldset class="fieldset cell small-12 medium-6 merchant-solutions">
+        <legend>Merchant Solutions</legend>
+
+        {* Account ID *}
+        {$ui = [
+            'value'       => $data.fieldData.merchant_solutions_acctid,
+            'field'       => 'merchant_solutions_acctid',
+            'label'       => 'Account ID',
+            'required'    => $data.fieldRequired.merchant_solutions_acctid,
+            'errorText'   => 'Account ID is Required',
+            'dataError'   => $data.fieldFail.merchant_solutions_acctid
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Merchant PIN *}
+        {$ui = [
+            'value'       => $data.fieldData.merchant_solutions_merchantpin,
+            'field'       => 'merchant_solutions_merchantpin',
+            'label'       => 'Merchant PIN',
+            'required'    => $data.fieldRequired.merchant_solutions_merchantpin,
+            'errorText'   => 'Merchant PIN is Required',
+            'dataError'   => $data.fieldFail.merchant_solutions_merchantpin
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Test Mode *}
+        {$ui = [
+            'value'     => $data.fieldData.merchant_solutions_test.value,
+            'field'     => 'merchant_solutions_test',
+            'label'     => 'Test Mode',
+            'list'      => $data.fieldData.merchant_solutions_test.list,
+            'l_label'   => 'name',
+            'l_value'   => 'value',
+            'l_blank'   => true,
+            'required'  => $data.fieldRequired.merchant_solutions_test,
+            'errorText' => 'Test Mode is Required',
+            'dataError' => $data.fieldFail.merchant_solutions_test
+        ]}
+        {include file='ui/f6/select.html'}
+
+        {* Send Confirmation E-Mail *}
+        {$ui = [
+            'value'     => $data.fieldData.merchant_solutions_conf.value,
+            'field'     => 'merchant_solutions_conf',
+            'label'     => 'Send Confirmation E-Mail',
+            'required'  => $data.fieldRequired.merchant_solutions_conf,
+            'errorText' => 'Send Confirmation E-Mail is Required',
+            'dataError' => $data.fieldFail.merchant_solutions_conf
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+    </fieldset>
+
+    <fieldset class="cell small-12 medium-6 square">
+        <legend>Square</legend>
+
+        {* Use Production Mode *}
+        {$ui = [
+            'value'     => $data.fieldData.square_use_prod.value,
+            'field'     => 'square_use_prod',
+            'label'     => 'Use Production Mode',
+            'required'  => $data.fieldRequired.square_use_prod,
+            'errorText' => 'Use Production Mode is Required',
+            'dataError' => $data.fieldFail.square_use_prod
+        ]}
+        {include file='ui/f6/checkbox.html'}
+
+        {* Production Access Token *}
+        {$ui = [
+            'value'       => $data.fieldData.square_prod_access_token,
+            'field'       => 'square_prod_access_token',
+            'label'       => 'Production Access Token',
+            'required'    => $data.fieldRequired.square_prod_access_token,
+            'errorText'   => 'Production Access Token is Required',
+            'dataError'   => $data.fieldFail.square_prod_access_token
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Production App Id *}
+        {$ui = [
+            'value'       => $data.fieldData.square_prod_app_id,
+            'field'       => 'square_prod_app_id',
+            'label'       => 'Production App Id',
+            'required'    => $data.fieldRequired.square_prod_app_id,
+            'errorText'   => 'Production App Id is Required',
+            'dataError'   => $data.fieldFail.square_prod_app_id
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Production Location Id *}
+        {$ui = [
+            'value'       => $data.fieldData.square_prod_location_id,
+            'field'       => 'square_prod_location_id',
+            'label'       => 'Production Location Id',
+            'required'    => $data.fieldRequired.square_prod_location_id,
+            'errorText'   => 'Production Location Id is Required',
+            'dataError'   => $data.fieldFail.square_prod_location_id
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Sandbox Access Token *}
+        {$ui = [
+            'value'       => $data.fieldData.square_sandbox_access_token,
+            'field'       => 'square_sandbox_access_token',
+            'label'       => 'Sandbox Access Token',
+            'required'    => $data.fieldRequired.square_sandbox_access_token,
+            'errorText'   => 'Sandbox Access Token is Required',
+            'dataError'   => $data.fieldFail.square_sandbox_access_token
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Sandbox App Id *}
+        {$ui = [
+            'value'       => $data.fieldData.square_sandbox_app_id,
+            'field'       => 'square_sandbox_app_id',
+            'label'       => 'Sandbox App Id',
+            'required'    => $data.fieldRequired.square_sandbox_app_id,
+            'errorText'   => 'Sandbox App Id is Required',
+            'dataError'   => $data.fieldFail.square_sandbox_app_id
+        ]}
+        {include file='ui/f6/text.html'}
+
+        {* Sandbox Location Id *}
+        {$ui = [
+            'value'       => $data.fieldData.square_sandbox_location_id,
+            'field'       => 'square_sandbox_location_id',
+            'label'       => 'Sandbox Location Id',
+            'required'    => $data.fieldRequired.square_sandbox_location_id,
+            'errorText'   => 'Sandbox Location Id is Required',
+            'dataError'   => $data.fieldFail.square_sandbox_location_id
+        ]}
+        {include file='ui/f6/text.html'}
+
+    </fieldset>
+
+</div>
+
+
+<button type="submit" class="button primary">Update Settings</button>
+
+{include file="ui/f6/form-end.html"}
+
+{include file='ui/f6/grid-end.html'}
+
+<script>
+jQuery(function($){
+
+    function showSelectedCardProcessor() {
+
+        // Get the value from the selected Payment Method
+        var processor = $('#proc_methods').val();
+
+        // This is a hack, we should be looking at the plugin.ini for these numbers but I'm just too lazy today
+        if (processor == 2) {
+            $('.authorize-net').removeClass('glm-hidden');
+            $('.merchant-solutions').addClass('glm-hidden');
+            $('.square').addClass('glm-hidden');
+        } else if (processor == 3) {
+            $('.authorize-net').addClass('glm-hidden');
+            $('.merchant-solutions').removeClass('glm-hidden');
+            $('.square').addClass('glm-hidden');
+        } else if (processor == 4) {
+            $('.authorize-net').addClass('glm-hidden');
+            $('.merchant-solutions').addClass('glm-hidden');
+            $('.square').removeClass('glm-hidden');
+        } else {
+            $('.authorize-net').addClass('glm-hidden');
+            $('.merchant-solutions').addClass('glm-hidden');
+            $('.square').addClass('glm-hidden');
+        }
+
+    }
+
+    // When payment method selection changes
+    $('#proc_methods').on('change', function() {
+        showSelectedCardProcessor();
+    });
+
+    // Start with all pay method inputs dissabled
+    $( document ).ready(function() {
+        showSelectedCardProcessor();
+    });
+
+});
+</script>
+
+{include file='admin/billing/footer.html'}
index 3a4e6c8..f555b6e 100644 (file)
                 <th>Notification</th>
                 <th>Subject</th>
                 <th>Trigger</th>
-                <th>&nbsp;</th>
             </tr>
         </thead>
         <tbody>
             {if $haveNotificationTypes}
                 {assign var="i" value="0"}
                 {foreach $notificationTypes as $t}
-                    <tr>
+                    <tr class="glm-notification-row{if $t@iteration is div by 2} alternate{/if}" data-id="{$t.id}">
                         <td style="width:50px;">{$t.id}</td>
                         <td>
                             <div>
                                 Due Date
                             {/if}
                         </td>
-                        <td>
-                            <div
-                                class="deleteNotificationTypeButton button button-secondary glm-button-small glm-right"
-                                data-notificationTypeID="{$t.id}">Delete</div>
+                    </tr>
+                    <tr id="notification-container-{$t.id}" class="glm-notification-links glm-hidden{if $t@iteration is div by 2} alternate{/if}">
+                        <td colspan="5">
+                            <span class="account-dashboard-link">
+                                <a class="deleteNotificationTypeButton" data-notificationTypeID="{$t.id}">Delete</a>
+                            </span>
                         </td>
                     </tr>
                 {/foreach}
@@ -63,6 +64,7 @@
     </table>
 
 </div>
+
 <script type="text/javascript">
     jQuery(document).ready(function($) {
 
             dialogClass: "glm-dialog-no-close"
         });
 
+        var notificationHoverId  = false;
+
+        $('.glm-notification-row').mouseenter( function(){
+            // Hide all
+            $( '.glm-notification-links' ).addClass( 'glm-hidden' );
+
+            notificationHoverId = $(this).data('id');
+            $( '#notification-container-' + notificationHoverId ).removeClass( 'glm-hidden' );
+        });
+        $('.glm-admin-table-inner').mouseleave( function() {
+            $( '#notification-container-' + notificationHoverId ).addClass( 'glm-hidden' );
+        });
 
         var id = false;
         $('.deleteNotificationTypeButton').click( function() {
index eb28bdc..bf4fd33 100644 (file)
 ]}
 {include file='ui/f6/grid-start.html'}
 
-    <h3 class="subheader">Settings</h3>
-
-    {* Updated Settings *}
-    {if $settingsUpdated}
-        <div class="success callout" data-closable>
-            <button class="close-button" aria-label="Close alert" type="button" data-close>
-                <span aria-hidden="true">&times;</span>
-            </button>
-            <p><i class="fi-alert"></i> Settings Updated</p>
-        </div>
-    {/if}
-    {* Error for Update Settings *}
-    {if $settingsUpdateError}
-        <div class="alert callout" data-closable>
-            <button class="close-button" aria-label="Close alert" type="button" data-close>
-                <span aria-hidden="true">&times;</span>
-            </button>
-            <p><i class="fi-alert"></i> Settings Update Error</p>
-        </div>
-    {/if}
-
-    <form id="billing-setting-form" action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data" data-abide novalidate>
-        <input type="hidden" name="glm_action" value="settings">
-        <input type="hidden" name="option" value="settings">
-        <input type="hidden" name="option2" value="submit">
-
-        {include file='ui/f6/errorCallout.html'}
-
-        <ul class="accordion" data-accordion data-allow-all-closed="true">
-
-            <li class="accordion-item is-active" data-accordion-item>
-                <a href="#" class="accordion-title"Main >Settings</a>
-
-                <div class="accordion-content" data-tab-content>
-                    <div class="grid-x grid-margin-x">
-                        <div class="cell small-12 large-6">
-
-                            <fieldset class="fieldset cell small-12">
-                                <legend>Invoice Information</legend>
-
-                                {* Company Logo *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_logo,
-                                    'field'       => 'company_logo',
-                                    'label'       => 'Company Logo',
-                                    'button'      => 'Upload File',
-                                    'required'    => $data.fieldRequired.company_logo,
-                                    'errorText'   => 'Company Logo is Required',
-                                    'helpText'    => '<br>Best logo size: 400x200px. Must be jpeg or png.',
-                                    'dataError'   => $data.fieldFail.company_logo
-                                ]}
-                                {include file='ui/f6/image.html'}
-
-                                {* Company Name *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_name,
-                                    'field'       => 'company_name',
-                                    'label'       => 'Company Name',
-                                    'required'    => $data.fieldRequired.company_name,
-                                    'errorText'   => 'Company Name is Required',
-                                    'dataError'   => $data.fieldFail.company_name
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company Name 2 *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_name2,
-                                    'field'       => 'company_name2',
-                                    'label'       => 'Company Name 2',
-                                    'required'    => $data.fieldRequired.company_name2,
-                                    'errorText'   => 'Company Name 2 is Required',
-                                    'dataError'   => $data.fieldFail.company_name2
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company Address 1 *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_addr1,
-                                    'field'       => 'company_addr1',
-                                    'label'       => 'Company Address 1',
-                                    'required'    => $data.fieldRequired.company_addr1,
-                                    'errorText'   => 'Company Address 1 is Required',
-                                    'dataError'   => $data.fieldFail.company_addr1
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company Address 2 *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_addr2,
-                                    'field'       => 'company_addr2',
-                                    'label'       => 'Company Address 2',
-                                    'required'    => $data.fieldRequired.company_addr2,
-                                    'errorText'   => 'Company Address 2 is Required',
-                                    'dataError'   => $data.fieldFail.company_addr2
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company City *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_city,
-                                    'field'       => 'company_city',
-                                    'label'       => 'Company City',
-                                    'required'    => $data.fieldRequired.company_city,
-                                    'errorText'   => 'Company City is Required',
-                                    'dataError'   => $data.fieldFail.company_city
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company State *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.company_state.value,
-                                    'field'     => 'company_state',
-                                    'label'     => 'Company State',
-                                    'list'      => $data.fieldData.company_state.list,
-                                    'l_label'   => 'name',
-                                    'l_value'   => 'value',
-                                    'l_blank'   => true,
-                                    'required'  => $data.fieldRequired.company_state,
-                                    'errorText' => 'Company State is Required',
-                                    'dataError' => $data.fieldFail.company_state
-                                ]}
-                                {include file='ui/f6/select.html'}
-
-                                {* Company Zip *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_zip,
-                                    'field'       => 'company_zip',
-                                    'label'       => 'Company Zip',
-                                    'required'    => $data.fieldRequired.company_zip,
-                                    'errorText'   => 'Company Zip is Required',
-                                    'dataError'   => $data.fieldFail.company_zip
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company Phone *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_phone,
-                                    'field'       => 'company_phone',
-                                    'label'       => 'Company Phone',
-                                    'required'    => $data.fieldRequired.company_phone,
-                                    'errorText'   => 'Company Phone is Required',
-                                    'dataError'   => $data.fieldFail.company_phone
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company Email *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_email,
-                                    'field'       => 'company_email',
-                                    'label'       => 'Company Email',
-                                    'required'    => $data.fieldRequired.company_email,
-                                    'errorText'   => 'Company Email is Required',
-                                    'dataError'   => $data.fieldFail.company_email
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Company URL *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_url,
-                                    'field'       => 'company_url',
-                                    'label'       => 'Company URL',
-                                    'required'    => $data.fieldRequired.company_url,
-                                    'errorText'   => 'Company URL is Required',
-                                    'dataError'   => $data.fieldFail.company_url
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Payment Terms *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.payment_terms,
-                                    'field'       => 'payment_terms',
-                                    'label'       => 'Payment Terms',
-                                    'required'    => $data.fieldRequired.payment_terms,
-                                    'errorText'   => 'Payment Terms is Required',
-                                    'dataError'   => $data.fieldFail.payment_terms
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-
-
-                            </fieldset>
-                        </div>
-
-                        <div class="cell small-12 large-6">
-                            <fieldset class="fieldset cell small-12">
-                                <legend>Membership Renewal Settings</legend>
-
-                                {* All Members Renew same day each year *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.renewal_day_static.value,
-                                    'field'     => 'renewal_day_static',
-                                    'label'     => 'All Members Renew same day each year',
-                                    'required'  => $data.fieldRequired.renewal_day_static,
-                                    'errorText' => 'All Members Renew same day each year is Required',
-                                    'helpText'  => 'All Member renewal on the same day each billing period (yearly)',
-                                    'dataError' => $data.fieldFail.renewal_day_static
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                <div class="grid-x grid-margin-x">
-                                    <div class="cell small-12">
-                                        <label>Renewal Day Each Year</label>
-                                    </div>
-                                    <div class="cell small-6">
-                                        {* Month *}
-                                        {$ui = [
-                                            'value'     => $data.fieldData.renewal_month,
-                                            'field'     => 'renewal_month',
-                                            'label'     => 'Month',
-                                            'list'      => $renewal_month_opts,
-                                            'l_blank'   => true,
-                                            'required'  => $data.fieldRequired.renewal_month,
-                                            'errorText' => 'Month is Required',
-                                            'dataError' => $data.fieldFail.renewal_month
-                                        ]}
-                                        {include file='ui/f6/select.html'}
-                                    </div>
-                                    <div class="cell small-6">
-                                        {* Day *}
-                                        {$ui = [
-                                            'value'     => $data.fieldData.renewal_day,
-                                            'field'     => 'renewal_day',
-                                            'label'     => 'Day',
-                                            'list'      => $renewal_day_opts,
-                                            'l_blank'   => true,
-                                            'required'  => $data.fieldRequired.renewal_day,
-                                            'errorText' => 'Day is Required',
-                                            'dataError' => $data.fieldFail.renewal_day
-                                        ]}
-                                        {include file='ui/f6/select.html'}
-                                    </div>
-                                </div>
-
-                                {* Days Before Renewal Date *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.days_before_renewal,
-                                    'field'       => 'days_before_renewal',
-                                    'label'       => 'Days Before Renewal Date',
-                                    'pattern'     => 'number',
-                                    'required'    => $data.fieldRequired.days_before_renewal,
-                                    'errorText'   => 'Days Before Renewal Date is Required to be a number',
-                                    'helpText'    => 'Days before Renewal Date to Allow Membership Renewal. Based on 1 year after renewal date.',
-                                    'dataError'   => $data.fieldFail.days_before_renewal
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Days After Renewal Date *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.days_after_expired,
-                                    'field'       => 'days_after_expired',
-                                    'label'       => 'Days After Renewal Date',
-                                    'pattern'     => 'number',
-                                    'required'    => $data.fieldRequired.days_after_expired,
-                                    'errorText'   => 'Days After Renewal Date is Required to be a number',
-                                    'helpText'    => 'Days after Renewal Date to Expire Membership. Based on 1 year after renewal date.',
-                                    'dataError'   => $data.fieldFail.days_after_expired
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Receipt Text *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.receipt_text,
-                                    'field'     => 'receipt_text',
-                                    'label'     => 'Receipt Text',
-                                    'height'    => 250,
-                                    'media'     => false,
-                                    'quicktags' => false,
-                                    'required'  => $data.fieldRequired.receipt_text,
-                                    'errorText' => 'Receipt Text is Required',
-                                    'dataError' => $data.fieldFail.receipt_text
-                                ]}
-                                {include file='ui/f6/editor.html'}
-
-                                {* Member Types that require billing *}
-                                {$ui = [
-                                    'value'     => $selectedMTRB,
-                                    'field'     => 'member_types_requiring_billing_option',
-                                    'label'     => 'Member Types that require billing',
-                                    'list'      => $member_types,
-                                    'l_label'   => 'name',
-                                    'l_value'   => 'id',
-                                    'l_blank'   => false,
-                                    'l_size'    => 5,
-                                    'required'  => false,
-                                    'errorText' => 'Member Types that require billing is Required',
-                                    'dataError' => $data.fieldFail.member_types_requiring_billing
-                                ]}
-                                {include file='ui/f6/multiselect.html'}
-
-                                {* Member Types that are Free *}
-                                {$ui = [
-                                    'value'     => $selectedMTFREE,
-                                    'field'     => 'member_types_free_option',
-                                    'label'     => 'Member Types that are Free',
-                                    'list'      => $member_types,
-                                    'l_label'   => 'name',
-                                    'l_value'   => 'id',
-                                    'l_blank'   => false,
-                                    'l_size'    => 5,
-                                    'required'  => false,
-                                    'errorText' => 'Member Types that require billing is Required',
-                                    'dataError' => $data.fieldFail.member_types_free
-                                ]}
-                                {include file='ui/f6/multiselect.html'}
-
-                            </fieldset>
-                        </div>
+<h3 class="subheader">Settings</h3>
+
+{* Updated Settings *}
+{if $settingsUpdated}
+    <div class="success callout" data-closable>
+        <button class="close-button" aria-label="Close alert" type="button" data-close>
+            <span aria-hidden="true">&times;</span>
+        </button>
+        <p><i class="fi-alert"></i> Settings Updated</p>
+    </div>
+{/if}
+{* Error for Update Settings *}
+{if $settingsUpdateError}
+    <div class="alert callout" data-closable>
+        <button class="close-button" aria-label="Close alert" type="button" data-close>
+            <span aria-hidden="true">&times;</span>
+        </button>
+        <p><i class="fi-alert"></i> Settings Update Error</p>
+    </div>
+{/if}
+
+<form id="billing-setting-form" action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data" data-abide novalidate>
+    <input type="hidden" name="glm_action" value="settings">
+    <input type="hidden" name="option" value="settings">
+    <input type="hidden" name="option2" value="submit">
+
+    {include file='ui/f6/errorCallout.html'}
+
+    <ul class="accordion" data-accordion data-allow-all-closed="true">
+
+        <li class="accordion-item is-active" data-accordion-item>
+            <a href="#" class="accordion-title"Main >Settings</a>
+
+            <div class="accordion-content" data-tab-content>
+                <div class="grid-x grid-margin-x">
+                    <div class="cell small-12 large-6">
+
+                        <fieldset class="fieldset cell small-12">
+                            <legend>Invoice Information</legend>
+
+                            {* Company Logo *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_logo,
+                                'field'       => 'company_logo',
+                                'label'       => 'Company Logo',
+                                'button'      => 'Upload File',
+                                'required'    => $data.fieldRequired.company_logo,
+                                'errorText'   => 'Company Logo is Required',
+                                'helpText'    => '<br>Best logo size: 400x200px. Must be jpeg or png.',
+                                'dataError'   => $data.fieldFail.company_logo
+                            ]}
+                            {include file='ui/f6/image.html'}
+
+                            {* Company Name *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_name,
+                                'field'       => 'company_name',
+                                'label'       => 'Company Name',
+                                'required'    => $data.fieldRequired.company_name,
+                                'errorText'   => 'Company Name is Required',
+                                'dataError'   => $data.fieldFail.company_name
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company Name 2 *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_name2,
+                                'field'       => 'company_name2',
+                                'label'       => 'Company Name 2',
+                                'required'    => $data.fieldRequired.company_name2,
+                                'errorText'   => 'Company Name 2 is Required',
+                                'dataError'   => $data.fieldFail.company_name2
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company Address 1 *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_addr1,
+                                'field'       => 'company_addr1',
+                                'label'       => 'Company Address 1',
+                                'required'    => $data.fieldRequired.company_addr1,
+                                'errorText'   => 'Company Address 1 is Required',
+                                'dataError'   => $data.fieldFail.company_addr1
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company Address 2 *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_addr2,
+                                'field'       => 'company_addr2',
+                                'label'       => 'Company Address 2',
+                                'required'    => $data.fieldRequired.company_addr2,
+                                'errorText'   => 'Company Address 2 is Required',
+                                'dataError'   => $data.fieldFail.company_addr2
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company City *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_city,
+                                'field'       => 'company_city',
+                                'label'       => 'Company City',
+                                'required'    => $data.fieldRequired.company_city,
+                                'errorText'   => 'Company City is Required',
+                                'dataError'   => $data.fieldFail.company_city
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company State *}
+                            {$ui = [
+                                'value'     => $data.fieldData.company_state.value,
+                                'field'     => 'company_state',
+                                'label'     => 'Company State',
+                                'list'      => $data.fieldData.company_state.list,
+                                'l_label'   => 'name',
+                                'l_value'   => 'value',
+                                'l_blank'   => true,
+                                'required'  => $data.fieldRequired.company_state,
+                                'errorText' => 'Company State is Required',
+                                'dataError' => $data.fieldFail.company_state
+                            ]}
+                            {include file='ui/f6/select.html'}
+
+                            {* Company Zip *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_zip,
+                                'field'       => 'company_zip',
+                                'label'       => 'Company Zip',
+                                'required'    => $data.fieldRequired.company_zip,
+                                'errorText'   => 'Company Zip is Required',
+                                'dataError'   => $data.fieldFail.company_zip
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company Phone *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_phone,
+                                'field'       => 'company_phone',
+                                'label'       => 'Company Phone',
+                                'required'    => $data.fieldRequired.company_phone,
+                                'errorText'   => 'Company Phone is Required',
+                                'dataError'   => $data.fieldFail.company_phone
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company Email *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_email,
+                                'field'       => 'company_email',
+                                'label'       => 'Company Email',
+                                'required'    => $data.fieldRequired.company_email,
+                                'errorText'   => 'Company Email is Required',
+                                'dataError'   => $data.fieldFail.company_email
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Company URL *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_url,
+                                'field'       => 'company_url',
+                                'label'       => 'Company URL',
+                                'required'    => $data.fieldRequired.company_url,
+                                'errorText'   => 'Company URL is Required',
+                                'dataError'   => $data.fieldFail.company_url
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Payment Terms *}
+                            {$ui = [
+                                'value'       => $data.fieldData.payment_terms,
+                                'field'       => 'payment_terms',
+                                'label'       => 'Payment Terms',
+                                'required'    => $data.fieldRequired.payment_terms,
+                                'errorText'   => 'Payment Terms is Required',
+                                'dataError'   => $data.fieldFail.payment_terms
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+
+
+                        </fieldset>
+                    </div>
 
+                    <div class="cell small-12 large-6">
+                        <fieldset class="fieldset cell small-12">
+                            <legend>Membership Renewal Settings</legend>
+
+                            {* All Members Renew same day each year *}
+                            {$ui = [
+                                'value'     => $data.fieldData.renewal_day_static.value,
+                                'field'     => 'renewal_day_static',
+                                'label'     => 'All Members Renew same day each year',
+                                'required'  => $data.fieldRequired.renewal_day_static,
+                                'errorText' => 'All Members Renew same day each year is Required',
+                                'helpText'  => 'All Member renewal on the same day each billing period (yearly)',
+                                'dataError' => $data.fieldFail.renewal_day_static
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            <div class="grid-x grid-margin-x">
+                                <div class="cell small-12">
+                                    <label>Renewal Day Each Year</label>
+                                </div>
+                                <div class="cell small-6">
+                                    {* Month *}
+                                    {$ui = [
+                                        'value'     => $data.fieldData.renewal_month,
+                                        'field'     => 'renewal_month',
+                                        'label'     => 'Month',
+                                        'list'      => $renewal_month_opts,
+                                        'l_blank'   => true,
+                                        'required'  => $data.fieldRequired.renewal_month,
+                                        'errorText' => 'Month is Required',
+                                        'dataError' => $data.fieldFail.renewal_month
+                                    ]}
+                                    {include file='ui/f6/select.html'}
+                                </div>
+                                <div class="cell small-6">
+                                    {* Day *}
+                                    {$ui = [
+                                        'value'     => $data.fieldData.renewal_day,
+                                        'field'     => 'renewal_day',
+                                        'label'     => 'Day',
+                                        'list'      => $renewal_day_opts,
+                                        'l_blank'   => true,
+                                        'required'  => $data.fieldRequired.renewal_day,
+                                        'errorText' => 'Day is Required',
+                                        'dataError' => $data.fieldFail.renewal_day
+                                    ]}
+                                    {include file='ui/f6/select.html'}
+                                </div>
+                            </div>
+
+                            {* Days Before Renewal Date *}
+                            {$ui = [
+                                'value'       => $data.fieldData.days_before_renewal,
+                                'field'       => 'days_before_renewal',
+                                'label'       => 'Days Before Renewal Date',
+                                'pattern'     => 'number',
+                                'required'    => $data.fieldRequired.days_before_renewal,
+                                'errorText'   => 'Days Before Renewal Date is Required to be a number',
+                                'helpText'    => 'Days before Renewal Date to Allow Membership Renewal. Based on 1 year after renewal date.',
+                                'dataError'   => $data.fieldFail.days_before_renewal
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Days After Renewal Date *}
+                            {$ui = [
+                                'value'       => $data.fieldData.days_after_expired,
+                                'field'       => 'days_after_expired',
+                                'label'       => 'Days After Renewal Date',
+                                'pattern'     => 'number',
+                                'required'    => $data.fieldRequired.days_after_expired,
+                                'errorText'   => 'Days After Renewal Date is Required to be a number',
+                                'helpText'    => 'Days after Renewal Date to Expire Membership. Based on 1 year after renewal date.',
+                                'dataError'   => $data.fieldFail.days_after_expired
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Receipt Text *}
+                            {$ui = [
+                                'value'     => $data.fieldData.receipt_text,
+                                'field'     => 'receipt_text',
+                                'label'     => 'Receipt Text',
+                                'height'    => 250,
+                                'media'     => false,
+                                'quicktags' => false,
+                                'required'  => $data.fieldRequired.receipt_text,
+                                'errorText' => 'Receipt Text is Required',
+                                'dataError' => $data.fieldFail.receipt_text
+                            ]}
+                            {include file='ui/f6/editor.html'}
+
+                            {* Member Types that require billing *}
+                            {$ui = [
+                                'value'     => $selectedMTRB,
+                                'field'     => 'member_types_requiring_billing_option',
+                                'label'     => 'Member Types that require billing',
+                                'list'      => $member_types,
+                                'l_label'   => 'name',
+                                'l_value'   => 'id',
+                                'l_blank'   => false,
+                                'l_size'    => 5,
+                                'required'  => false,
+                                'errorText' => 'Member Types that require billing is Required',
+                                'dataError' => $data.fieldFail.member_types_requiring_billing
+                            ]}
+                            {include file='ui/f6/multiselect.html'}
+
+                            {* Member Types that are Free *}
+                            {$ui = [
+                                'value'     => $selectedMTFREE,
+                                'field'     => 'member_types_free_option',
+                                'label'     => 'Member Types that are Free',
+                                'list'      => $member_types,
+                                'l_label'   => 'name',
+                                'l_value'   => 'id',
+                                'l_blank'   => false,
+                                'l_size'    => 5,
+                                'required'  => false,
+                                'errorText' => 'Member Types that require billing is Required',
+                                'dataError' => $data.fieldFail.member_types_free
+                            ]}
+                            {include file='ui/f6/multiselect.html'}
+
+                        </fieldset>
                     </div>
-                </div>
 
-            </li>
-
-            <li class="accordion-item" data-accordion-item>
-                <a href="#" class="accordion-title">Advanced Settings</a>
-                <div class="accordion-content" data-tab-content>
-                    <div class="grid-x grid-margin-x">
-                        <div class="cell small-12 large-6">
-                            <fieldset class="fieldset cell small-12">
-                                <legend>Advanced Settings</legend>
-
-                                {* Company Logo Width *}
-                                {$ui = [
-                                    'value'       => $data.fieldData.company_logo_width,
-                                    'field'       => 'company_logo_width',
-                                    'label'       => 'Company Logo Width',
-                                    'pattern'     => 'number',
-                                    'required'    => $data.fieldRequired.company_logo_width,
-                                    'errorText'   => 'Company Logo Width Must be numeric',
-                                    'dataError'   => $data.fieldFail.company_logo_width
-                                ]}
-                                {include file='ui/f6/text.html'}
-
-                                {* Enable Account Number *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.account_number_enabled.value,
-                                    'field'     => 'account_number_enabled',
-                                    'label'     => 'Enable Account Number',
-                                    'required'  => $data.fieldRequired.account_number_enabled,
-                                    'errorText' => 'Enable Account Number is Required',
-                                    'dataError' => $data.fieldFail.account_number_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Require Account Number *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.account_number_required.value,
-                                    'field'     => 'account_number_required',
-                                    'label'     => 'Require Account Number',
-                                    'required'  => $data.fieldRequired.account_number_required,
-                                    'errorText' => 'Require Account Number is Required',
-                                    'dataError' => $data.fieldFail.account_number_required
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Show Account # *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.invoice_show_account_number.value,
-                                    'field'     => 'invoice_show_account_number',
-                                    'label'     => 'Show Account # On Invoices',
-                                    'required'  => $data.fieldRequired.invoice_show_account_number,
-                                    'errorText' => 'Show Account # is Required',
-                                    'dataError' => $data.fieldFail.invoice_show_account_number
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Show Invoice # *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.invoice_show_invoice_number.value,
-                                    'field'     => 'invoice_show_invoice_number',
-                                    'label'     => 'Show Invoice # On Invoices',
-                                    'required'  => $data.fieldRequired.invoice_show_invoice_number,
-                                    'errorText' => 'Show Invoice # is Required',
-                                    'dataError' => $data.fieldFail.invoice_show_invoice_number
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Allow Membership Choice When Renewing *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.allow_membership_choice.value,
-                                    'field'     => 'allow_membership_choice',
-                                    'label'     => 'Allow Membership Choice When Renewing',
-                                    'required'  => $data.fieldRequired.allow_membership_choice,
-                                    'errorText' => 'Allow Membership Choice When Renewing is Required',
-                                    'dataError' => $data.fieldFail.allow_membership_choice
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Allow Employees *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.allow_employees.value,
-                                    'field'     => 'allow_employees',
-                                    'label'     => 'Allow Employees',
-                                    'required'  => $data.fieldRequired.allow_employees,
-                                    'errorText' => 'Allow Employees is Required',
-                                    'dataError' => $data.fieldFail.allow_employees
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Use Member Types in Invoice Types *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.member_types_enabled.value,
-                                    'field'     => 'member_types_enabled',
-                                    'label'     => 'Use Member Types in Invoice Types',
-                                    'required'  => $data.fieldRequired.member_types_enabled,
-                                    'errorText' => 'Use Member Types in Invoice Types is Required',
-                                    'dataError' => $data.fieldFail.member_types_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Enable Quickbooks *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.quickbooks_enabled.value,
-                                    'field'     => 'quickbooks_enabled',
-                                    'label'     => 'Enable Quickbooks',
-                                    'required'  => $data.fieldRequired.quickbooks_enabled,
-                                    'errorText' => 'Enable Quickbooks is Required',
-                                    'dataError' => $data.fieldFail.quickbooks_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Enable Members Billing Tab *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.member_billing_enabled.value,
-                                    'field'     => 'member_billing_enabled',
-                                    'label'     => 'Enable Members Billing Tab',
-                                    'required'  => $data.fieldRequired.member_billing_enabled,
-                                    'errorText' => 'Enable Members Billing Tab is Required',
-                                    'dataError' => $data.fieldFail.member_billing_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Require Billing Fields *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.billing_fields_required.value,
-                                    'field'     => 'billing_fields_required',
-                                    'label'     => 'Require Billing Fields',
-                                    'required'  => $data.fieldRequired.billing_fields_required,
-                                    'errorText' => 'Require Billing Fields is Required',
-                                    'dataError' => $data.fieldFail.billing_fields_required
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Enable Invoice Methods *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.invoice_methods_enabled.value,
-                                    'field'     => 'invoice_methods_enabled',
-                                    'label'     => 'Enable Invoice Methods',
-                                    'required'  => $data.fieldRequired.invoice_methods_enabled,
-                                    'errorText' => 'Enable Invoice Methods is Required',
-                                    'dataError' => $data.fieldFail.invoice_methods_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Enable Billing Counties *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.billing_county_enabled.value,
-                                    'field'     => 'billing_county_enabled',
-                                    'label'     => 'Enable Billing Counties',
-                                    'required'  => $data.fieldRequired.billing_county_enabled,
-                                    'errorText' => 'Enable Billing Counties is Required',
-                                    'dataError' => $data.fieldFail.billing_county_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Enable Billing Contact Name *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.billing_contact_name_enabled.value,
-                                    'field'     => 'billing_contact_name_enabled',
-                                    'label'     => 'Enable Billing Contact Name',
-                                    'required'  => $data.fieldRequired.billing_contact_name_enabled,
-                                    'errorText' => 'Enable Billing Contact Name is Required',
-                                    'dataError' => $data.fieldFail.billing_contact_name_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-                                {* Create PDF Invoices *}
-                                {$ui = [
-                                    'value'     => $data.fieldData.invoice_pdf_enabled.value,
-                                    'field'     => 'invoice_pdf_enabled',
-                                    'label'     => 'Create PDF Invoices',
-                                    'required'  => $data.fieldRequired.invoice_pdf_enabled,
-                                    'errorText' => 'Create PDF Invoices is Required',
-                                    'dataError' => $data.fieldFail.invoice_pdf_enabled
-                                ]}
-                                {include file='ui/f6/checkbox.html'}
-
-
-                            </fieldset>
-                        </div>
+                </div>
+            </div>
+
+        </li>
+
+        <li class="accordion-item" data-accordion-item>
+            <a href="#" class="accordion-title">Advanced Settings</a>
+            <div class="accordion-content" data-tab-content>
+                <div class="grid-x grid-margin-x">
+                    <div class="cell small-12 large-6">
+                        <fieldset class="fieldset cell small-12">
+                            <legend>Advanced Settings</legend>
+
+                            {* Company Logo Width *}
+                            {$ui = [
+                                'value'       => $data.fieldData.company_logo_width,
+                                'field'       => 'company_logo_width',
+                                'label'       => 'Company Logo Width',
+                                'pattern'     => 'number',
+                                'required'    => $data.fieldRequired.company_logo_width,
+                                'errorText'   => 'Company Logo Width Must be numeric',
+                                'dataError'   => $data.fieldFail.company_logo_width
+                            ]}
+                            {include file='ui/f6/text.html'}
+
+                            {* Enable Account Number *}
+                            {$ui = [
+                                'value'     => $data.fieldData.account_number_enabled.value,
+                                'field'     => 'account_number_enabled',
+                                'label'     => 'Enable Account Number',
+                                'required'  => $data.fieldRequired.account_number_enabled,
+                                'errorText' => 'Enable Account Number is Required',
+                                'dataError' => $data.fieldFail.account_number_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Require Account Number *}
+                            {$ui = [
+                                'value'     => $data.fieldData.account_number_required.value,
+                                'field'     => 'account_number_required',
+                                'label'     => 'Require Account Number',
+                                'required'  => $data.fieldRequired.account_number_required,
+                                'errorText' => 'Require Account Number is Required',
+                                'dataError' => $data.fieldFail.account_number_required
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Show Account # *}
+                            {$ui = [
+                                'value'     => $data.fieldData.invoice_show_account_number.value,
+                                'field'     => 'invoice_show_account_number',
+                                'label'     => 'Show Account # On Invoices',
+                                'required'  => $data.fieldRequired.invoice_show_account_number,
+                                'errorText' => 'Show Account # is Required',
+                                'dataError' => $data.fieldFail.invoice_show_account_number
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Show Invoice # *}
+                            {$ui = [
+                                'value'     => $data.fieldData.invoice_show_invoice_number.value,
+                                'field'     => 'invoice_show_invoice_number',
+                                'label'     => 'Show Invoice # On Invoices',
+                                'required'  => $data.fieldRequired.invoice_show_invoice_number,
+                                'errorText' => 'Show Invoice # is Required',
+                                'dataError' => $data.fieldFail.invoice_show_invoice_number
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Allow Membership Choice When Renewing *}
+                            {$ui = [
+                                'value'     => $data.fieldData.allow_membership_choice.value,
+                                'field'     => 'allow_membership_choice',
+                                'label'     => 'Allow Membership Choice When Renewing',
+                                'required'  => $data.fieldRequired.allow_membership_choice,
+                                'errorText' => 'Allow Membership Choice When Renewing is Required',
+                                'dataError' => $data.fieldFail.allow_membership_choice
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Allow Employees *}
+                            {$ui = [
+                                'value'     => $data.fieldData.allow_employees.value,
+                                'field'     => 'allow_employees',
+                                'label'     => 'Allow Employees',
+                                'required'  => $data.fieldRequired.allow_employees,
+                                'errorText' => 'Allow Employees is Required',
+                                'dataError' => $data.fieldFail.allow_employees
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Use Member Types in Invoice Types *}
+                            {$ui = [
+                                'value'     => $data.fieldData.member_types_enabled.value,
+                                'field'     => 'member_types_enabled',
+                                'label'     => 'Use Member Types in Invoice Types',
+                                'required'  => $data.fieldRequired.member_types_enabled,
+                                'errorText' => 'Use Member Types in Invoice Types is Required',
+                                'dataError' => $data.fieldFail.member_types_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Enable Quickbooks *}
+                            {$ui = [
+                                'value'     => $data.fieldData.quickbooks_enabled.value,
+                                'field'     => 'quickbooks_enabled',
+                                'label'     => 'Enable Quickbooks',
+                                'required'  => $data.fieldRequired.quickbooks_enabled,
+                                'errorText' => 'Enable Quickbooks is Required',
+                                'dataError' => $data.fieldFail.quickbooks_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Enable Members Billing Tab *}
+                            {$ui = [
+                                'value'     => $data.fieldData.member_billing_enabled.value,
+                                'field'     => 'member_billing_enabled',
+                                'label'     => 'Enable Members Billing Tab',
+                                'required'  => $data.fieldRequired.member_billing_enabled,
+                                'errorText' => 'Enable Members Billing Tab is Required',
+                                'dataError' => $data.fieldFail.member_billing_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Require Billing Fields *}
+                            {$ui = [
+                                'value'     => $data.fieldData.billing_fields_required.value,
+                                'field'     => 'billing_fields_required',
+                                'label'     => 'Require Billing Fields',
+                                'required'  => $data.fieldRequired.billing_fields_required,
+                                'errorText' => 'Require Billing Fields is Required',
+                                'dataError' => $data.fieldFail.billing_fields_required
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Enable Invoice Methods *}
+                            {$ui = [
+                                'value'     => $data.fieldData.invoice_methods_enabled.value,
+                                'field'     => 'invoice_methods_enabled',
+                                'label'     => 'Enable Invoice Methods',
+                                'required'  => $data.fieldRequired.invoice_methods_enabled,
+                                'errorText' => 'Enable Invoice Methods is Required',
+                                'dataError' => $data.fieldFail.invoice_methods_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Enable Billing Counties *}
+                            {$ui = [
+                                'value'     => $data.fieldData.billing_county_enabled.value,
+                                'field'     => 'billing_county_enabled',
+                                'label'     => 'Enable Billing Counties',
+                                'required'  => $data.fieldRequired.billing_county_enabled,
+                                'errorText' => 'Enable Billing Counties is Required',
+                                'dataError' => $data.fieldFail.billing_county_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Enable Billing Contact Name *}
+                            {$ui = [
+                                'value'     => $data.fieldData.billing_contact_name_enabled.value,
+                                'field'     => 'billing_contact_name_enabled',
+                                'label'     => 'Enable Billing Contact Name',
+                                'required'  => $data.fieldRequired.billing_contact_name_enabled,
+                                'errorText' => 'Enable Billing Contact Name is Required',
+                                'dataError' => $data.fieldFail.billing_contact_name_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+                            {* Create PDF Invoices *}
+                            {$ui = [
+                                'value'     => $data.fieldData.invoice_pdf_enabled.value,
+                                'field'     => 'invoice_pdf_enabled',
+                                'label'     => 'Create PDF Invoices',
+                                'required'  => $data.fieldRequired.invoice_pdf_enabled,
+                                'errorText' => 'Create PDF Invoices is Required',
+                                'dataError' => $data.fieldFail.invoice_pdf_enabled
+                            ]}
+                            {include file='ui/f6/checkbox.html'}
+
+
+                        </fieldset>
                     </div>
                 </div>
+            </div>
 
-            </li>
+        </li>
 
-        </ul>
+    </ul>
 
-        <button class="button button-primary" type="submit" style="margin-top: 0;">Save</button>
+    <button class="button button-primary" type="submit" style="margin-top: 0;">Save</button>
 
-        {include file='ui/f6/errorCallout.html'}
+    {include file='ui/f6/errorCallout.html'}
 
-    </form>
+</form>
 
-    <div class="tabs-panel" id="panel2">
-        <p>Payment Types</p>
-    </div>
-    <div class="tabs-panel" id="panel3">
-        <p>Notifications</p>
-    </div>
+<div class="tabs-panel" id="panel2">
+    <p>Payment Types</p>
+</div>
+<div class="tabs-panel" id="panel3">
+    <p>Notifications</p>
+</div>
 {* </div> *}
 {include file='ui/f6/grid-end.html'}