DB update and redo uptravel payment form.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 17 Dec 2018 18:32:00 +0000 (13:32 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 17 Dec 2018 18:32:00 +0000 (13:32 -0500)
New uptra payment form (simplified).
New field for payment notes.
New field for uptra_payment_form boolean.

17 files changed:
classes/data/dataManagement.php
classes/data/dataPayments.php
config/plugin.ini
index.php
models/admin/billing/invoices.php
models/admin/member/billing.php
setup/databaseScripts/create_database_V0.0.30.sql [deleted file]
setup/databaseScripts/create_database_V0.0.31.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.31.sql [new file with mode: 0644]
todo.txt
views/admin/billing/invoices.html
views/admin/billing/makePayment.html
views/admin/billing/makePaymentAdjustment.html [new file with mode: 0644]
views/admin/billing/memberBillingSubHeader.html
views/admin/billing/statements.html
views/admin/management/billing.html

index 5bb8f29..d50d3b0 100644 (file)
@@ -225,6 +225,13 @@ class GlmDataBillingManagement extends GlmDataAbstract
                 'use'   => 'a',
             ),
 
+            // Use uptra invoice template
+            'uptravel_payment_form' => array(
+                'field' => 'uptravel_payment_form',
+                'type'  => 'checkbox',
+                'use'   => 'a',
+            ),
+
         );
 
     }
index cb0d548..c563b25 100644 (file)
@@ -169,6 +169,13 @@ class GlmDataPayments extends GlmDataAbstract
                 'use'     => 'a',
             ),
 
+            // Payment Notes / Comments
+            'notes' => array(
+                'field'   => 'notes',
+                'type'    => 'text',
+                'use'     => 'a',
+            ),
+
          );
 
 
index ca91c40..b11daca 100644 (file)
@@ -24,6 +24,13 @@ payment_method[20] = "Credit Card"
 payment_method[30] = "Cash"
 payment_method[40] = "Other"
 
+; Alternate Payment Methods
+alt_payment_method[10] = "Check"
+alt_payment_method[20] = "Credit Card"
+alt_payment_method[30] = "Cash"
+alt_payment_method[40] = "Other"
+alt_payment_method[50] = "Adjustment"
+
 ; Recurrences
 recurrence[10] = "Monthly"
 recurrence[20] = "Yearly"
index 92114a1..27fb5cf 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@
  *  version from this plugin.
  */
 define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.16');
-define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.30');
+define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.31');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_BILLING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
index 32d8dcd..05bfa59 100644 (file)
@@ -673,6 +673,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices
             'filterOverdue'       => $filterOverdue,
             'counties'            => $counties,
             'paymentTypes'        => $paymentTypes,
+            'billing_settings'    => $this->config['billing_settings'],
         );
 
         // Return status, any suggested view, and any data to controller
index b87e6f7..c0d70c6 100644 (file)
@@ -709,6 +709,36 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
             $view = 'makePayment';
 
             break;
+
+        case 'makepaymentadjustment':
+            $view = 'makePaymentAdjustment';
+
+            // Get unpaid invoices
+            $invoices = $BillingSupport->getUnPaidInvoicesByAccount( $accountID );
+
+            // Need to see if there's an account for this member.
+            $account = $Accounts->editEntry( $accountID );
+
+            break;
+
+        case 'createMemberPayment':
+            $view           = 'paymentProcess';
+            $account_id     = filter_var( $_REQUEST['account_id'], FILTER_VALIDATE_INT );
+            $amount         = filter_var( $_REQUEST['amount'], FILTER_VALIDATE_FLOAT );
+            $payment_method = filter_var( $_REQUEST['payment_method'], FILTER_VALIDATE_INT );
+            $payment_data   = filter_var( $_REQUEST['payment_data'], FILTER_SANITIZE_STRING );
+            $invoices       = filter_var( $_REQUEST['invoices'], FILTER_VALIDATE_INT, array( 'flags' => FILTER_REQUIRE_ARRAY ) );
+            echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
+
+            if ( $account_id && $amount && $payment_method && $payment_data && !empty( $invoices ) ) {
+                // Create new payment.
+                $payment_id = $BillingSupport->createPayment( $account_id, $amount, $this->config['alt_payment_method'][$payment_method], $payment_data );
+
+                // Record the payment.
+                $BillingSupport->recordPayment( $payment_id, $account_id, $amount, $invoices );
+            }
+            break;
+
         case 'list':
             $view = 'statements';
             // echo '<pre>$test: ' . print_r( $test, true ) . '</pre>';
@@ -761,6 +791,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
             'account_status'     => $account_status,
             'accounts'           => $accounts,
             'invoiceTypes'       => $invoiceTypes,
+            'paymentMethods'     => $this->config['alt_payment_method']
         );
 
         // Return status, any suggested view, and any data to controller.
