From: Steve Sutton Date: Fri, 9 Mar 2018 19:37:12 +0000 (-0500) Subject: WIP: Invoice page, Create Payment (member side) X-Git-Tag: v1.0.0^2~161 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=7338f757d68070f02e30214f735ff8f5048ecc34;p=WP-Plugins%2Fglm-member-db-billing.git WIP: Invoice page, Create Payment (member side) Fix issue with member billing payment page form not submitting. Worked on the select for new invoice types. Worked on adding new Account. Now setting the billing account field and setting the next_ann date to the due_date. --- diff --git a/classes/data/dataInvoiceTypes.php b/classes/data/dataInvoiceTypes.php index fed6141..a4f3d10 100644 --- a/classes/data/dataInvoiceTypes.php +++ b/classes/data/dataInvoiceTypes.php @@ -124,15 +124,15 @@ class GlmDataInvoiceTypes extends GlmDataAbstract // Parent - for adding, deleting and editing, has selection tables 'parent' => array( - 'field' => 'parent', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . 'invoice_types', - 'p_field' => 'name', - 'p_orderby' => 'name', - 'p_blank' => true, + 'field' => 'parent', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . 'invoice_types', + 'p_field' => 'name', + 'p_orderby' => 'name', + 'p_blank' => true, 'force_list' => true, - 'required' => false, - 'use' => 'a' + 'required' => false, + 'use' => 'a' ), // Amount 'amount' => array( @@ -145,7 +145,7 @@ class GlmDataInvoiceTypes extends GlmDataAbstract 'recurring' => array( 'field' => 'recurring', 'type' => 'checkbox', - 'default' => false, + // 'default' => false, 'use' => 'a', ), diff --git a/models/admin/ajax/account.php b/models/admin/ajax/account.php index 2d953af..c9347ed 100644 --- a/models/admin/ajax/account.php +++ b/models/admin/ajax/account.php @@ -88,6 +88,8 @@ class GlmMembersAdmin_ajax_account extends GlmDataAccounts $accountInsertError = true; $return = $account; } else { + // Get updated entry + $account = $this->getEntry( $account['fieldData']['id'] ); $accountAdded = true; $return = array( 'status' => true, @@ -100,8 +102,9 @@ class GlmMembersAdmin_ajax_account extends GlmDataAccounts $return = array(); foreach ( $accounts as $account ) { $return[] = array( - 'id' => $account['id'], - 'ref_name' => htmlspecialchars_decode( $account['ref_name'] ) + 'id' => $account['id'], + 'name' => htmlspecialchars_decode( $account['ref_name'] ), + 'ann' => htmlspecialchars_decode( $account['next_anniversary_date'] ) ); } @@ -119,7 +122,7 @@ class GlmMembersAdmin_ajax_account extends GlmDataAccounts foreach ( $nonAccountMembers as $members ) { $return[] = array( 'id' => $members['id'], - 'name' => htmlspecialchars_decode( $members['name'] ) + 'name' => htmlspecialchars_decode( $members['name'] ), ); } break; diff --git a/models/admin/ajax/invoiceTypes.php b/models/admin/ajax/invoiceTypes.php new file mode 100644 index 0000000..017e186 --- /dev/null +++ b/models/admin/ajax/invoiceTypes.php @@ -0,0 +1,124 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + +// Load Members data abstract +require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataInvoiceTypes.php'; + +/** + * This class performs the work of handling images passed to it via + * an AJAX call that goes through the WorPress AJAX Handler. + * + */ +class GlmMembersAdmin_ajax_invoiceTypes extends GlmDataInvoiceTypes +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This constructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for data class + parent::__construct(false, false); + + } + + /* + * Perform Model Action + * + * This model checks to see if the credentials passed in are correct. + * + * This model action does not return, it simply does it's work then calls die(); + * + * @param $actionData + * + * Output JSON string as response and does not return + */ + public function modelAction( $actionData = false ) + { + $return = false; + + $option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING ); + trigger_error( print_r( $_REQUEST, E_USER_NOTICE ) ); + + switch ( $option ) { + case 'add': + $invoiceType = $this->insertEntry(); + trigger_error( print_r( $invoiceType, E_USER_NOTICE ) ); + if ( !$invoiceType['status'] ) { + $accountInsertError = true; + $return = $invoiceType; + } else { + $accountAdded = true; + $return = array( + 'status' => true, + 'invoiceType' => $invoiceType['fieldData'] + ); + } + break; + case 'list': + // Get Data Class for Invoice Types + $InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config ); + + $invoiceTypes = $this->getList(); + // Sort the types by parent child + $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes); + $return = array(); + if ( isset( $invoiceTypes ) ) { + foreach ( $invoiceTypes as $invoiceType ) { + $invTypes[$invoiceType['id']] = array( + 'id' => $invoiceType['id'], + 'name' => $invoiceType['name'], + 'amount' => $invoiceType['amount'], + ); + } + $return = $invTypes; + // $invoiceTypeJSON = json_encode( $invTypes, JSON_NUMERIC_CHECK ); + } + break; + } + + header( 'Content-type:application/json;charset=utf-8', true ); + echo json_encode( $return, true ); + exit(); + } +} diff --git a/models/admin/billing/invoices.php b/models/admin/billing/invoices.php index 3046426..220adac 100644 --- a/models/admin/billing/invoices.php +++ b/models/admin/billing/invoices.php @@ -118,6 +118,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices $invoiceTypes = false; $invoiceTypeJSON = ''; $accounts = false; + $billingAccount = false; $nonAccountMembers = false; $invoiceHtml = ''; $fromDate = ''; @@ -144,6 +145,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes); // Need to get the accounts $Accounts = new GlmDataAccounts( $this->wpdb, $this->config ); + $billingAccount = $Accounts->newEntry(); $accounts = $Accounts->getList( '', 'ref_name' ); // echo '
$accounts: ' . print_r( $accounts, true ) . '
'; @@ -201,17 +203,21 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices 'created' => date('Y-m-d'), 'first_due_date' => $_REQUEST['due_date'], 'next_due_date' => $_REQUEST['due_date'], + 'recurring' => $invoiceType['recurring']['value'], + 'recurrence' => $invoiceType['recurrence'] ), array( - '%d', - '%d', - '%s', - '%s', - '%d', - '%d', - '%s', - '%s', - '%s', + '%d', // invoice + '%d', // line_item_type + '%s', // name + '%s', // amount + '%d', // quantity + '%d', // total + '%s', // created + '%s', // first_due_date + '%s', // next_due_date + '%d', // recurring + '%d', // recurrence ) ); } @@ -443,6 +449,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices 'invoiceTypeJSON' => $invoiceTypeJSON, 'invoiceTypes' => $invoiceTypes, 'accounts' => $accounts, + 'billingAccount' => $billingAccount, 'invoiceHtml' => $invoiceHtml, 'fromDate' => $fromDate, 'toDate' => $toDate, diff --git a/models/admin/settings/invoiceTypes.php b/models/admin/settings/invoiceTypes.php index 3df8d7a..d948c4d 100644 --- a/models/admin/settings/invoiceTypes.php +++ b/models/admin/settings/invoiceTypes.php @@ -111,6 +111,8 @@ class GlmMembersAdmin_settings_invoiceTypes extends GlmDataInvoiceTypes $id = $_REQUEST['id']-0; } + // echo '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; + // If there's an action option if (isset($_REQUEST['option'])) { diff --git a/setup/validActions.php b/setup/validActions.php index 0f97213..c83fa54 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -60,9 +60,10 @@ $glmMembersBillingAddOnValidActions = array( 'adminActions' => array( 'ajax' => array( - 'setupQueue' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, - 'runQueue' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, - 'account' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, + 'setupQueue' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, + 'runQueue' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, + 'account' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, + 'invoiceTypes' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, ), 'management' => array( 'billing' => GLM_MEMBERS_BILLING_PLUGIN_SLUG, diff --git a/views/admin/billing/editInvoice.html b/views/admin/billing/editInvoice.html index 0a5f6dc..6aea838 100644 --- a/views/admin/billing/editInvoice.html +++ b/views/admin/billing/editInvoice.html @@ -7,7 +7,7 @@ {if $invoiceInsertError}Notification Insert Error{/if} {if $invoiceAdded}Notification Added{/if} -
+
{if $invoice_id} @@ -49,10 +49,8 @@
- -
-
- + Add Line Item
+ Create New Line Item
@@ -76,6 +74,7 @@
+{* New Account Form - Dialog *}

