From: Steve Sutton Date: Fri, 15 Mar 2019 13:51:18 +0000 (-0400) Subject: Update logo size in invoice X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=314dc04bcce87c2af069f065801e23bef20dae32;p=WP-Plugins%2Fglm-member-db-billing.git Update logo size in invoice update the renewal form --- diff --git a/lib/GlmPDFInvoice.php b/lib/GlmPDFInvoice.php index f495d8b..0814e65 100644 --- a/lib/GlmPDFInvoice.php +++ b/lib/GlmPDFInvoice.php @@ -408,7 +408,7 @@ class GlmPDFInvoice extends Cezpdf $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 diff --git a/models/admin/ajax/billingAccount.php b/models/admin/ajax/billingAccount.php index 988021a..adfbfe2 100644 --- a/models/admin/ajax/billingAccount.php +++ b/models/admin/ajax/billingAccount.php @@ -130,7 +130,7 @@ class GlmMembersAdmin_ajax_billingAccount extends GlmDataAccounts 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 @@ -140,9 +140,10 @@ class GlmMembersAdmin_ajax_billingAccount extends GlmDataAccounts 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 ); diff --git a/models/front/billing/renew.php b/models/front/billing/renew.php index 775f477..012e401 100644 --- a/models/front/billing/renew.php +++ b/models/front/billing/renew.php @@ -166,9 +166,10 @@ class GlmMembersFront_billing_renew // extends GlmDataBilling $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 @@ -219,10 +220,12 @@ class GlmMembersFront_billing_renew // extends GlmDataBilling $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(); } } diff --git a/views/front/billing/renew.html b/views/front/billing/renew.html index 3f11428..883f22a 100644 --- a/views/front/billing/renew.html +++ b/views/front/billing/renew.html @@ -135,6 +135,10 @@ jQuery(document).ready(function($){ // 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(); + } } }); } );