$this->ezImage(
GLM_MEMBERS_PLUGIN_MEDIA_PATH . '/images/large/' . $this->config['settings']['company_logo'], // image
0, // padding
- 260, // width
+ 130, // width
'none', // resize
'left', // justification
'', // angle
if ( isset( $_REQUEST['account_number'] ) && $account_number = filter_var( $_REQUEST['account_number'], FILTER_SANITIZE_STRING ) ) {
$account = $this->wpdb->get_row(
$this->wpdb->prepare(
- "SELECT id,ref_dest
+ "SELECT id,ref_dest,invoice_type
FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
WHERE account_number = %s",
$account_number
trigger_error( print_r( $account, E_USER_NOTICE ) );
if ( $account ) {
$return = array(
- 'status' => true,
- 'member_id' => $account['id'],
- 'account_id' => $account['ref_dest'],
+ 'status' => true,
+ 'member_id' => (int)$account['id'],
+ 'account_id' => (int)$account['ref_dest'],
+ 'invoice_type' => (int)$account['invoice_type'],
);
} else {
$return = array( 'status' => false );
$option = $_REQUEST['option'];
}
+ $Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
+
if ( isset( $memberID ) && $memberID ) {
require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataAccounts.php';
- $Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
$accountID = $this->wpdb->get_var(
$this->wpdb->prepare(
"SELECT id
$Management = new GlmDataBillingManagement( $this->wpdb, $this->config );
$management = $Management->getEntry( 1 );
+ require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataAccounts.php';
if ( $accountID ) {
// Need to see if there's an account for this member.
- require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataAccounts.php';
$account = $Accounts->editEntry( $accountID );
+ } else {
+ $account = $Accounts->newEntry();
}
}
// Set the account and member inputs
$('#account_id').val( msg.account_id );
$('#member_id').val( msg.member_id );
+ if ( msg.invoice_type ) {
+ $('input[name=member_renewing], input[value=' + msg.invoice_type + ']').prop('checked', true);
+ getPageTotal();
+ }
}
});
} );