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 181-184 while ( my $item = $items->next ) { Link Here
181
    $item->store;
182
    $item->store;
182
}
183
}
183
184
185
if ($suggestion_id) {
186
    my $reason = $input->param("reason") || '';
187
    my $other_reason = $input->param("other_reason");
188
    $reason = $other_reason if $reason eq 'other';
189
    my $suggestion = Koha::Suggestions->find($suggestion_id);
190
    $suggestion->update( { reason => $reason } ) if $suggestion;
191
}
192
184
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1");
193
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid&sticky_filters=1");
(-)a/acqui/orderreceive.pl (-5 / +5 lines)
Lines 186-193 if( defined $order->{tax_rate_on_receiving} ) { Link Here
186
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
186
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
187
}
187
}
188
188
189
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
190
191
my $creator = Koha::Patrons->find( $order->{created_by} );
189
my $creator = Koha::Patrons->find( $order->{created_by} );
192
190
193
my $budget = GetBudget( $order->{budget_id} );
191
my $budget = GetBudget( $order->{budget_id} );
Lines 252-263 $template->param( Link Here
252
    datereceived          => $datereceived,
250
    datereceived          => $datereceived,
253
    order_internalnote    => $order_internalnote,
251
    order_internalnote    => $order_internalnote,
254
    order_vendornote      => $order_vendornote,
252
    order_vendornote      => $order_vendornote,
255
    suggestionid          => $suggestion->{suggestionid},
256
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
257
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
258
    gst_values            => \@gst_values,
253
    gst_values            => \@gst_values,
259
);
254
);
260
255
256
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
257
if ( $suggestion ) {
258
    $template->param( suggestion => $suggestion );
259
}
260
261
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
261
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
262
my @budget_loop;
262
my @budget_loop;
263
my $periods = GetBudgetPeriods( );
263
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 469-474 Link Here
469
            }
499
            }
470
            $("select[name='currency']").on("change", function(){update_unitprice()} );
500
            $("select[name='currency']").on("change", function(){update_unitprice()} );
471
            $("#unitprice_currency").on("change", function(){update_unitprice()} );
501
            $("#unitprice_currency").on("change", function(){update_unitprice()} );
502
503
            [% IF other_reason %]
504
                $(".select-reason").hide();
505
                $(".select-reason").find("option[value='other']").attr("selected","selected");
506
                $("#other_reason").show();
507
            [% ELSE %]
508
                $("#other_reason").hide();
509
            [% END %]
510
            $(".select-reason").change(function(){
511
                if($(this).val() == "other"){
512
                    $(this).hide();
513
                    $("#other_reason").show();
514
                }
515
            });
516
            $("a[href*=back]").click(function(){
517
                $(".select-reason").show().find("option[value='']").attr("selected","selected");
518
                $("#other_reason").hide();
519
            });
520
472
        });
521
        });
473
    </script>
522
    </script>
474
[% END %]
523
[% END %]
475
- 

Return to bug 23596