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

(-)a/acqui/finishreceive.pl (+9 lines)
Lines 56-61 my $invoiceno = $invoice->{invoicenumber}; Link Here
56
my $booksellerid     = $input->param('booksellerid');
56
my $booksellerid     = $input->param('booksellerid');
57
my $cnt              = 0;
57
my $cnt              = 0;
58
my $bookfund         = $input->param("bookfund");
58
my $bookfund         = $input->param("bookfund");
59
my $suggestion_id    = $input->param("suggestionid");
59
my $order            = GetOrder($ordernumber);
60
my $order            = GetOrder($ordernumber);
60
my $new_ordernumber  = $ordernumber;
61
my $new_ordernumber  = $ordernumber;
61
62
Lines 186-189 while ( my $item = $items->next ) { Link Here
186
    );
187
    );
187
}
188
}
188
189
190
if ($suggestion_id) {
191
    my $reason = $input->param("reason") || '';
192
    my $other_reason = $input->param("other_reason");
193
    $reason = $other_reason if $reason eq 'other';
194
    my $suggestion = Koha::Suggestions->find($suggestion_id);
195
    $suggestion->update( { reason => $reason } ) if $suggestion;
196
}
197
189
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1");
198
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1");
(-)a/acqui/orderreceive.pl (-5 / +5 lines)
Lines 185-192 if( defined $order->{tax_rate_on_receiving} ) { Link Here
185
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
185
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
186
}
186
}
187
187
188
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
189
190
my $creator = Koha::Patrons->find( $order->{created_by} );
188
my $creator = Koha::Patrons->find( $order->{created_by} );
191
189
192
my $budget = GetBudget( $order->{budget_id} );
190
my $budget = GetBudget( $order->{budget_id} );
Lines 251-262 $template->param( Link Here
251
    datereceived          => $datereceived,
249
    datereceived          => $datereceived,
252
    order_internalnote    => $order_internalnote,
250
    order_internalnote    => $order_internalnote,
253
    order_vendornote      => $order_vendornote,
251
    order_vendornote      => $order_vendornote,
254
    suggestionid          => $suggestion->{suggestionid},
255
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
256
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
257
    gst_values            => \@gst_values,
252
    gst_values            => \@gst_values,
258
);
253
);
259
254
255
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
256
if ( $suggestion ) {
257
    $template->param( suggestion => $suggestion );
258
}
259
260
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
260
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
261
my @budget_loop;
261
my @budget_loop;
262
my $periods = GetBudgetPeriods( );
262
my $periods = GetBudgetPeriods( );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-3 / +51 lines)
Lines 42-54 Link Here
42
    </ol>
42
    </ol>
43
	</fieldset>
43
	</fieldset>
44
44
45
    [% IF ( suggestionid ) %]
45
    [% IF suggestion %]
46
        <fieldset class="rows">
46
        <fieldset class="rows">
47
        <legend>Suggestion</legend>
47
        <legend>Suggestion</legend>
48
        <ol>
48
        <ol>
49
          <li>
49
          <li>
50
            <span class="label">Suggested by: </span>
50
            <span class="label">Suggested by: </span>
51
            [% surnamesuggestedby | html %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid | uri %]&amp;op=show">suggestion #[% suggestionid | html %]</a>)
51
            [% suggestion.surnamesuggestedby | html %][% IF suggestion.firstnamesuggestedby %], [% suggestion.firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show">suggestion #[% suggestion.suggestionid | html %]</a>)
52
            [% IF suggestion.reason %]
53
                <li>
54
                    <span class="label">Reason:</span>
55
                    [% SET avs = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
56
                    [% SET other_reason = 1 %]
57
                    <select class="select-reason" id="reason" name="reason">
58
                        <option value=""> -- Choose a reason -- </option>
59
                        [% FOREACH reason IN suggestion_reasons %]
60
                            [% IF reason.lib == suggestion.reason %]
61
                                <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
62
                                [% SET other_reason = 0 %]
63
                            [% ELSE %]
64
                                <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
65
                            [% END %]
66
                        [% END %]
67
                        <option value="other">Others...</option>
68
                    </select>
69
70
                    <span id="other_reason" name="other_reason">
71
                        [% IF other_reason %]
72
                            <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
73
                        [% ELSE %]
74
                            <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
75
                        [% END %]
76
                        <a href="#back">Cancel</a>
77
                    </span>
78
79
                    <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
80
                </li>
81
            [% END %]
52
          </li>
82
          </li>
53
        </ol>
83
        </ol>
54
        </fieldset>
84
        </fieldset>
Lines 436-441 Link Here
436
                    CheckNItems($(this).val());
466
                    CheckNItems($(this).val());
437
                });
467
                });
438
            [% END %]
468
            [% END %]
469
470
            [% IF other_reason %]
471
                $(".select-reason").hide();
472
                $(".select-reason").find("option[value='other']").attr("selected","selected");
473
                $("#other_reason").show();
474
            [% ELSE %]
475
                $("#other_reason").hide();
476
            [% END %]
477
            $(".select-reason").change(function(){
478
                if($(this).val() == "other"){
479
                    $(this).hide();
480
                    $("#other_reason").show();
481
                }
482
            });
483
            $("a[href*=back]").click(function(){
484
                $(".select-reason").show().find("option[value='']").attr("selected","selected");
485
                $("#other_reason").hide();
486
            });
487
439
        });
488
        });
440
    </script>
489
    </script>
441
[% END %]
490
[% END %]
442
- 

Return to bug 23596