* required

@@ -106,7 +105,19 @@ - Billing Address 1 + Billing First Name + + + + + + Billing Last Name + + + + + + Billing Address 1 @@ -118,19 +129,26 @@ - Billing City + Billing City - Billing State + Billing State - + - Billing Zip + Billing Zip @@ -158,14 +176,16 @@ {$parent = 0} {foreach $invoiceTypes as $inv} - {if $inv.parent.value == 0} - + {if $inv.parent.value == 0 && $parent != 0 && $inv.amount != '0.00'} + {/if} - {if $inv.amount != '0.00'} + {$parent = $inv.parent.value} + {if $inv.parent.value == 0 && $inv.amount != '0.00'} + + {else if ($inv.parent.value == 0 && $inv.amount == '0.00')} + + {else if ($inv.parent.value != 0)} - {/if} - {if $inv.parent.value == 0} - {/if} {/foreach} @@ -179,15 +199,28 @@
{* Add new Invoice Type (Custom Line Item) Form *}
-

* Required!

+

* Required!

- - + + + + + + - +
Line Item NameParent + +
Line Item Name
Amount
@@ -245,30 +278,38 @@ jQuery(document).ready(function($){ customLineItemDialog, // Dialog for the custom line item form, // The add line_item form newAccountForm, // New Account Form - line_item_type = $( 'select[name="line_item_type"]' ), // Line item type in the add line_item form - line_items = [], // Array holding line_items json objects - allFields = $( [] ).add( line_item_type ), // Array holding the form fields - add line_item form - ref_name = $( 'input[name="ref_name"' ), - anniversary_date = $( 'input[name="anniversary_date"' ), - renewal_date = $( 'input[name="renewal_date"' ), - email = $( 'input[name="email"' ), - billing_addr1 = $( 'input[name="billing_addr1"' ), - billing_addr2 = $( 'input[name="billing_addr2"' ), - billing_city = $( 'input[name="billing_city"' ), - billing_state = $( 'input[name="billing_state"' ), - billing_zip = $( 'input[name="billing_zip"' ), - billing_phone = $( 'input[name="billing_phone"' ), - lineTips = $('.validateTips'), - accountTips = $('.validateAccountTips'), - allAccountFields = $( [] ).add( ref_name ) .add( anniversary_date ) .add( renewal_date ) + line_item_type = $( 'select[name="line_item_type"]' ), // Line item type in the add line_item form + line_items = [], // Array holding line_items json objects + allFields = $( [] ).add( line_item_type ), // Array holding the form fields - add line_item form + ref_name = $( 'input[name="ref_name"' ), + anniversary_date = $( 'input[name="anniversary_date"' ), + renewal_date = $( 'input[name="renewal_date"' ), + email = $( 'input[name="email"' ), + billing_fname = $( 'input[name="billing_fname"' ), + billing_lname = $( 'input[name="billing_lname"' ), + billing_addr1 = $( 'input[name="billing_addr1"' ), + billing_addr2 = $( 'input[name="billing_addr2"' ), + billing_city = $( 'input[name="billing_city"' ), + billing_state = $( 'select[name="billing_state"' ), + billing_zip = $( 'input[name="billing_zip"' ), + billing_phone = $( 'input[name="billing_phone"' ), + customFieldName = $( 'input[name="cf_name"]' ), + customFieldAmount = $( 'input[name="cf_amount"]' ), + customFieldParent = $( 'select[name="cf_parent"]' ), + lineTips = $( '.validateTips' ), + accountTips = $( '.validateAccountTips' ), + customTips = $( '.validateCustomTips' ), + allAccountFields = $( [] ).add( ref_name ) .add( anniversary_date ) .add( renewal_date ) .add( email ) .add( billing_addr1 ) .add( billing_addr2 ) .add( billing_city ) - .add( billing_state ) .add( billing_zip ) + .add( billing_state ) .add( billing_zip ) .add( billing_fname ) .add( billing_lname ) .add( billing_phone ) , // Array holding the form fields - add line_item form - invoiceTypeJSON = $.parseJSON( '{$invoiceTypeJSON}' ); // Json object with all of the invoices types + allCustomFields = $([]).add( customFieldName ).add( customFieldAmount ).add( customFieldParent ), + invoiceTypeJSON = $.parseJSON( '{$invoiceTypeJSON}' ); // Json object with all of the invoices types // From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29 {literal} - var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; + var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; + var moneyRegex = /^[\d]+(\.\d{2})?$/; {/literal} /** @@ -323,7 +364,7 @@ jQuery(document).ready(function($){ valid = valid && checkRequired( line_item_type, lineTips, 'Invoice Type is required!' ); if ( valid ) { - console.log( 'line_item_type', line_item_type ); + // console.log( 'line_item_type', line_item_type ); var selectedLineItem = invoiceTypeJSON[line_item_type.val()]; // If selectedLineItem is undefined then we must be adding new line item if ( selectedLineItem == undefined ) { @@ -332,19 +373,7 @@ jQuery(document).ready(function($){ } else { // Check first to see if this line_item_type is already in line_items. if ( !isLineItem( selectedLineItem ) ) { - selectedLineItem.qty = parseInt(1); - line_items.push( selectedLineItem ); - $( '#invoice-line-items' ). append( '
' + - '
' + - '
' + selectedLineItem.name + '
' + - '
' + - '' + - '
' + - '' + - '' + - '' + - '$' + selectedLineItem.amount + '
' + - '
'); + addLineItemToInvoice( selectedLineItem ); } else { // Code here to add to quantity. selectedLineItem.qty++; @@ -358,6 +387,23 @@ jQuery(document).ready(function($){ return valid; } + function addLineItemToInvoice( lineItem ) + { + lineItem.qty = parseInt(1); + line_items.push( lineItem ); + $( '#invoice-line-items' ). append( '
' + + '
' + + '
' + lineItem.name + '
' + + '
' + + '' + + '
' + + '' + + '' + + '' + + '$' + lineItem.amount + '
' + + '
'); + } + // Add the price to the right of the new selection for add line item. $('#line_item_type').change(function(){ if ( $(this).val() == 'new' ) { @@ -398,7 +444,11 @@ jQuery(document).ready(function($){ valid = valid && checkRequired( ref_name, accountTips, 'Name is required!' ); valid = valid && checkRequired( anniversary_date, accountTips, 'Anniversary Date is required!' ); valid = valid && checkRequired( email, accountTips, 'Email is required!' ); - valid = valid && checkRegexp( email, emailRegex, 'Use valid email!' ); + valid = valid && checkRegexp( email, emailRegex, 'Use valid email!', accountTips ); + valid = valid && checkRequired( billing_addr1, accountTips, 'Billing Address 1 is required!' ); + valid = valid && checkRequired( billing_city, accountTips, 'Billing City is required!' ); + valid = valid && checkRequired( billing_state, accountTips, 'Billing State is required!' ); + valid = valid && checkRequired( billing_zip, accountTips, 'Billing Zip is required!' ); if ( valid ) { // console.log( newAccountForm.serialize() ); @@ -411,13 +461,15 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function( msg ){ if ( msg.status === true ) { + // console.log( 'account: ', msg.account ); + // TODO: check these function as they don't seem to work! // Reload the account select - updateBillingAccountList( msg.account.fieldData.id ); + updateBillingAccountList( msg.account ); updateNonAccountMemberList(); // Close the dialog newAccountDialog.dialog( 'close' ); } else { - // console.log( 'return', msg ); + console.log( 'return', msg ); } }); } @@ -447,10 +499,13 @@ jQuery(document).ready(function($){ /** * Check field against regular expression. */ - function checkRegexp( fieldName, regexp, message ) { + function checkRegexp( fieldName, regexp, message, tips ) { + // console.log( 'fieldName: ', fieldName ); + // console.log( 'regexp: ', regexp ); + // console.log( 'message: ', message ); if ( !( regexp.test( fieldName.val() ) ) ) { fieldName.addClass( 'ui-state-error' ); - updateTips( accountTips, message ); + updateTips( tips, message ); return false; } else { return true; @@ -473,7 +528,7 @@ jQuery(document).ready(function($){ * Ajax call to get the list of members with accounts. * Updating the account list used for the autocomplete. */ - function updateBillingAccountList( selected_id = null ) + function updateBillingAccountList( selectedAccount = null ) { $.ajax({ @@ -485,15 +540,50 @@ jQuery(document).ready(function($){ dataType: 'json' }).done(function(msg){ availableAccountMembers = []; + // console.log( msg ); for ( index in msg ) { var obj = msg[index]; - availableAccountMembers.push( { label: obj.name, value: obj.name, id: obj.id } ); + availableAccountMembers.push( { + label: obj.name, + value: obj.name, + id: obj.id, + anniversary: obj.ann + } ); } + // console.log( 'availableAccountMembers', availableAccountMembers ); // also need to update the source for the autocomplete $('#glm_member_accounts').autocomplete( 'option', { source: availableAccountMembers } ); + // Here we change the value of the Billing Account field. + $('#glm_member_accounts').val( selectedAccount.ref_dest.name ); + $('#glm_member_accounts_hidden').val( selectedAccount.id ); + $('#invoice_due_date').val( selectedAccount.next_anniversary_date ); + }); + } + + /** + * updateInvoiceTypeList + * + * Ajax call to fetch new invoiceType list and update the invoiceTypeJSON. + * Have to pass in the new id you want to add to the form. + * Since this sometimes finishes at a different time (async). + * Has to add the item to the form after this is pulled. + */ + function updateInvoiceTypeList( lineItemId ) + { + $.ajax({ + url: '{$ajaxUrl}', + cache: false, + type: 'GET', + data: 'action=glm_members_admin_ajax&glm_action=invoiceTypes&option=list', + encode: true, + dataType: 'json' + }).done(function(data){ + invoiceTypeJSON = data; + // console.log( 'invoiceTypeJSON', invoiceTypeJSON ); + addLineItemToInvoice( invoiceTypeJSON[lineItemId] ); }); } @@ -561,12 +651,62 @@ jQuery(document).ready(function($){ }, }, close: function(){ - // Todo: reset form - // Todo: remove error state - // Todo: updateTips + customFieldName.val(''); + customFieldAmount.val(''); + allCustomFields.removeClass( 'ui-state-error' ); + updateTips( customTips, '* required!' ); }, }); + /** + * Custom Line Item form callback. + * + * Save the custom line item using ajax. + */ + function addCustomLineItem() + { + // Need to validate the form + var valid = true; + + // Clear allCustomFields + allCustomFields.removeClass( 'ui-state-error' ); + + // Check fields for a value. + valid = valid && checkRequired( customFieldParent, customTips, 'Parent is required!' ); + valid = valid && checkRequired( customFieldName, customTips, 'Name is required!' ); + valid = valid && checkRequired( customFieldAmount, customTips, 'Amount is required!' ); + valid = valid && checkRegexp( customFieldAmount, moneyRegex, 'Amount: Use numbers only!', customTips ); + + // console.log( 'customFieldName: ', customFieldName.val() ); + // console.log( 'customFieldAmount: ', customFieldAmount.val() ); + if ( valid ) { + // console.log('start ajax'); + $.ajax({ + url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=invoiceTypes&option=add', + cache: false, + type: 'POST', + data: { + name: customFieldName.val(), + amount: customFieldAmount.val(), + parent: customFieldParent.val() + }, + encode: true, + dataType: 'json' + }).done(function( msg ){ + if ( msg.status === true ) { + // console.log( 'msg from addCustomLineItem: ', msg ); + updateInvoiceTypeList( msg.invoiceType.id ); + // Close the dialog + customLineItemDialog.dialog( 'close' ); + } else { + // console.log( 'return', msg ); + } + }); + } + + return valid; + } + /** * form * @@ -577,13 +717,15 @@ jQuery(document).ready(function($){ addLineItem(); }); - // Need to make sure something is added to the form. - // Should not be making empty invoices. + /** + * Need to make sure something is added to the form. + * Should not be making empty invoices. + */ $('#create-invoice-form').submit(function(e){ // Check if there's a total amount. // If it is empty then don't submit form. if ( !$('#invoice-total-amount').val() || $('#invoice-total-amount').val() == '0.00' ) { - alert( 'Empty invoice. Please add something!' ); + alert( 'Empty invoice. Please add at least one line item!' ); return false; } else { return true; @@ -601,6 +743,16 @@ jQuery(document).ready(function($){ return false; }); + /** + * Click event for the id of #newCustomLineItemButton + * + * Activates the dialog for adding custom line items. + */ + $('#newCustomLineItemButton').click( function(){ + $('#newCustomLineItemDialog').dialog( 'open' ); + return false; + }); + /** * dialog for the New Account Form */ diff --git a/views/admin/billing/makePayment-Billing.html b/views/admin/billing/makePayment-Billing.html new file mode 100644 index 0000000..b73e784 --- /dev/null +++ b/views/admin/billing/makePayment-Billing.html @@ -0,0 +1,80 @@ +
+ +
+
+

Billing Information

+
+
+ +
+
Billing First Name
+
+ +
+
+ +
+
Billing Last Name
+
+ +
+
+ + +
+
Billing Address 1
+
+ +
+
+ +
+
Billing Address 2
+
+ +
+
+ +
+
Billing City
+
+ +
+
+ +
+
Billing State
+
+ +
+
+ +
+
Billing Zip
+
+ +
+
+ +
+
Billing Email
+
+ +
+
+ +
+
Billing Phone
+
+ +
+
+ +
diff --git a/views/admin/billing/makePayment.html b/views/admin/billing/makePayment.html index 4ecd98f..5818b7d 100644 --- a/views/admin/billing/makePayment.html +++ b/views/admin/billing/makePayment.html @@ -10,86 +10,9 @@
-
-
-
-

Billing Information

-
-
- -
-
Billing First Name
-
- -
-
- -
-
Billing Last Name
-
- -
-
- - -
-
Billing Address 1
-
- -
-
- -
-
Billing Address 2
-
- -
-
- -
-
Billing City
-
- -
-
- -
-
Billing State
-
- -
-
+ -
-
Billing Zip
-
- -
-
- -
-
Billing Email
-
- -
-
- -
-
Billing Phone
-
- -
-
- -
{if $invoices}
diff --git a/views/admin/settings/invoiceTypes.html b/views/admin/settings/invoiceTypes.html index 0866611..cbf894f 100644 --- a/views/admin/settings/invoiceTypes.html +++ b/views/admin/settings/invoiceTypes.html @@ -201,7 +201,7 @@ jQuery(document).ready(function($) { $("#newInvoiceTypeDialog").dialog("open"); }); $('.editInvoiceType').click( function() { - $('#editRecurring').prop( 'checked', false ); + $('#edit-recurring').prop( 'checked', false ); var invoiceID = $(this).data('invoice-id'); var invoiceName = $(this).data('invoice-name'); @@ -210,6 +210,8 @@ jQuery(document).ready(function($) { var invoiceRecurring = $(this).data('invoice-recurring'); var invoiceRecurrence = $(this).data('invoice-recurrence'); + console.log( 'invoiceRecurring: ', invoiceRecurring ); + // Set the values of the edit form for the selected invoiceType $('#edit-id').val( invoiceID ); $('#edit-name').val( invoiceName );