Updating uptra imports.
$wParts[] = "T.id IN (
SELECT account
FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoices
- WHERE balance > 0.00
+ WHERE balance > 0 AND balance IS NOT NULL
)";
$view = 'reports';
break;
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 = '';
}
switch ( $option2 ) {
- case 'import':
+ case 'verify':
require_once GLM_MEMBERS_BILLING_PLUGIN_PATH.'/models/admin/management/importBillingData.php';
// die('here');
break;
// Connect to their live database.
$dbh = new PDO(
- 'pgsql: host=ds4.gaslightmedia.com dbname=uptravel user=nobody',
+ 'pgsql: host=ds5.gaslightmedia.com dbname=uptravel user=nobody',
null,
null,
array(
$BillingSupport = new GlmBillingSupport( $this->wpdb, $this->config );
// Connect to their live database.
$dbh = new PDO(
- 'pgsql: host=localhost dbname=uptravel user=postgres password=tweety',
+ 'pgsql: host=ds5 dbname=uptravel user=postgres',
null,
null,
array(
$importResults = '';
// Get records.
-$sqlWhere = "
- WHERE invoice_id IN (
- SELECT invoice_id
- FROM members.billing
- WHERE billing_type = 1
- AND transaction_time >= '2017-01-01'
- ORDER BY transaction_date,transaction_time)
- AND billing_type IN (1,2,3)
-";
+$sqlWhere = "";
+// $sqlWhere = "
+// WHERE invoice_id IN (
+// SELECT invoice_id
+// FROM members.billing
+// WHERE billing_type = 1
+// -- AND transaction_time >= '2017-01-01'
+// ORDER BY transaction_date,transaction_time)
+// AND billing_type IN (1,2,3)
+// ";
$mainSql = "
SELECT *
FROM members.billing
--- /dev/null
+<?php
+/**
+ * Verify Billing Data (UPTRA)
+ */
+// For billing support functions
+require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/billingSupport.php';
+$BillingSupport = new GlmBillingSupport( $this->wpdb, $this->config );
+// Connect to their live database.
+$dbh = new PDO(
+ 'pgsql: host=ds5 dbname=uptravel user=postgres',
+ null,
+ null,
+ array(
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
+ )
+);
+
+$dbh->setAttribute(
+ PDO::ATTR_ERRMODE,
+ PDO::ERRMODE_EXCEPTION
+);
+
+if ( isset( $_REQUEST['start'] ) && $start = filter_var( $_REQUEST['start'], FILTER_VALIDATE_INT ) ) {
+} else {
+ $start = 0;
+}
+
+$importResults = '';
+
+// Get records.
+$query = "
+SELECT id,name
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members
+ WHERE id in ( SELECT DISTINCT ref_dest
+ FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts )
+LIMIT 20 OFFSET 0";
+
+$results = $this->wpdb->get_results( $query, ARRAY_A );
+
+$importResults .= '<pre>$results: ' . print_r( $results, true ) . '</pre>';
+
+
+foreach ( $results as $row ) {
+ $account_id = $BillingSupport->getAccountByRefDest( $row['id'] );
+ echo '<pre>$account_id: ' . print_r( $account_id, true ) . '</pre>';
+}
class="glm-settings-tab nav-tab{if $option == 'importAccounts'} nav-tab-active{/if}">Import Accounts</a>
<a href="{$thisUrl}?page=glm-members-admin-menu-management&glm_action=billing&option=importBillingData"
class="glm-settings-tab nav-tab{if $option == 'importBillingData'} nav-tab-active{/if}">Import Billing Data</a>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-management&glm_action=billing&option=verifyBillingData"
+ class="glm-settings-tab nav-tab{if $option == 'verifyBillingData'} nav-tab-active{/if}">Verify Billing Data</a>
</h2>
--- /dev/null
+{include file='admin/management/header.html'}
+
+{include file='admin/management/subHeader.html'}
+
+{if $importResults}
+ {$importResults}
+{else}
+ <form action="{$thisUrl}?page={$thisPage}" method="post">
+
+ <input type="hidden" name="glm_action" value="billing" />
+ <input type="hidden" name="option" value="verifyBillingData" />
+ <input type="hidden" name="option2" value="verify" />
+
+ <table class="glm-admin-table glm-settings-table">
+
+ <tr>
+ <td><input type="submit" value="Verify Billing Data" /></td>
+ </tr>
+
+ </table>
+ </form>
+{/if}
+
+
+{include file='admin/management/footer.html'}