-
- my $branches = GetBranches;
-
- # Build the combobox to select the billing place
- my @billingplaceloop;
- for (sort keys %$branches) {
- my $selected = 1 if $_ eq $billingplace;
- my %row = (
- value => $_,
- selected => $selected,
- branchname => $branches->{$_}->{branchname},
- );
- push @billingplaceloop, \%row;
- }
- $template->param( billingplaceloop => \@billingplaceloop );
-
- # Build the combobox to select the delivery place
- my @deliveryplaceloop;
- for (sort keys %$branches) {
- my $selected = 1 if $_ eq $deliveryplace;
- my %row = (
- value => $_,
- selected => $selected,
- branchname => $branches->{$_}->{branchname},
- );
- push @deliveryplaceloop, \%row;
- }
- $template->param( deliveryplaceloop => \@deliveryplaceloop );
+
+ my $branches = C4::Branch::GetBranchesLoop( $billingplace );
+ $template->param( billingplaceloop => $branches );
+ $branches = C4::Branch::GetBranchesLoop( $deliveryplace );
+ $template->param( deliveryplaceloop => $branches );