Sorted the branches select.
Modified display to "branchcode - branchname"
Fixed a bug, selection was inverted.
# build branches select
my $branches = GetBranches;
my @branchloop_select;
- foreach my $thisbranch ( keys %$branches ) {
+ foreach my $thisbranch ( sort keys %$branches ) {
my %row = (
value => $thisbranch,
branchname => $branches->{$thisbranch}->{'branchname'},
<select name="budget_branchcode">
<option value=""></option>
<!-- TMPL_LOOP name="branchloop_select" -->
- <!-- TMPL_IF name="selected" --> <option value="<!-- TMPL_VAR name="value" -->" > <!--TMPL_ELSE--> <option value="<!-- TMPL_VAR name="value" -->" selected="selected"> <!-- /TMPL_IF --> <!-- TMPL_VAR name="branchname" --></option>
+ <option value="<!-- TMPL_VAR name="value" -->"<!-- TMPL_IF name="selected" -->selected="selected"<!-- /TMPL_IF -->>
+ <!-- TMPL_VAR name="value" --> - <!-- TMPL_VAR name="branchname" -->
+ </option>
<!-- /TMPL_LOOP -->
</select>
</li>