Had to add some fields to the database for accounts table.
Figure this would be the best place to put in billing address.
This way I can pull this data to put in the invoice.
$line_items = $this->getLineItemsForInvoice( $invoice_id );
// echo '<pre>$line_items: ' . print_r( $line_items, true ) . '</pre>';
// echo '<pre>$this->config: ' . print_r( $this->config['settings'], true ) . '</pre>';
+ $account = $this->getAccountById( $invoice['account'] );
+ // echo '<pre>$account: ' . print_r( $account, true ) . '</pre>';
$templateData = array(
'settings' => $this->config['settings'],
'invoice' => $invoice,
'line_items' => $line_items,
- 'member' => array( 'member_name' => 'Member Name here' )
+ 'account' => $account,
);
$invoiceHtml = $this->generateInvoiceHtml( $templateData, 'admin/billing/invoiceStore.html' );
- echo '<pre>$invoiceHtml: ' . print_r( $invoiceHtml, true ) . '</pre>';
+ // echo '<pre>$invoiceHtml: ' . print_r( $invoiceHtml, true ) . '</pre>';
+ return $invoiceHtml;
+ }
+
+ public function getMemberInfo()
+ {
+
}
/**
'required' => true,
),
+ // Billing Address 1
+ 'billing_addr1' => array(
+ 'field' => 'billing_addr1',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
+ // Billing Address 2
+ 'billing_addr2' => array(
+ 'field' => 'billing_addr2',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
+ // Billing City
+ 'billing_city' => array(
+ 'field' => 'billing_city',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
+ // Billing State
+ 'billing_state' => array(
+ 'field' => 'billing_state',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
+ // Billing Zip
+ 'billing_zip' => array(
+ 'field' => 'billing_zip',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
+ // Billing Phone
+ 'billing_phone' => array(
+ 'field' => 'billing_phone',
+ 'type' => 'text',
+ 'use' => 'a',
+ 'required' => false,
+ ),
+
);
* version from this plugin.
*/
define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.3');
+define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.4');
// 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');
$invoiceTypes = false;
$invoiceTypeJSON = '';
$accounts = false;
+ $invoiceHtml = '';
// Get any provided option
if (isset($_REQUEST['option'])) {
// Now we have a total for the invoice we can record the transaction
$BillingSupport = new GlmBillingSupport( $this->wpdb, $this->config );
- // echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
+ $invoiceHtml = $BillingSupport->viewInvoice( $_REQUEST['id'] );
- $BillingSupport->viewInvoice( $_REQUEST['id'] );
+ // Set the file name for the view file.
+ $view = 'viewInvoice';
- wp_die( 'fun' );
break;
case 'delete':
'invoiceTypeJSON' => $invoiceTypeJSON,
'invoiceTypes' => $invoiceTypes,
'accounts' => $accounts,
+ 'invoiceHtml' => $invoiceHtml,
);
// Return status, any suggested view, and any data to controller
+++ /dev/null
--- Gaslight Media Billing Module
--- File Created: 11/08/2017
--- Database Version: 0.0.3
--- 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,
- ref_dest INT NOT NULL, -- reference to member id
- ref_name TINYTEXT NOT NULL, -- Name of reference member
- anniversary_date DATE NOT NULL, -- anniversary date - used for main invoice generation
- payment_data TEXT NULL, -- stored payment data
- email TINYTEXT NULL, -- billing email
- PRIMARY KEY (id)
-);
-
-----
-
--- 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)
-);
-
-----
-
--- Invoices
-CREATE TABLE {prefix}invoices (
- id INT NOT NULL AUTO_INCREMENT,
- transaction_time DATETIME NOT NULL, -- datetime for the invoice
- account INT NOT NULL, -- ref to account id
- amount_total DECIMAL(8, 2) NOT NULL, -- total amount for invoice
- balance DECIMAL(8, 2) NOT NULL, -- balance for this invoice
- due_date DATE NOT NULL, -- Due date for this invoice
- paid BOOLEAN DEFAULT '0', -- true/false if invoice is paid
- notes TINYTEXT, -- notes for this invoice
- recurring BOOLEAN DEFAULT '0', -- true/false if recurring
- recurrence INT NULL DEFAULT 0, -- recurrence type
- PRIMARY KEY (id)
-);
-
-----
-
--- 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
- amount DECIMAL(8,2) NOT NULL DEFAULT '0.00', -- amount
- recurring BOOLEAN DEFAULT '0', -- true/false if recurring
- recurrence INT NULL DEFAULT 0, -- recurrence type
- PRIMARY KEY (id)
-);
-
-----
-
--- Line Items
-CREATE TABLE {prefix}line_items (
- id INT NOT NULL AUTO_INCREMENT,
- invoice INT NOT NULL, -- reference to invoice
- line_item_type INT NOT NULL, -- reference to line item type
- name TEXT NOT NULL, -- line item name
- amount DECIMAL(8,2) DEFAULT '0.00', -- line item amount per item
- quantity INT DEFAULT 1, -- quantity
- recurring BOOLEAN DEFAULT '0', -- true/false if recurring
- recurrence INT NULL DEFAULT 0, -- recurrence type
- PRIMARY KEY (id)
-);
-
-----
-
--- payments
-CREATE TABLE {prefix}payments (
- id INT NOT NULL AUTO_INCREMENT,
- transaction_time DATETIME NOT NULL, -- datetime of payment
- account INT NOT NULL, -- ref to account table
- amount DECIMAL(8, 2) NOT NULL, -- payment amount
- payment_method TINYTEXT NOT NULL, -- payment method
- payment_data TINYTEXT NULL, -- additional payment info
- PRIMARY KEY (id)
-);
-
-----
-
--- pdfs
-CREATE TABLE {prefix}pdfs (
- id INT NOT NULL AUTO_INCREMENT,
- ref_type INT NOT NULL, -- reference type
- ref_dest INT NOT NULL, -- reference types id
- pdf MEDIUMTEXT NOT NULL, -- saved pdf
- PRIMARY KEY (id)
-);
-
-----
-
--- Notification Types
-CREATE TABLE {prefix}notification_types (
- id INT NOT NULL AUTO_INCREMENT,
- name TINYTEXT NOT NULL, -- name
- from_header TINYTEXT NOT NULL, -- from headers
- replyto TINYTEXT NULL, -- reply-to headers
- subject TINYTEXT NOT NULL, -- Subject
- message TEXT NOT NULL, -- Message
- send_by_date BOOLEAN NULL DEFAULT '0', -- true/false send by date based on due date
- send_by_action BOOLEAN NULL DEFAULT '0', -- send notice based on an action
- send_action INT NULL DEFAULT 0, -- (create invoice or receive payment)
- send_date_number INT NULL DEFAULT 0, -- number to apply to send by date
- send_date_period INT NULL DEFAULT 0, -- (days,weeks,months,years)
- send_date_when INT NULL DEFAULT 0, -- (before or after)
- PRIMARY KEY (id)
-);
-
-----
-
--- Notifications
-CREATE TABLE {prefix}notifications (
- id INT NOT NULL AUTO_INCREMENT,
- notification_type INT NOT NULL, -- ref to notification type
- account INT NOT NULL, -- ref to account
- from_replyto TINYTEXT NOT NULL, -- from reply-to header
- subject TEXT NOT NULL, -- subject
- message TEXT NOT NULL, -- message
- date_sent DATETIME NOT NULL, -- Date the notice was sent
- email_sent TINYTEXT NOT NULL, -- email used
- PRIMARY KEY (id)
-);
-
-----
-
--- 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)
-);
-
-----
-
--- Settings
-CREATE TABLE {prefix}settings (
- id INT NOT NULL AUTO_INCREMENT,
- company_logo TINYTEXT NULL,
- company_logo_height INT NULL,
- company_name TINYTEXT NULL,
- company_name2 TINYTEXT NULL,
- company_addr1 TINYTEXT NULL,
- company_addr2 TINYTEXT NULL,
- company_city TINYTEXT NULL,
- company_state TINYTEXT NULL,
- company_zip TINYTEXT NULL,
- company_phone TINYTEXT NULL,
- company_email TINYTEXT NULL,
- company_url TINYTEXT NULL,
- PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Settings entry
-INSERT INTO {prefix}settings
- ( id )
- VALUES
- ( 1 );
-
-----
-
--- 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, -- Creadit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
- cc_accepts SMALLINT NULL, -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
- -- Authorize.net Credentials
- authorize_net_login TINYTEXT NULL,
- authorize_net_key TINYTEXT NULL,
- authorize_net_test TINYINT NULL, -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
- authorize_net_conf BOOLEAN NULL, -- Flag to send payment confirmation Email from Authorize.net
- authorize_net_merchant_email TINYTEXT NULL, -- E-Mail Authorize.net will send copy of confirmation E-Mail
- -- Merchant Solutions Credentials
- merchant_solutions_acctid TINYTEXT NULL, -- Merchant Solutions credentials
- merchant_solutions_merchantpin TINYTEXT NULL,
- merchant_solutions_test TINYINT NULL, -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
- merchant_solutions_conf BOOLEAN NULL, -- Flag to send payment confirmation Email
- merchant_solutions_merchant_email TINYTEXT NULL, -- Merchant Solutions will send copy of confirmation E-Mail
- PRIMARY KEY (id)
-);
-
-----
-
--- Set default billing Management entry
-INSERT INTO {prefix}management
- ( id )
- VALUES
- ( 1 );
--- /dev/null
+-- Gaslight Media Billing Module
+-- File Created: 11/08/2017
+-- Database Version: 0.0.3
+-- 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,
+ ref_dest INT NOT NULL, -- reference to member id
+ ref_name TINYTEXT NOT NULL, -- Name of reference member
+ billing_addr1 TINYTEXT NULL, -- Billing Address 1
+ billing_addr2 TINYTEXT NULL, -- Billing Address 2
+ billing_city TINYTEXT NULL, -- Billing City
+ billing_state TINYTEXT NULL, -- Billing State
+ billing_zip TINYTEXT NULL, -- Billing Zip
+ billing_phone TINYTEXT NULL, -- Billing Phone
+ anniversary_date DATE NOT NULL, -- anniversary date - used for main invoice generation
+ payment_data TEXT NULL, -- stored payment data
+ email TINYTEXT NULL, -- billing email
+ PRIMARY KEY (id)
+);
+
+----
+
+-- 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)
+);
+
+----
+
+-- Invoices
+CREATE TABLE {prefix}invoices (
+ id INT NOT NULL AUTO_INCREMENT,
+ transaction_time DATETIME NOT NULL, -- datetime for the invoice
+ account INT NOT NULL, -- ref to account id
+ amount_total DECIMAL(8, 2) NOT NULL, -- total amount for invoice
+ balance DECIMAL(8, 2) NOT NULL, -- balance for this invoice
+ due_date DATE NOT NULL, -- Due date for this invoice
+ paid BOOLEAN DEFAULT '0', -- true/false if invoice is paid
+ notes TINYTEXT, -- notes for this invoice
+ recurring BOOLEAN DEFAULT '0', -- true/false if recurring
+ recurrence INT NULL DEFAULT 0, -- recurrence type
+ PRIMARY KEY (id)
+);
+
+----
+
+-- 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
+ amount DECIMAL(8,2) NOT NULL DEFAULT '0.00', -- amount
+ recurring BOOLEAN DEFAULT '0', -- true/false if recurring
+ recurrence INT NULL DEFAULT 0, -- recurrence type
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Line Items
+CREATE TABLE {prefix}line_items (
+ id INT NOT NULL AUTO_INCREMENT,
+ invoice INT NOT NULL, -- reference to invoice
+ line_item_type INT NOT NULL, -- reference to line item type
+ name TEXT NOT NULL, -- line item name
+ amount DECIMAL(8,2) DEFAULT '0.00', -- line item amount per item
+ quantity INT DEFAULT 1, -- quantity
+ recurring BOOLEAN DEFAULT '0', -- true/false if recurring
+ recurrence INT NULL DEFAULT 0, -- recurrence type
+ PRIMARY KEY (id)
+);
+
+----
+
+-- payments
+CREATE TABLE {prefix}payments (
+ id INT NOT NULL AUTO_INCREMENT,
+ transaction_time DATETIME NOT NULL, -- datetime of payment
+ account INT NOT NULL, -- ref to account table
+ amount DECIMAL(8, 2) NOT NULL, -- payment amount
+ payment_method TINYTEXT NOT NULL, -- payment method
+ payment_data TINYTEXT NULL, -- additional payment info
+ PRIMARY KEY (id)
+);
+
+----
+
+-- pdfs
+CREATE TABLE {prefix}pdfs (
+ id INT NOT NULL AUTO_INCREMENT,
+ ref_type INT NOT NULL, -- reference type
+ ref_dest INT NOT NULL, -- reference types id
+ pdf MEDIUMTEXT NOT NULL, -- saved pdf
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Notification Types
+CREATE TABLE {prefix}notification_types (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NOT NULL, -- name
+ from_header TINYTEXT NOT NULL, -- from headers
+ replyto TINYTEXT NULL, -- reply-to headers
+ subject TINYTEXT NOT NULL, -- Subject
+ message TEXT NOT NULL, -- Message
+ send_by_date BOOLEAN NULL DEFAULT '0', -- true/false send by date based on due date
+ send_by_action BOOLEAN NULL DEFAULT '0', -- send notice based on an action
+ send_action INT NULL DEFAULT 0, -- (create invoice or receive payment)
+ send_date_number INT NULL DEFAULT 0, -- number to apply to send by date
+ send_date_period INT NULL DEFAULT 0, -- (days,weeks,months,years)
+ send_date_when INT NULL DEFAULT 0, -- (before or after)
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Notifications
+CREATE TABLE {prefix}notifications (
+ id INT NOT NULL AUTO_INCREMENT,
+ notification_type INT NOT NULL, -- ref to notification type
+ account INT NOT NULL, -- ref to account
+ from_replyto TINYTEXT NOT NULL, -- from reply-to header
+ subject TEXT NOT NULL, -- subject
+ message TEXT NOT NULL, -- message
+ date_sent DATETIME NOT NULL, -- Date the notice was sent
+ email_sent TINYTEXT NOT NULL, -- email used
+ PRIMARY KEY (id)
+);
+
+----
+
+-- 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)
+);
+
+----
+
+-- Settings
+CREATE TABLE {prefix}settings (
+ id INT NOT NULL AUTO_INCREMENT,
+ company_logo TINYTEXT NULL,
+ company_logo_height INT NULL,
+ company_name TINYTEXT NULL,
+ company_name2 TINYTEXT NULL,
+ company_addr1 TINYTEXT NULL,
+ company_addr2 TINYTEXT NULL,
+ company_city TINYTEXT NULL,
+ company_state TINYTEXT NULL,
+ company_zip TINYTEXT NULL,
+ company_phone TINYTEXT NULL,
+ company_email TINYTEXT NULL,
+ company_url TINYTEXT NULL,
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Settings entry
+INSERT INTO {prefix}settings
+ ( id )
+ VALUES
+ ( 1 );
+
+----
+
+-- 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, -- Creadit Cart payment processing methods available - Bitmap - see proc_method in plugin.ini
+ cc_accepts SMALLINT NULL, -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
+ -- Authorize.net Credentials
+ authorize_net_login TINYTEXT NULL,
+ authorize_net_key TINYTEXT NULL,
+ authorize_net_test TINYINT NULL, -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
+ authorize_net_conf BOOLEAN NULL, -- Flag to send payment confirmation Email from Authorize.net
+ authorize_net_merchant_email TINYTEXT NULL, -- E-Mail Authorize.net will send copy of confirmation E-Mail
+ -- Merchant Solutions Credentials
+ merchant_solutions_acctid TINYTEXT NULL, -- Merchant Solutions credentials
+ merchant_solutions_merchantpin TINYTEXT NULL,
+ merchant_solutions_test TINYINT NULL, -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
+ merchant_solutions_conf BOOLEAN NULL, -- Flag to send payment confirmation Email
+ merchant_solutions_merchant_email TINYTEXT NULL, -- Merchant Solutions will send copy of confirmation E-Mail
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Set default billing Management entry
+INSERT INTO {prefix}management
+ ( id )
+ VALUES
+ ( 1 );
'0.0.1' => array('version' => '0.0.1', 'tables' => 10),
'0.0.2' => array('version' => '0.0.2', 'tables' => 11),
'0.0.3' => array('version' => '0.0.3', 'tables' => 12),
+ '0.0.4' => array('version' => '0.0.4', 'tables' => 12),
);
--- /dev/null
+-- Gaslight Media Billing Database
+-- File Created: 12/20/2017
+-- Database Version: 0.0.4
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Add fields for billing addr1
+ALTER TABLE {prefix}accounts ADD billing_addr1 TINYTEXT NULL;
+
+----
+
+-- Add fields for billing addr2
+ALTER TABLE {prefix}accounts ADD billing_addr2 TINYTEXT NULL;
+
+----
+
+-- Add fields for billing city
+ALTER TABLE {prefix}accounts ADD billing_city TINYTEXT NULL;
+
+----
+
+-- Add fields for billing state
+ALTER TABLE {prefix}accounts ADD billing_state TINYTEXT NULL;
+
+----
+
+-- Add fields for billing zip
+ALTER TABLE {prefix}accounts ADD billing_zip TINYTEXT NULL;
+
+----
+
+-- Add fields for billing phone
+ALTER TABLE {prefix}accounts ADD billing_phone TINYTEXT NULL;
</td>
</tr>
+ <tr>
+ <th {if $account.fieldRequired.billing_addr1} class="glm-required"}{/if}>Billing Address 1</th>
+ <td {if $account.fieldFail.billing_addr1}class="glm-form-bad-input" data-tabid="glm-billing-addr1"{/if}>
+ <input type="text" name="billing_addr1" value="{$account.fieldData.billing_addr1}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_addr1}<p>{$account.fieldFail.billing_addr1}</p>{/if}<br>
+ </td>
+ </tr>
+
+ <tr>
+ <th {if $account.fieldRequired.billing_addr2} class="glm-required"}{/if}>Billing Address2</th>
+ <td {if $account.fieldFail.billing_addr2}class="glm-form-bad-input" data-tabid="glm-billing-addr2"{/if}>
+ <input type="text" name="billing_addr2" value="{$account.fieldData.billing_addr2}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_addr2}<p>{$account.fieldFail.billing_addr2}</p>{/if}<br>
+ </td>
+ </tr>
+
+ <tr>
+ <th {if $account.fieldRequired.billing_city} class="glm-required"}{/if}>Billing City</th>
+ <td {if $account.fieldFail.billing_city}class="glm-form-bad-input" data-tabid="glm-billing-city"{/if}>
+ <input type="text" name="billing_city" value="{$account.fieldData.billing_city}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_city}<p>{$account.fieldFail.billing_city}</p>{/if}<br>
+ </td>
+ </tr>
+
+ <tr>
+ <th {if $account.fieldRequired.billing_state} class="glm-required"}{/if}>Billing State</th>
+ <td {if $account.fieldFail.billing_state}class="glm-form-bad-input" data-tabid="glm-billing-state"{/if}>
+ <input type="text" name="billing_state" value="{$account.fieldData.billing_state}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_state}<p>{$account.fieldFail.billing_state}</p>{/if}<br>
+ </td>
+ </tr>
+
+ <tr>
+ <th {if $account.fieldRequired.billing_zip} class="glm-required"}{/if}>Billing Zip</th>
+ <td {if $account.fieldFail.billing_zip}class="glm-form-bad-input" data-tabid="glm-billing-zip"{/if}>
+ <input type="text" name="billing_zip" value="{$account.fieldData.billing_zip}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_zip}<p>{$account.fieldFail.billing_zip}</p>{/if}<br>
+ </td>
+ </tr>
+
+ <tr>
+ <th {if $account.fieldRequired.billing_phone} class="glm-required"}{/if}>Billing Phone</th>
+ <td {if $account.fieldFail.billing_phone}class="glm-form-bad-input" data-tabid="glm-billing-phone"{/if}>
+ <input type="text" name="billing_phone" value="{$account.fieldData.billing_phone}" class="glm-form-text-input-medium">
+ {if $account.fieldFail.billing_phone}<p>{$account.fieldFail.billing_phone}</p>{/if}<br>
+ </td>
+ </tr>
+
<tr>
<td colspan="2">
<input class="button button-primary" type="submit" value="{if $haveAccount}Save{else}Create{/if} Account">
<html>
<head>
<style>
-
+ #container-table {
+ border: solid lightgrey 1px;
+ }
+ #container-table .line-items {
+ border-collapse: collapse;
+ }
+ #container-table .line-items tr {
+ /* border: solid green 1px; */
+ }
+ #container-table .line-items tr td {
+ /* border: solid green 1px; */
+ }
</style>
</head>
<body>
- <table id="container-table">
+ <table id="container-table" width="800">
<tr>
- <td><!-- Logo --></td>
- <td><!-- Invoice date/memberbilling# --></td>
+ <td>LOGO<!-- Logo --></td>
+ <td width="120">
+ <table width="100%">
+ <tr>
+ <th align="right"> Date: </th>
+ <td align="right"> {$invoice.transaction_time|date_format:"%D"} </td>
+ </tr>
+ <tr>
+ <th align="right"> Billing #: </th>
+ <td align="right"> {$invoice.account} </td>
+ </tr>
+ </table>
+
+ <!-- Invoice date/memberbilling# --></td>
</tr>
<tr>
- <td colspan="2"> <!-- Billing Invoice Settings --> </td>
+ <td colspan="2">
+ <!-- Billing Invoice Settings -->
+ {$settings.company_name}<br>
+ {if $settings.company_name2}{$settings.company_name2}<br>{/if}
+ {if $settings.company_addr1}{$settings.company_addr1}<br>{/if}
+ {if $settings.company_addr2}{$settings.company_addr2}<br>{/if}
+ {if $settings.company_city}{$settings.company_city} {$settings.company_state}, {$settings.company_zip}<br>{/if}
+ {if $settings.company_phone}{$settings.company_phone}<br>{/if}
+ {if $settings.company_email}{$settings.company_email}<br>{/if}
+ {if $settings.company_url}{$settings.company_url}<br>{/if}
+ </td>
</tr>
<tr>
<td colspan="2">
- Bill To:
+ <strong>Bill To:</strong><br>
+ {if $account.billing_name2}{$account.billing_name2}<br>{/if}
+ {if $account.billing_addr1}{$account.billing_addr1}<br>{/if}
+ {if $account.billing_addr2}{$account.billing_addr2}<br>{/if}
+ {if $account.billing_city}{$account.billing_city} {$account.billing_state}, {$account.billing_zip}<br>{/if}
+ {if $account.billing_phone}{$account.billing_phone}<br>{/if}
+
<!-- Billing Settings -->
</td>
</tr>
<tr>
- <table>
- <thead>
- <tr>
- <th>Date</th>
- <th>Description</th>
- <th>Amount</th>
- <th>Balance</th>
- </tr>
- </thead>
- <tbody>
+ <td colspan="2">
+ <table class="line-items" width="100%">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Description</th>
+ <th>Qty</th>
+ <th>Amount</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ {foreach $line_items as $item}
+ <td align="right" width="80">{$invoice.transaction_time|date_format:"%D"}</td>
+ <td align="center">{$item.name}</td>
+ <td align="right" width="10">{$item.quantity}</td>
+ <td align="right" width="60">{$item.amount}</td>
+ {/foreach}
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ Payment Terms: blah blah blah
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center">Please return Coupon Below with Payment</td>
+ </tr>
+ <tr>
+ <td colspan="2"><hr></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table width="100%">
<tr>
- <td><!-- date --></td>
- <td><!-- description --></td>
- <td><!-- amount --></td>
- <td><!-- balance --></td>
+ <td>
+ {$settings.company_name}<br>
+ {if $settings.company_name2}{$settings.company_name2}<br>{/if}
+ {if $settings.company_addr1}{$settings.company_addr1}<br>{/if}
+ {if $settings.company_addr2}{$settings.company_addr2}<br>{/if}
+ {if $settings.company_city}{$settings.company_city} {$settings.company_state}, {$settings.company_zip}<br>{/if}
+ {if $settings.company_phone}{$settings.company_phone}<br>{/if}
+ {if $settings.company_email}{$settings.company_email}<br>{/if}
+ {if $settings.company_url}{$settings.company_url}<br>{/if}
+ <br>
+ {if $account.billing_name2}{$account.billing_name2}<br>{/if}
+ {if $account.billing_addr1}{$account.billing_addr1}<br>{/if}
+ {if $account.billing_addr2}{$account.billing_addr2}<br>{/if}
+ {if $account.billing_city}{$account.billing_city} {$account.billing_state}, {$account.billing_zip}<br>{/if}
+ {if $account.billing_phone}{$account.billing_phone}<br>{/if}
+ </td>
+ <td width="200" valign="top">
+ <table>
+ <tr>
+ <th align="right">Please Pay:</th>
+ <td align="right">{$invoice.balance}</td>
+ </tr>
+ <tr>
+ <th align="right">Payment Amount:</th>
+ <td align="right"><input type="text" size="5"></td>
+ </tr>
+ <tr>
+ <th align="right"> Billing #: </th>
+ <td align="right"> {$invoice.account} </td>
+ </tr>
+ </table>
+ </td>
</tr>
- </tbody>
- </table>
+ </table>
+ </td>
</tr>
</table>
</body>
--- /dev/null
+{include file='admin/billing/header.html'}
+
+{include file='admin/billing/subHeader.html'}
+
+{$invoiceHtml}
+
+{include file='admin/footer.html'}