View | Details | Raw Unified | Return to bug 23830
Collapse All | Expand All

(-)a/Koha/Charges/Sales.pm (-4 / +5 lines)
Lines 105-115 sub _get_valid_payments { Link Here
105
    my $self = shift;
105
    my $self = shift;
106
106
107
    $self->{valid_payments} //= {
107
    $self->{valid_payments} //= {
108
        map { $_ => 1 } Koha::AuthorisedValues->search(
108
        map { $_ => 1 } Koha::AuthorisedValues->search_with_library_limits(
109
            {
109
            {
110
                category   => 'PAYMENT_TYPE',
110
                category => 'PAYMENT_TYPE'
111
                branchcode => $self->{cash_register}->branch
111
            },
112
            }
112
            {},
113
            $self->{cash_register}->branch # filter by cash_register branch
113
        )->get_column('authorised_value')
114
        )->get_column('authorised_value')
114
    };
115
    };
115
116
(-)a/Koha/Illrequest.pm (-10 / +17 lines)
Lines 136-146 sub statusalias { Link Here
136
    # We can't know which result is the right one if there are multiple
136
    # We can't know which result is the right one if there are multiple
137
    # ILLSTATUS authorised values with the same authorised_value column value
137
    # ILLSTATUS authorised values with the same authorised_value column value
138
    # so we just use the first
138
    # so we just use the first
139
    return Koha::AuthorisedValues->search({
139
    return Koha::AuthorisedValues->search(
140
        branchcode => $self->branchcode,
140
        {
141
        category => 'ILLSTATUS',
141
            category         => 'ILLSTATUS',
142
        authorised_value => $self->SUPER::status_alias
142
            authorised_value => $self->SUPER::status_alias
143
    })->next;
143
        },
144
        {},
145
        $self->branchcode
146
    )->next;
144
}
147
}
145
148
146
=head3 illrequestattributes
149
=head3 illrequestattributes
Lines 231-241 sub status_alias { Link Here
231
    # We can't know which result is the right one if there are multiple
234
    # We can't know which result is the right one if there are multiple
232
    # ILLSTATUS authorised values with the same authorised_value column value
235
    # ILLSTATUS authorised values with the same authorised_value column value
233
    # so we just use the first
236
    # so we just use the first
234
    my $alias = Koha::AuthorisedValues->search({
237
    my $alias = Koha::AuthorisedValues->search(
235
        branchcode => $self->branchcode,
238
        {
236
        category => 'ILLSTATUS',
239
            category         => 'ILLSTATUS',
237
        authorised_value => $self->SUPER::status_alias
240
            authorised_value => $self->SUPER::status_alias
238
    })->next;
241
        },
242
        {},
243
        $self->branchcode
244
    )->next;
245
239
    if ($alias) {
246
    if ($alias) {
240
        return $alias->authorised_value;
247
        return $alias->authorised_value;
241
    } else {
248
    } else {
(-)a/Koha/Template/Plugin/AuthorisedValues.pm (-3 / +3 lines)
Lines 42-55 sub Get { Link Here
42
sub GetAuthValueDropbox {
42
sub GetAuthValueDropbox {
43
    my ( $self, $category ) = @_;
43
    my ( $self, $category ) = @_;
44
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
44
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
45
    return Koha::AuthorisedValues->search(
45
    return Koha::AuthorisedValues->search_with_library_limits(
46
        {
46
        {
47
            branchcode => $branch_limit,
48
            category => $category,
47
            category => $category,
49
        },
48
        },
50
        {
49
        {
51
            order_by => [ 'category', 'lib', 'lib_opac' ],
50
            order_by => [ 'category', 'lib', 'lib_opac' ],
52
        }
51
        },
52
        $branch_limit
53
    );
53
    );
54
}
54
}
55
55
(-)a/acqui/ajax-getauthvaluedropbox.pl (-3 / +3 lines)
Lines 69-82 my $default = $input->param('default'); Link Here
69
$default = C4::Charset::NormalizeString($default);
69
$default = C4::Charset::NormalizeString($default);
70
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
70
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
71
71
72
my $avs = Koha::AuthorisedValues->search(
72
my $avs = Koha::AuthorisedValues->search_with_library_limits(
73
    {
73
    {
74
        branchcode => $branch_limit,
75
        category => $category,
74
        category => $category,
76
    },
75
    },
77
    {
76
    {
78
        order_by => [ 'category', 'lib', 'lib_opac' ],
77
        order_by => [ 'category', 'lib', 'lib_opac' ],
79
    }
78
    },
79
    $branch_limit
80
);
80
);
81
my $html = qq|<select id="$name" name="$name">|;
81
my $html = qq|<select id="$name" name="$name">|;
82
while ( my $av = $avs->next ) {
82
while ( my $av = $avs->next ) {
(-)a/tools/batchMod.pl (-2 / +7 lines)
Lines 523-529 foreach my $tag (sort keys %{$tagslib}) { Link Here
523
      else {
523
      else {
524
          push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
524
          push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
525
525
526
          my @avs = Koha::AuthorisedValues->search({ category => $tagslib->{$tag}->{$subfield}->{authorised_value}, branchcode => $branch_limit },{order_by=>'lib'});
526
          my @avs = Koha::AuthorisedValues->search_with_library_limits(
527
              {
528
                  category   => $tagslib->{$tag}->{$subfield}->{authorised_value}
529
              },
530
              { order_by => 'lib' },
531
              $branch_limit
532
          );
527
          for my $av ( @avs ) {
533
          for my $av ( @avs ) {
528
              push @authorised_values, $av->authorised_value;
534
              push @authorised_values, $av->authorised_value;
529
              $authorised_lib{$av->authorised_value} = $av->lib;
535
              $authorised_lib{$av->authorised_value} = $av->lib;
530
- 

Return to bug 23830