From: Steve Sutton Date: Thu, 29 Mar 2018 12:57:48 +0000 (-0400) Subject: More styles for form. Bug fix for invoice creation. X-Git-Tag: v1.0.0^2~98 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5787678de074a7a485270d18604458cc58a60529;p=WP-Plugins%2Fglm-member-db-billing.git More styles for form. Bug fix for invoice creation. When creating invoice for one with emploees make sure not to overwrite the account_id variable. Styles for the renew form to have half columns. --- diff --git a/classes/billingSupport.php b/classes/billingSupport.php index 2eec0c2..a8942a6 100644 --- a/classes/billingSupport.php +++ b/classes/billingSupport.php @@ -373,6 +373,7 @@ class GlmBillingSupport // Get all transactions for this account. $transactions = $this->getTransactionsByAccount( $account_id ); + // echo '
$transactions: ' . print_r( $transactions, true ) . '
'; // For each transaction get the data (payment_data or invoice_data) foreach ( $transactions as $key => &$transaction ) { @@ -683,7 +684,7 @@ class GlmBillingSupport * @access public * @return void */ - function generateInvoiceHtml( $data, $viewFile ) + public function generateInvoiceHtml( $data, $viewFile ) { // If a view file is specified @@ -739,7 +740,7 @@ class GlmBillingSupport } - public function getInvoicTypeById( $id ) + public function getInvoiceTypeById( $id ) { return $this->wpdb->get_row( $this->wpdb->prepare( @@ -821,7 +822,7 @@ class GlmBillingSupport // Need also to get the members type to look up which invoice_type to use $invoice_type_id = $this->getMembersInvoiceTypeByRefDest( $member_id ); if ( $invoice_type_id ) { - $invoice = $this->getInvoicTypeById( $invoice_type_id ); + $invoice = $this->getInvoiceTypeById( $invoice_type_id ); } $accounts[$billing_account['id']] = array( 'id' => $billing_account['id'], @@ -877,7 +878,7 @@ class GlmBillingSupport $invoice_id = $this->wpdb->insert_id; // Add the line item for from the member invoice // First get this invoice_type - $new_member_invoice_type = $this->getInvoicTypeById( $renew_type_id ); + $new_member_invoice_type = $this->getInvoiceTypeById( $renew_type_id ); $this->createLineItemForInvoice( array( 'invoice_id' => $invoice_id, @@ -893,17 +894,17 @@ class GlmBillingSupport if ( $invoice_id ) { if ( isset( $employees ) && is_array( $employees ) ) { // Add line items for each employee. - foreach ( $employees as $account_id ) { - if ( $employee_data[$account_id]['invoice'] ) { + foreach ( $employees as $acc_id ) { + if ( $employee_data[$acc_id]['invoice'] ) { $this->createLineItemForInvoice( array( 'invoice_id' => $invoice_id, - 'line_item_type' => $employee_data[(int)$account_id]['invoice']['id'], - 'name' => $employee_data[(int)$account_id]['invoice']['name'], - 'amount' => $employee_data[(int)$account_id]['invoice']['amount'], + 'line_item_type' => $employee_data[(int)$acc_id]['invoice']['id'], + 'name' => $employee_data[(int)$acc_id]['invoice']['name'], + 'amount' => $employee_data[(int)$acc_id]['invoice']['amount'], 'due_date' => $due_date, - 'recurring' => $employee_data[(int)$account_id]['invoice']['recurring'], - 'recurrence' => $employee_data[(int)$account_id]['invoice']['recurrence'], + 'recurring' => $employee_data[(int)$acc_id]['invoice']['recurring'], + 'recurrence' => $employee_data[(int)$acc_id]['invoice']['recurrence'], ) ); } diff --git a/css/admin.css b/css/admin.css index ecb293a..62a38f9 100644 --- a/css/admin.css +++ b/css/admin.css @@ -27,7 +27,7 @@ /* glm-billing-form */ .glm-billing-form { margin: 10px 0; - max-width: 300px; + max-width: 400px; padding: 20px 12px 10px 20px; font-size: .813rem; } @@ -37,10 +37,22 @@ margin: 3px 0 0 0; } .glm-billing-label { + width: 100%; font-weight; bold; padding: 0; margin: 3px 0 0 0; } +.glm-billing-left-half { + width: 49%; + float: left; + margin: 3px 3px 0 0; +} +.glm-billing-right-half { + width: 49%; + float: left; + margin: 3px 0 0 3px; + clear: right; +} .glm-billing-input { padding: 3px 0; } @@ -58,6 +70,7 @@ .glm-billing-input input[type=email], .glm-billing-input textarea, .glm-billing-input select{ + height: 2rem; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; diff --git a/models/admin/member/billing.php b/models/admin/member/billing.php index f29e71d..20322d1 100644 --- a/models/admin/member/billing.php +++ b/models/admin/member/billing.php @@ -200,7 +200,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $member_invoice_id = $BillingSupport->getMembersInvoiceTypeByRefDest( $this->memberID ); if ( $member_invoice_id ) { - $member_invoice = $BillingSupport->getInvoicTypeById( $member_invoice_id ); + $member_invoice = $BillingSupport->getInvoiceTypeById( $member_invoice_id ); } // echo '
$member_invoice: ' . print_r( $member_invoice, true ) . '
'; @@ -226,7 +226,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $member_invoice_id = $BillingSupport->getMembersInvoiceTypeByRefDest( $this->memberID ); if ( $member_invoice_id ) { - $member_invoice = $BillingSupport->getInvoicTypeById( $member_invoice_id ); + $member_invoice = $BillingSupport->getInvoiceTypeById( $member_invoice_id ); } else { $error = true; } @@ -234,7 +234,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $employees = $BillingSupport->getListOfAccountEmployees( $this->memberID ); $invoice_data = array( - 'account_id' => filter_var( $_REQUEST['account_id'], FILTER_VALIDATE_INT ), + 'account_id' => $accountID, 'renew_type_id' => filter_var( $_REQUEST['member_renewing'], FILTER_VALIDATE_INT ), 'amount' => $_REQUEST['total_renew_amount'], 'due_date' => date( 'Y-m-d' ), @@ -264,7 +264,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $member_invoice_id = $BillingSupport->getMembersInvoiceTypeByRefDest( $this->memberID ); if ( $member_invoice_id ) { - $member_invoice = $BillingSupport->getInvoicTypeById( $member_invoice_id ); + $member_invoice = $BillingSupport->getInvoiceTypeById( $member_invoice_id ); } // Get a list of this accounts employees. If they have any. @@ -279,7 +279,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling $account = $Accounts->editEntry( $accountID ); } else { // Do the Payment Processing. - $errors = $BillingSupport->processMemberRenewal( $invoice_data['account_id'], $invoice_id, $invoice_data['amount'], $invoice_data['employees'] ); + $errors = $BillingSupport->processMemberRenewal( $accountID, $invoice_id, $invoice_data['amount'], $invoice_data['employees'] ); // echo '
$errors: ' . print_r( $errors, true ) . '
'; } diff --git a/views/admin/billing/renew.html b/views/admin/billing/renew.html index c769e90..c9b28c8 100644 --- a/views/admin/billing/renew.html +++ b/views/admin/billing/renew.html @@ -24,13 +24,11 @@ {if $member_invoice}
-
- Member Renewing +
+ Membership Class
-
+
First Name
@@ -78,7 +76,7 @@
-
+
Last Name
@@ -94,7 +92,7 @@
-
+
City
@@ -102,7 +100,7 @@
-
+
State / Province
@@ -138,7 +136,7 @@ {if isset($smarty.request.cc_name) && $smarty.request.cc_name}value="{$smarty.request.cc_name}"{/if} />
-
+
Card Type
@@ -152,7 +150,7 @@
-
+
Card Number
@@ -166,7 +164,7 @@ {if isset($smarty.request.cc_numb) && $smarty.request.cc_numb}value="{$smarty.request.cc_numb}"{/if} />
-
+
Card Expiration
@@ -180,7 +178,7 @@ {if isset($smarty.request.cc_exp) && $smarty.request.cc_exp}value="{$smarty.request.cc_exp}"{/if} />
-
+
C V V