diff --git a/setup/databaseScripts/create_database_V0.0.30.sql b/setup/databaseScripts/create_database_V0.0.30.sql
deleted file mode 100644 (file)
index f18b8b9..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
--- Gaslight Media Billing Module
--- File Created: 11/19/2018
--- Database Version: 0.0.27
--- Database Creation Script
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
---
--- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
---
-
--- Billing Accounts
-CREATE TABLE {prefix}accounts (
-    id INT NOT NULL AUTO_INCREMENT,
-    archived BOOLEAN DEFAULT '0',                          -- Marks account as archived
-    ref_dest INT NOT NULL,                                 -- reference to member id
-    ref_name TINYTEXT NOT NULL,                            -- Name of reference member
-    invoice_type INT NOT NULL DEFAULT '0',                 -- Ref to Invoice Type id
-    billing_contact_name TINYTEXT NULL,                    -- Billing Contact Name
-    billing_fname TINYTEXT NULL,                           -- Billing First Name
-    billing_lname TINYTEXT NULL,                           -- Billing Last Name
-    billing_company TINYTEXT NULL,                         -- Billing Company Name
-    billing_position TINYTEXT NULL,                        -- Billing Title/Position
-    billing_addr1 TINYTEXT NULL,                           -- Billing Address 1
-    billing_addr2 TINYTEXT NULL,                           -- Billing Address 2
-    billing_city TINYTEXT NULL,                            -- Billing City
-    billing_county INT NULL,                               -- Billing County
-    billing_state TINYTEXT NULL,                           -- Billing State
-    billing_zip TINYTEXT NULL,                             -- Billing Zip
-    billing_country TINYTEXT NULL,                         -- Billing Country
-    billing_phone TINYTEXT NULL,                           -- Billing Phone
-    billing_fax TINYTEXT NULL,                             -- Billing Fax
-    anniversary_date DATE NULL,                            -- anniversary date
-    renewal_date DATE NULL,                                -- renewal date of account
-    payment_data TEXT NULL,                                -- stored payment data
-    customer_profile_id TINYTEXT NULL,                     -- Customer Profile Id (Authorize.net)
-    payment_profile_id TINYTEXT NULL,                      -- Payment Profile Id (Authorize.net)
-    payment_profile_card TINYTEXT NULL,                    -- Payment Profile Card (Authorize.net)
-    email TINYTEXT NULL,                                   -- billing email
-    boss BOOLEAN DEFAULT '0',                              -- Boss flag
-    account_number TINYTEXT NULL,                          -- Account Number
-    email_invoice BOOLEAN DEFAULT '0',                     -- Invoice by email
-    usmail_invoice BOOLEAN DEFAULT '0',                    -- Invoice by US Mail
-    fax_invoice BOOLEAN DEFAULT '0',                       -- Invoice by Fax
-    PRIMARY KEY (id),
-    INDEX(ref_dest),
-    INDEX(ref_name(20)),
-    INDEX(email(20)),
-    INDEX(invoice_type),
-    INDEX(renewal_date),
-    INDEX(billing_county)
-);
-
-----
-
--- transactions
-CREATE TABLE {prefix}transactions (
-    id INT NOT NULL AUTO_INCREMENT,
-    type INT NOT NULL,                                     -- type of transaction (payment,invoice,etc)
-    type_id INT NOT NULL,                                  -- reference to type id
-    account INT NOT NULL,                                  -- reference to account id
-    transaction_time DATETIME NOT NULL,                    -- datetime for the transaction
-    current_invoice_total DECIMAL(8, 2) NOT NULL,          -- invoice total
-    current_payment_total DECIMAL(8, 2) NOT NULL,          -- payment total
-    PRIMARY KEY (id),
-    INDEX(account),
-    INDEX(type_id),
-    INDEX(transaction_time)
-);
-
-----
-
--- Invoices
-CREATE TABLE {prefix}invoices (
-    id INT NOT NULL AUTO_INCREMENT,
-    transaction_time DATETIME NOT NULL,                    -- datetime for the invoice
-    account INT NOT NULL,                                  -- ref to account id
-    amount_total DECIMAL(8, 2) NOT NULL,                   -- total amount for invoice
-    balance DECIMAL(8, 2) NOT NULL,                        -- balance for this invoice
-    due_date DATE NOT NULL,                                -- Due date for this invoice
-    paid BOOLEAN DEFAULT '0',                              -- true/false if invoice is paid
-    notes TINYTEXT,                                        -- notes for this invoice
-    renewal BOOLEAN DEFAULT '0',                           -- true/false if a renewal
-    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
-    recurrence INT NULL DEFAULT 0,                         -- recurrence type
-    PRIMARY KEY (id),
-    INDEX(account),
-    INDEX(transaction_time),
-    INDEX(due_date)
-);
-
-----
-
--- Line Item Types
-CREATE TABLE {prefix}invoice_types (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TINYTEXT NOT NULL,                                -- name
-    parent INT NOT NULL DEFAULT 0,                         -- 0 if top level otherwise ref to another line_item_type as it's parent
-    member_type INT NOT NULL DEFAULT 0,                    -- Member Type assigned Default 0
-    amount DECIMAL(8,2) NOT NULL DEFAULT '0.00',           -- amount
-    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
-    recurrence INT NULL DEFAULT 0,                         -- recurrence type
-    dynamic_amount BOOLEAN DEFAULT '0',                    -- true/false if amount is dynamic
-    qcode TINYTEXT NULL,                                   -- qcode for quickbooks
-    category TINYTEXT NULL,                                -- quickbooks category
-    PRIMARY KEY (id)
-);
-
-----
-
--- Line Items
-CREATE TABLE {prefix}line_items (
-    id INT NOT NULL AUTO_INCREMENT,
-    invoice INT NOT NULL,                                  -- reference to invoice
-    line_item_type INT NOT NULL,                           -- reference to line item type
-    account INT NULL DEFAULT 0,                            -- ref to account id (renewal or employee)
-    name TEXT NOT NULL,                                    -- line item name
-    amount DECIMAL(8,2) DEFAULT '0.00',                    -- line item amount per item
-    quantity INT DEFAULT 1,                                -- quantity
-    total DECIMAL(8,2) DEFAULT '0.00',                     -- line item total
-    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
-    recurrence INT NULL DEFAULT 0,                         -- recurrence type
-    created DATE NULL,                                     -- Date this line item was first created
-    first_due_date DATE NULL,                              -- The first due date for this item
-    next_due_date DATE NULL,                               -- Next Due Date for this item
-    PRIMARY KEY (id),
-    INDEX(account),
-    INDEX(created),
-    INDEX(first_due_date),
-    INDEX(next_due_date)
-);
-
-----
-
--- payments
-CREATE TABLE {prefix}payments (
-    id INT NOT NULL AUTO_INCREMENT,
-    transaction_time DATETIME NOT NULL,                    -- datetime of payment
-    account INT NOT NULL,                                  -- ref to account table
-    amount DECIMAL(8, 2) NOT NULL,                         -- payment amount
-    payment_method TINYTEXT NOT NULL,                      -- payment method
-    payment_data TINYTEXT NULL,                            -- additional payment info
-    PRIMARY KEY (id)
-);
-
-----
-
--- pdfs
-CREATE TABLE {prefix}pdfs (
-    id INT NOT NULL AUTO_INCREMENT,
-    ref_type INT NOT NULL,                                 -- reference type
-    ref_dest INT NOT NULL,                                 -- reference types id
-    pdf MEDIUMTEXT NOT NULL,                               -- saved pdf
-    PRIMARY KEY (id)
-);
-
-----
-
--- Notification Types
-CREATE TABLE {prefix}notification_types (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TINYTEXT NOT NULL,                                -- name
-    to_email TINYTEXT NULL,                                -- To email
-    from_header TINYTEXT NOT NULL,                         -- from headers
-    replyto TINYTEXT NULL,                                 -- reply-to headers
-    subject TINYTEXT NOT NULL,                             -- Subject
-    message TEXT NOT NULL,                                 -- Message
-    send_by_date BOOLEAN NULL DEFAULT '0',                 -- true/false send by date based on due date
-    send_by_action BOOLEAN NULL DEFAULT '0',               -- send notice based on an action
-    send_action INT NULL DEFAULT 0,                        -- (create invoice or receive payment)
-    send_date_number INT NULL DEFAULT 0,                   -- number to apply to send by date
-    send_date_period INT NULL DEFAULT 0,                   -- (days,weeks,months,years)
-    send_date_when INT NULL DEFAULT 0,                     -- (before or after)
-    PRIMARY KEY (id)
-);
-
-----
-
--- Notifications
-CREATE TABLE {prefix}notifications (
-    id INT NOT NULL AUTO_INCREMENT,
-    notification_type INT NOT NULL,                        -- ref to notification type
-    account INT NOT NULL,                                  -- ref to account
-    from_replyto TINYTEXT NOT NULL,                        -- from reply-to header
-    subject TEXT NOT NULL,                                 -- subject
-    message TEXT NOT NULL,                                 -- message
-    date_sent DATETIME NOT NULL,                           -- Date the notice was sent
-    email_sent TINYTEXT NOT NULL,                          -- email used
-    PRIMARY KEY (id)
-);
-
-----
-
--- Notification Queue
-CREATE TABLE {prefix}notification_queue (
-    id INT NOT NULL AUTO_INCREMENT,
-    notification_type INT NOT NULL,                        -- ref to notification type
-    account INT NOT NULL,                                  -- ref to account
-    queued_time DATETIME NOT NULL,                         -- Creation time
-    processed_time DATETIME NULL,                          -- The time this queue was processed. (sent out)
-    PRIMARY KEY (id),
-    INDEX (notification_type),
-    INDEX (account),
-    INDEX (queued_time),
-    INDEX (processed_time)
-);
-
-----
-
--- Gateway Settings
-CREATE TABLE {prefix}gateway_settings (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TEXT NOT NULL,
-    login_id TINYTEXT NOT NULL,
-    transaction_key TINYTEXT NOT NULL,
-    PRIMARY KEY (id)
-);
-
-----
-
--- Invoice Payments
-CREATE TABLE {prefix}invoice_payments (
-    id INT NOT NULL AUTO_INCREMENT,
-    invoice INT NOT NULL,                                  -- reference to invoice id
-    payment INT NOT NULL,                                  -- reference to payment id
-    amount DECIMAL(8, 2) NOT NULL,                         -- payment amount
-    PRIMARY KEY (id),
-    INDEX(invoice)
-);
-
-----
-
--- Settings
-CREATE TABLE {prefix}settings (
-    id INT NOT NULL AUTO_INCREMENT,
-    company_logo TINYTEXT NULL,                            -- Image logo
-    company_logo_height INT NULL,                          -- Logo Height (only used if creating pdf)
-    company_name TINYTEXT NULL,                            -- Company Name
-    company_name2 TINYTEXT NULL,                           -- Company Name 2
-    company_addr1 TINYTEXT NULL,                           -- Company Address 1
-    company_addr2 TINYTEXT NULL,                           -- Company Address 2
-    company_city TINYTEXT NULL,                            -- Company City
-    company_state TINYTEXT NULL,                           -- Company State
-    company_zip TINYTEXT NULL,                             -- Company Zip
-    company_phone TINYTEXT NULL,                           -- Company Phone
-    company_email TINYTEXT NULL,                           -- Company Email
-    company_url TINYTEXT NULL,                             -- Company URL
-    payment_terms TEXT NULL,                               -- Payment Terms
-    days_before_renewal INT NULL,                          -- Number of days before renewal date to allow renewals
-    days_after_expired INT NULL,                           -- Number of days after renewal date expired
-    allow_membership_choice BOOLEAN DEFAULT '0',           -- If memberships can choose their membership levels when they renew
-    allow_employees BOOLEAN DEFAULT '0',                   -- If memberships have employees
-    member_types_enabled BOOLEAN DEFAULT '1',              -- member types determine invoice types
-    quickbooks_enabled BOOLEAN DEFAULT '0',                -- QuickBooks enabled
-    member_billing_enabled BOOLEAN DEFAULT '1',            -- Member have access to billing info tab
-    billing_fields_required BOOLEAN DEFAULT '1',           -- Require Billing Fields
-    invoice_methods_enabled BOOLEAN DEFAULT '1',           -- Enable Uptra invoice methods
-    renewal_day_static BOOLEAN DEFAULT '0',                -- Renewal dates are same day every year
-    renewal_day INT NULL,                                  -- Day of the month for renewals
-    renewal_month INT NULL,                                -- Month of year for renewals
-    billing_county_enabled BOOLEAN DEFAULT '0',            -- Billing uses county field
-    invoice_pdf_enabled BOOLEAN DEFAULT '0',               -- Create PDF invoices
-    billing_contact_name_enabled BOOLEAN DEFAULT '0',      -- Use billing_contact_name instead of fname lname
-    PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Settings entry
-INSERT INTO {prefix}settings
-    ( id, days_before_renewal ,days_after_expired, member_types_enabled, quickbooks_enabled, member_billing_enabled )
-    VALUES
-    ( 1, 90, 30, true, false, true );
-
-----
-
--- Management
-CREATE TABLE {prefix}management (
-    id INT NOT NULL AUTO_INCREMENT,
-    payment_methods SMALLINT NULL,                              -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
-    proc_methods SMALLINT NULL,                                 -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
-    cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
-    -- Authorize.net Credentials
-    authorize_net_login TINYTEXT NULL,
-    authorize_net_key TINYTEXT NULL,
-    authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
-    authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net
-    authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
-    -- Merchant Solutions Credentials
-    merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
-    merchant_solutions_merchantpin TINYTEXT NULL,
-    merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
-    merchant_solutions_conf BOOLEAN NULL,                       -- Flag to send payment confirmation Email
-    merchant_solutions_merchant_email TINYTEXT NULL,            -- Merchant Solutions will send copy of confirmation E-Mail
-    uptravel_invoice_template BOOLEAN DEFAULT '0',              -- Use uptravel template for invoices.
-    PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Management entry
-INSERT INTO {prefix}management
-    ( id )
-    VALUES
-    ( 1 );
-
-----
-
--- Employees table
-CREATE TABLE {prefix}employees (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NOT NULL,                                      -- Account Id
-    employee INT NOT NULL,                                     -- Employee Account Id
-    PRIMARY KEY (id)
-);
diff --git a/setup/databaseScripts/create_database_V0.0.31.sql b/setup/databaseScripts/create_database_V0.0.31.sql
new file mode 100644 (file)
index 0000000..7bbcb25
--- /dev/null
@@ -0,0 +1,317 @@
+-- Gaslight Media Billing Module
+-- File Created: 11/19/2018
+-- Database Version: 0.0.27
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+-- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
+--
+
+-- Billing Accounts
+CREATE TABLE {prefix}accounts (
+    id INT NOT NULL AUTO_INCREMENT,
+    archived BOOLEAN DEFAULT '0',                          -- Marks account as archived
+    ref_dest INT NOT NULL,                                 -- reference to member id
+    ref_name TINYTEXT NOT NULL,                            -- Name of reference member
+    invoice_type INT NOT NULL DEFAULT '0',                 -- Ref to Invoice Type id
+    billing_contact_name TINYTEXT NULL,                    -- Billing Contact Name
+    billing_fname TINYTEXT NULL,                           -- Billing First Name
+    billing_lname TINYTEXT NULL,                           -- Billing Last Name
+    billing_company TINYTEXT NULL,                         -- Billing Company Name
+    billing_position TINYTEXT NULL,                        -- Billing Title/Position
+    billing_addr1 TINYTEXT NULL,                           -- Billing Address 1
+    billing_addr2 TINYTEXT NULL,                           -- Billing Address 2
+    billing_city TINYTEXT NULL,                            -- Billing City
+    billing_county INT NULL,                               -- Billing County
+    billing_state TINYTEXT NULL,                           -- Billing State
+    billing_zip TINYTEXT NULL,                             -- Billing Zip
+    billing_country TINYTEXT NULL,                         -- Billing Country
+    billing_phone TINYTEXT NULL,                           -- Billing Phone
+    billing_fax TINYTEXT NULL,                             -- Billing Fax
+    anniversary_date DATE NULL,                            -- anniversary date
+    renewal_date DATE NULL,                                -- renewal date of account
+    payment_data TEXT NULL,                                -- stored payment data
+    customer_profile_id TINYTEXT NULL,                     -- Customer Profile Id (Authorize.net)
+    payment_profile_id TINYTEXT NULL,                      -- Payment Profile Id (Authorize.net)
+    payment_profile_card TINYTEXT NULL,                    -- Payment Profile Card (Authorize.net)
+    email TINYTEXT NULL,                                   -- billing email
+    boss BOOLEAN DEFAULT '0',                              -- Boss flag
+    account_number TINYTEXT NULL,                          -- Account Number
+    email_invoice BOOLEAN DEFAULT '0',                     -- Invoice by email
+    usmail_invoice BOOLEAN DEFAULT '0',                    -- Invoice by US Mail
+    fax_invoice BOOLEAN DEFAULT '0',                       -- Invoice by Fax
+    PRIMARY KEY (id),
+    INDEX(ref_dest),
+    INDEX(ref_name(20)),
+    INDEX(email(20)),
+    INDEX(invoice_type),
+    INDEX(renewal_date),
+    INDEX(billing_county)
+);
+
+----
+
+-- transactions
+CREATE TABLE {prefix}transactions (
+    id INT NOT NULL AUTO_INCREMENT,
+    type INT NOT NULL,                                     -- type of transaction (payment,invoice,etc)
+    type_id INT NOT NULL,                                  -- reference to type id
+    account INT NOT NULL,                                  -- reference to account id
+    transaction_time DATETIME NOT NULL,                    -- datetime for the transaction
+    current_invoice_total DECIMAL(8, 2) NOT NULL,          -- invoice total
+    current_payment_total DECIMAL(8, 2) NOT NULL,          -- payment total
+    PRIMARY KEY (id),
+    INDEX(account),
+    INDEX(type_id),
+    INDEX(transaction_time)
+);
+
+----
+
+-- Invoices
+CREATE TABLE {prefix}invoices (
+    id INT NOT NULL AUTO_INCREMENT,
+    transaction_time DATETIME NOT NULL,                    -- datetime for the invoice
+    account INT NOT NULL,                                  -- ref to account id
+    amount_total DECIMAL(8, 2) NOT NULL,                   -- total amount for invoice
+    balance DECIMAL(8, 2) NOT NULL,                        -- balance for this invoice
+    due_date DATE NOT NULL,                                -- Due date for this invoice
+    paid BOOLEAN DEFAULT '0',                              -- true/false if invoice is paid
+    notes TINYTEXT,                                        -- notes for this invoice
+    renewal BOOLEAN DEFAULT '0',                           -- true/false if a renewal
+    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
+    recurrence INT NULL DEFAULT 0,                         -- recurrence type
+    PRIMARY KEY (id),
+    INDEX(account),
+    INDEX(transaction_time),
+    INDEX(due_date)
+);
+
+----
+
+-- Line Item Types
+CREATE TABLE {prefix}invoice_types (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NOT NULL,                                -- name
+    parent INT NOT NULL DEFAULT 0,                         -- 0 if top level otherwise ref to another line_item_type as it's parent
+    member_type INT NOT NULL DEFAULT 0,                    -- Member Type assigned Default 0
+    amount DECIMAL(8,2) NOT NULL DEFAULT '0.00',           -- amount
+    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
+    recurrence INT NULL DEFAULT 0,                         -- recurrence type
+    dynamic_amount BOOLEAN DEFAULT '0',                    -- true/false if amount is dynamic
+    qcode TINYTEXT NULL,                                   -- qcode for quickbooks
+    category TINYTEXT NULL,                                -- quickbooks category
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Line Items
+CREATE TABLE {prefix}line_items (
+    id INT NOT NULL AUTO_INCREMENT,
+    invoice INT NOT NULL,                                  -- reference to invoice
+    line_item_type INT NOT NULL,                           -- reference to line item type
+    account INT NULL DEFAULT 0,                            -- ref to account id (renewal or employee)
+    name TEXT NOT NULL,                                    -- line item name
+    amount DECIMAL(8,2) DEFAULT '0.00',                    -- line item amount per item
+    quantity INT DEFAULT 1,                                -- quantity
+    total DECIMAL(8,2) DEFAULT '0.00',                     -- line item total
+    recurring BOOLEAN DEFAULT '0',                         -- true/false if recurring
+    recurrence INT NULL DEFAULT 0,                         -- recurrence type
+    created DATE NULL,                                     -- Date this line item was first created
+    first_due_date DATE NULL,                              -- The first due date for this item
+    next_due_date DATE NULL,                               -- Next Due Date for this item
+    PRIMARY KEY (id),
+    INDEX(account),
+    INDEX(created),
+    INDEX(first_due_date),
+    INDEX(next_due_date)
+);
+
+----
+
+-- payments
+CREATE TABLE {prefix}payments (
+    id INT NOT NULL AUTO_INCREMENT,
+    transaction_time DATETIME NOT NULL,                    -- datetime of payment
+    account INT NOT NULL,                                  -- ref to account table
+    amount DECIMAL(8, 2) NOT NULL,                         -- payment amount
+    payment_method TINYTEXT NOT NULL,                      -- payment method
+    payment_data TINYTEXT NULL,                            -- additional payment info
+    notes TEXT NULL,                                       -- Notes/Comments on the payment
+    PRIMARY KEY (id)
+);
+
+----
+
+-- pdfs
+CREATE TABLE {prefix}pdfs (
+    id INT NOT NULL AUTO_INCREMENT,
+    ref_type INT NOT NULL,                                 -- reference type
+    ref_dest INT NOT NULL,                                 -- reference types id
+    pdf MEDIUMTEXT NOT NULL,                               -- saved pdf
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Notification Types
+CREATE TABLE {prefix}notification_types (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NOT NULL,                                -- name
+    to_email TINYTEXT NULL,                                -- To email
+    from_header TINYTEXT NOT NULL,                         -- from headers
+    replyto TINYTEXT NULL,                                 -- reply-to headers
+    subject TINYTEXT NOT NULL,                             -- Subject
+    message TEXT NOT NULL,                                 -- Message
+    send_by_date BOOLEAN NULL DEFAULT '0',                 -- true/false send by date based on due date
+    send_by_action BOOLEAN NULL DEFAULT '0',               -- send notice based on an action
+    send_action INT NULL DEFAULT 0,                        -- (create invoice or receive payment)
+    send_date_number INT NULL DEFAULT 0,                   -- number to apply to send by date
+    send_date_period INT NULL DEFAULT 0,                   -- (days,weeks,months,years)
+    send_date_when INT NULL DEFAULT 0,                     -- (before or after)
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Notifications
+CREATE TABLE {prefix}notifications (
+    id INT NOT NULL AUTO_INCREMENT,
+    notification_type INT NOT NULL,                        -- ref to notification type
+    account INT NOT NULL,                                  -- ref to account
+    from_replyto TINYTEXT NOT NULL,                        -- from reply-to header
+    subject TEXT NOT NULL,                                 -- subject
+    message TEXT NOT NULL,                                 -- message
+    date_sent DATETIME NOT NULL,                           -- Date the notice was sent
+    email_sent TINYTEXT NOT NULL,                          -- email used
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Notification Queue
+CREATE TABLE {prefix}notification_queue (
+    id INT NOT NULL AUTO_INCREMENT,
+    notification_type INT NOT NULL,                        -- ref to notification type
+    account INT NOT NULL,                                  -- ref to account
+    queued_time DATETIME NOT NULL,                         -- Creation time
+    processed_time DATETIME NULL,                          -- The time this queue was processed. (sent out)
+    PRIMARY KEY (id),
+    INDEX (notification_type),
+    INDEX (account),
+    INDEX (queued_time),
+    INDEX (processed_time)
+);
+
+----
+
+-- Gateway Settings
+CREATE TABLE {prefix}gateway_settings (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TEXT NOT NULL,
+    login_id TINYTEXT NOT NULL,
+    transaction_key TINYTEXT NOT NULL,
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Invoice Payments
+CREATE TABLE {prefix}invoice_payments (
+    id INT NOT NULL AUTO_INCREMENT,
+    invoice INT NOT NULL,                                  -- reference to invoice id
+    payment INT NOT NULL,                                  -- reference to payment id
+    amount DECIMAL(8, 2) NOT NULL,                         -- payment amount
+    PRIMARY KEY (id),
+    INDEX(invoice)
+);
+
+----
+
+-- Settings
+CREATE TABLE {prefix}settings (
+    id INT NOT NULL AUTO_INCREMENT,
+    company_logo TINYTEXT NULL,                            -- Image logo
+    company_logo_height INT NULL,                          -- Logo Height (only used if creating pdf)
+    company_name TINYTEXT NULL,                            -- Company Name
+    company_name2 TINYTEXT NULL,                           -- Company Name 2
+    company_addr1 TINYTEXT NULL,                           -- Company Address 1
+    company_addr2 TINYTEXT NULL,                           -- Company Address 2
+    company_city TINYTEXT NULL,                            -- Company City
+    company_state TINYTEXT NULL,                           -- Company State
+    company_zip TINYTEXT NULL,                             -- Company Zip
+    company_phone TINYTEXT NULL,                           -- Company Phone
+    company_email TINYTEXT NULL,                           -- Company Email
+    company_url TINYTEXT NULL,                             -- Company URL
+    payment_terms TEXT NULL,                               -- Payment Terms
+    days_before_renewal INT NULL,                          -- Number of days before renewal date to allow renewals
+    days_after_expired INT NULL,                           -- Number of days after renewal date expired
+    allow_membership_choice BOOLEAN DEFAULT '0',           -- If memberships can choose their membership levels when they renew
+    allow_employees BOOLEAN DEFAULT '0',                   -- If memberships have employees
+    member_types_enabled BOOLEAN DEFAULT '1',              -- member types determine invoice types
+    quickbooks_enabled BOOLEAN DEFAULT '0',                -- QuickBooks enabled
+    member_billing_enabled BOOLEAN DEFAULT '1',            -- Member have access to billing info tab
+    billing_fields_required BOOLEAN DEFAULT '1',           -- Require Billing Fields
+    invoice_methods_enabled BOOLEAN DEFAULT '1',           -- Enable Uptra invoice methods
+    renewal_day_static BOOLEAN DEFAULT '0',                -- Renewal dates are same day every year
+    renewal_day INT NULL,                                  -- Day of the month for renewals
+    renewal_month INT NULL,                                -- Month of year for renewals
+    billing_county_enabled BOOLEAN DEFAULT '0',            -- Billing uses county field
+    invoice_pdf_enabled BOOLEAN DEFAULT '0',               -- Create PDF invoices
+    billing_contact_name_enabled BOOLEAN DEFAULT '0',      -- Use billing_contact_name instead of fname lname
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Settings entry
+INSERT INTO {prefix}settings
+    ( id, days_before_renewal ,days_after_expired, member_types_enabled, quickbooks_enabled, member_billing_enabled )
+    VALUES
+    ( 1, 90, 30, true, false, true );
+
+----
+
+-- Management
+CREATE TABLE {prefix}management (
+    id INT NOT NULL AUTO_INCREMENT,
+    payment_methods SMALLINT NULL,                              -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
+    proc_methods SMALLINT NULL,                                 -- Credit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
+    cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
+    -- Authorize.net Credentials
+    authorize_net_login TINYTEXT NULL,
+    authorize_net_key TINYTEXT NULL,
+    authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
+    authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net
+    authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
+    -- Merchant Solutions Credentials
+    merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
+    merchant_solutions_merchantpin TINYTEXT NULL,
+    merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
+    merchant_solutions_conf BOOLEAN NULL,                       -- Flag to send payment confirmation Email
+    merchant_solutions_merchant_email TINYTEXT NULL,            -- Merchant Solutions will send copy of confirmation E-Mail
+    uptravel_invoice_template BOOLEAN DEFAULT '0',              -- Use uptravel template for invoices.
+    uptravel_payment_form BOOLEAN DEFAULT '0',                  -- Use uptravel payment form style.
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Management entry
+INSERT INTO {prefix}management
+    ( id )
+    VALUES
+    ( 1 );
+
+----
+
+-- Employees table
+CREATE TABLE {prefix}employees (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NOT NULL,                                      -- Account Id
+    employee INT NOT NULL,                                     -- Employee Account Id
+    PRIMARY KEY (id)
+);
index 5276c44..7bb16c2 100644 (file)
@@ -44,5 +44,6 @@ $glmMembersBillingDbVersions = array(
     '0.0.28' => array('version' => '0.0.28', 'tables' => 15, 'date' => '11/27/2018'),
     '0.0.29' => array('version' => '0.0.29', 'tables' => 15, 'date' => '11/29/2018'),
     '0.0.30' => array('version' => '0.0.30', 'tables' => 15, 'date' => '12/04/2018'),
+    '0.0.31' => array('version' => '0.0.31', 'tables' => 15, 'date' => '12/17/2018'),
 );
 
diff --git a/setup/databaseScripts/update_database_V0.0.31.sql b/setup/databaseScripts/update_database_V0.0.31.sql
new file mode 100644 (file)
index 0000000..de8232c
--- /dev/null
@@ -0,0 +1,13 @@
+-- Gaslight Media Billing Database
+-- File Created: 12/17/2018
+-- Database Version: 0.0.31
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Update the accounts table
+ALTER TABLE {prefix}payments ADD notes TEXT NULL;
+
+----
+
+ALTER TABLE {prefix}management ADD uptravel_payment_form BOOLEAN DEFAULT '0';
index 386e8e2..1fee6d8 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -4,8 +4,8 @@ Additional features that need to be added to our billing plugin.
 
 Invoice type payment type with Dynamic amount. See how this was used.
 
-QIF (quickbooks) export?
-qcode entry for payment type (numeric)
+[x] QIF (quickbooks) export?
+[x] qcode entry for payment type (numeric)
 
 Invoicing:
 [x] Create Invoices (batch)
@@ -14,17 +14,21 @@ Invoicing:
 [x] -- Filter by county and category or member type
 [x]-Create labels
 [ ] -Send Email (invoices)
-[ ] Pro - Rate an invoice
+[ ] Ability to add adjustment
 [ ] Ability to edit an invoice
-[ ] Ability to delete an invoice
+[x] Ability to delete an invoice
+[ ] Ability to delete a payment
+[x] Redo payment form for Uptravel.com
+[x] Find all places where there's a link to make payment to check for option.
+
 
 Reports:
--Open Accounts
--Closed Accounts
--Account by Age
--Report Generator
--No Accounts
--All Accounts
+[x] Open Accounts
+[x] Closed Accounts
+[x] Account by Age
+[x] Report Generator
+[x] No Accounts
+[x] All Accounts
 
 [x] Make Payment:(might already be done)
 Donna used the payment form from the member edit section.
index aaea34a..ade476a 100644 (file)
                                 <a href="{$thisUrl}?page={$thisPage}&glm_action=invoices&option=view&id={$t.id}">View</a> |
                                 <a href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=createPDFInvoice&id={$t.id}">Print</a> |
                             </span>
-                            <span class="account-dashboard-link"> {if $t.paid.value}&nbsp;{else}
-                                <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepayment&member={$t.member_id}">Pay Invoice</a>{/if} |
+                            <span class="account-dashboard-link">
+                                {if $t.paid.value}
+                                    &nbsp;
+                                {else}
+                                    {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form}
+                                        <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepaymentadjustment&member={$t.member_id}">Make A Payment</a> |
+                                    {else}
+                                        <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&option=makepayment&member={$t.member_id}">Pay Invoice</a> |
+                                    {/if}
+                                {/if}
                             </span>
                             <span class="account-dashboard-link">
                                 <a onClick="return confirm('This will delete the invoice. This cannot be undone. Are you Sure?');" href="{$thisUrl}?page={$thisPage}&glm_action=invoices&option=delete&invoice_id={$t.id}">Delete</a>
index 9c0d945..1489ec4 100644 (file)
 
 
     <form id="PaymentForm" action="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makePayment" method="post">
-        <input type="hidden" name="page" value="{$thisPage}">
-        <input type="hidden" name="glm_action" value="billing">
-        <input type="hidden" name="option" value="createPayment">
-        <input type="hidden" name="member" value="{$memberID}">
-        <input type="hidden" name="account_id" value="{$account.fieldData.id}">
-        <input type="hidden" name="amount" value="" id="total_amount"/>
+        <input type="hidden" name="page" value="{$thisPage}" />
+        <input type="hidden" name="glm_action" value="billing" />
+        <input type="hidden" name="option" value="createPayment" />
+        <input type="hidden" name="member" value="{$memberID}" />
+        <input type="hidden" name="account_id" value="{$account.fieldData.id}" />
+        <input type="hidden" name="amount" value="" id="total_amount" />
 
 
             <!-- Call for billing section -->
diff --git a/views/admin/billing/makePaymentAdjustment.html b/views/admin/billing/makePaymentAdjustment.html
new file mode 100644 (file)
index 0000000..a0764f6
--- /dev/null
@@ -0,0 +1,94 @@
+{* makePaymentAdjustment *}
+{* This Form is used for uptravel billing member payments *}
+
+{include file='admin/member/header.html'}
+{include file='admin/billing/memberBillingSubHeader.html'}
+
+<div id="billing-payment-form" class="glm-billing-form">
+
+    {if $paymentSuccess}<span class="glm-notice glm-flash-updated">Payment Completed</span>{/if}
+    {if $paymentError}<span class="glm-notice glm-flash-updated">Error With Payment</span>{/if}
+
+    {if $messages}
+        {foreach $messages as $message}
+            <div class="">{$message}</div>
+        {/foreach}
+    {/if}
+
+    {if $invoices}
+        <form id="PaymentForm" action="{$thisUrl}?page={$thisPage}&glm_action=billing&option=createMemberPayment" method="post">
+
+            <input type="hidden" name="page" value="{$thisPage}" />
+            <input type="hidden" name="glm_action" value="billing" />
+            <input type="hidden" name="option" value="createMemberPayment" />
+            <input type="hidden" name="member" value="{$memberID}" />
+            <input type="hidden" name="account_id" value="{$account.fieldData.id}" />
+            <input type="hidden" name="amount" value="" id="total_amount" />
+
+            <div class="glm-billing-field">
+                <div class="glm-billing-label glm-required"> Select Invoice </div>
+                <div class="glm-billing-input">
+                    {if $invoices}
+                        {foreach $invoices as $invoice}
+                            <label>
+                                <input type="checkbox" name="invoices[]" data-amount="{$invoice.balance}" value="{$invoice.id}" checked />
+                                ${$invoice.balance} Due {$invoice.due_date}
+                            </label>
+                        {/foreach}
+                    {/if}
+                </div>
+            </div>
+
+            <div class="glm-billing-field">
+                <div class="glm-billing-label glm-required"> Amount </div>
+                <div class="glm-billing-input">
+                    <input name="amount" required />
+                </div>
+            </div>
+
+            <div class="glm-billing-field">
+                <div class="glm-billing-label glm-required"> Payment Method </div>
+                <div class="glm-billing-input">
+                    <select name="payment_method" required>
+                        <option value=""></option>
+                        {foreach $paymentMethods as $value => $label}
+                            <option value="{$value}">{$label}</option>
+                        {/foreach}
+                    </select>
+                </div>
+            </div>
+
+            <div class="glm-billing-field">
+                <div class="glm-billing-label"> Payment Details </div>
+                <div class="glm-billing-input">
+                    <input name="payment_data" />
+                </div>
+            </div>
+
+            <div class="glm-billing-field">
+                <div class="glm-billing-label"> Comment </div>
+                <div class="glm-billing-input">
+                    <textarea name="notes" style="height: 50px;"></textarea>
+                </div>
+            </div>
+
+            <input class="button button-primary" type="submit" value="Make Payment">
+
+        </form>
+    {else}
+
+        <p>You don't have any unpaid invoices!</p>
+
+    {/if}
+</div>
+
+<script>
+jQuery(document).ready(function($){
+
+    // Flash certain elements for a short time after display
+    $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+});
+</script>
+
+{include file='admin/footer.html'}
index d991ff6..7365fbb 100644 (file)
     <div class="glm-grid-item">
         <ul>
             <li>
-                <a
-                    href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=account"
-                    class="">Billing Info</a>
+                <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=account" class="">Billing Info</a>
             </li>
             <li>
-                <a
-                    href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}"
-                    class="">All Statements</a>
+                <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}" class="">All Statements</a>
             </li>
             {if ($account_status == 'Pending' || $account_status == 'Expired') && !apply_filters('glm-billing-account-has-renewal', true, $accountID )}
                 <li>
-                    <a
-                        href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=renew"
-                        class="">Membership Renewal</a>
+                    <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=renew" class="">Membership Renewal</a>
                 </li>
             {/if}
-            {if isset( $settings.renewal_day_static ) && $settings.renewal_day_static}
+            {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form}
                 <li>
                     <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=makepaymentadjustment">Make A Payment</a>
                 </li>
             {else}
                 <li>
-                    <a
-                        href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=makepayment"
-                        class="">Pay Invoices</a>
+                    <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$memberID}&option=makepayment" class="">Pay Invoices</a>
                 </li>
             {/if}
         </ul>
index 63e5311..dc0bbf9 100644 (file)
                         </td>
                         <td class="glm-shrink">${$transaction.transaction_data.amount_total}</td>
                         <td class="glm-shrink">${$transaction.transaction_data.balance}</td>
-                        <td class="glm-shrink">{if $transaction.transaction_data.paid}&nbsp;{else}<a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepayment&member={$memberID}">Pay Invoice</a>{/if}</td>
+                        <td class="glm-shrink">
+                        {if isset( $billing_settings.uptravel_payment_form ) && $billing_settings.uptravel_payment_form}
+                            {if $transaction.transaction_data.paid}&nbsp;{else}<a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepaymentadjustment&member={$memberID}">Make A Payment</a>{/if}
+                        {else}
+                            {if $transaction.transaction_data.paid}&nbsp;{else}<a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makepayment&member={$memberID}">Pay Invoice</a>{/if}
+                        {/if}
+                        </td>
                         <td class="glm-shrink"> <a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=view&member={$memberID}&id={$transaction.type_id}">View</a> </td>
                     </tr>
                 {* Payments *}
index 08954ac..a78250d 100644 (file)
                         </td>
                     </tr>
 
+                    <tr>
+                        <th style="text-align: right;" {if $regSettings.fieldRequired.uptravel_payment_form} class="glm-required"}{/if}>
+                        </th>
+                        <td>
+                            <input type="checkbox" name="uptravel_payment_form"{if $regSettings.fieldData.uptravel_payment_form.value} checked="checked"{/if}>
+                            Use UPTRA Payment Form
+                        </td>
+                    </tr>
+
                 </table>
                 <input type="submit" value="Update Settings" class="button-primary">