// Get a current list of members
$invoiceTypes = $this->getList();
- echo '<pre>$invoiceTypes: ' . print_r( $invoiceTypes, true ) . '</pre>';
+ // echo '<pre>$invoiceTypes: ' . print_r( $invoiceTypes, true ) . '</pre>';
// If we have list entries - even if it's an empty list
$success = true;
// Sort results by higherarchy (Parent/Child and Alpha)
$invoiceTypes = $this->sortParentChild($invoiceTypes);
- echo '<pre>$invoiceTypes: ' . print_r( $invoiceTypes, true ) . '</pre>';
+ // echo '<pre>$invoiceTypes: ' . print_r( $invoiceTypes, true ) . '</pre>';
// If we had a fatal error, redirect to the error page
<select name="parent">
<option value="0">(none)</option>
{if $haveInvoiceTypes}
- {foreach $invoiceTypes as $type}
- <option value="{$type.id}">{$type.name}</option>
+ {foreach $invoiceTypes as $t}
+ {if !$t.parent.value} <!-- don't show child categories -->
+ <option value="{$t.id}">{$t.name}</option>
+ {/if}
{/foreach}
{/if}
</select>
<select name="recurrence">
<option value="">(none)</option>
{foreach $recurrenceTypes as $typeId => $typeLabel}
- <option value="{$typeId}">{$typeLabel}</option>
+ {if !$t.parent.value} <!-- don't show child categories -->
+ <option value="{$typeId}">{$typeLabel}</option>
+ {/if}
{/foreach}
</select>
</td>
<select id="edit-parent" name="parent">
<option value="0">(none)</option>
{if $haveInvoiceTypes}
- {foreach $invoiceTypes as $type}
- {if !$type.parent.value} <!-- don't show child categories -->
- <option value="{$type.id}">{$type.name}</option>
+ {foreach $invoiceTypes as $t}
+ {if !$t.parent.value} <!-- don't show child categories -->
+ <option value="{$t.id}">{$t.name}</option>
{/if}
{/foreach}
{/if}
<a class="editInvoiceType"
data-invoice-id="{$t.id}"
data-invoice-name="{$t.name}"
- data-invoice-parent="{$t.parent}"
+ data-invoice-parent="{$t.parent.value}"
data-invoice-amount="{$t.amount}"
data-invoice-recurring="{$t.recurring.value}"
data-invoice-recurrence="{$t.recurrence}">{$t.name}</a>
var invoiceID = $(this).data('invoice-id');
var invoiceName = $(this).data('invoice-name');
var invoiceParent = $(this).data('invoice-parent');
+ console.log(invoiceParent);
var invoiceAmount = $(this).data('invoice-amount');
var invoiceRecurring = $(this).data('invoice-recurring');
var invoiceRecurrence = $(this).data('invoice-recurrence');
if ( invoiceRecurring === 1 ) {
$('#edit-recurring').prop( 'checked', true );
}
- console.log(invoiceRecurring);
$('#edit-recurrence').val( invoiceRecurrence );
$("#editInvoiceTypeDialog").dialog("open");