Bug 39724: (follow-up) use the suggestion object in neworderempty.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Baptiste Wojtkowski 2026-03-04 15:46:22 +00:00 committed by Lucas Gass
parent e4f14b3b1d
commit 452089fc00
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 40 additions and 41 deletions

View File

@ -460,41 +460,39 @@ $template->param(
closedate => $basket->{'closedate'},
# order details
suggestionid => $suggestion->suggestionid,
surnamesuggestedby => $suggestion->surname,
firstnamesuggestedby => $suggestion->firstname,
biblionumber => $biblionumber,
uncertainprice => $data->{'uncertainprice'},
discount_2dp => sprintf( "%.2f", $bookseller->discount ), # for display
discount => $bookseller->discount,
orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ),
orderdiscount => $data->{'discount'},
order_internalnote => $data->{'order_internalnote'},
order_vendornote => $data->{'order_vendornote'},
listincgst => $bookseller->listincgst,
invoiceincgst => $bookseller->invoiceincgst,
cur_active_sym => $active_currency->symbol,
cur_active => $active_currency->currency,
currencies => Koha::Acquisition::Currencies->search,
currency => $data->{currency},
vendor_currency => $bookseller->listprice,
orderexists => ( $new eq 'yes' ) ? 0 : 1,
title => $data->{'title'},
author => $data->{'author'},
publicationyear => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'},
editionstatement => $data->{'editionstatement'},
budget_loop => $budget_loop,
isbn => $data->{'isbn'},
ean => $data->{'ean'},
seriestitle => $data->{'seriestitle'},
itemtypeloop => \@itemtypes,
quantity => $quantity,
quantityrec => $quantity,
quantitysugg => $data->{quantitysugg},
rrp => $data->{'rrp'},
replacementprice => $data->{'replacementprice'},
gst_values => \@gst_values,
tax_rate => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering} + 0.0
suggestion => $suggestion,
biblionumber => $biblionumber,
uncertainprice => $data->{'uncertainprice'},
discount_2dp => sprintf( "%.2f", $bookseller->discount ), # for display
discount => $bookseller->discount,
orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ),
orderdiscount => $data->{'discount'},
order_internalnote => $data->{'order_internalnote'},
order_vendornote => $data->{'order_vendornote'},
listincgst => $bookseller->listincgst,
invoiceincgst => $bookseller->invoiceincgst,
cur_active_sym => $active_currency->symbol,
cur_active => $active_currency->currency,
currencies => Koha::Acquisition::Currencies->search,
currency => $data->{currency},
vendor_currency => $bookseller->listprice,
orderexists => ( $new eq 'yes' ) ? 0 : 1,
title => $data->{'title'},
author => $data->{'author'},
publicationyear => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'},
editionstatement => $data->{'editionstatement'},
budget_loop => $budget_loop,
isbn => $data->{'isbn'},
ean => $data->{'ean'},
seriestitle => $data->{'seriestitle'},
itemtypeloop => \@itemtypes,
quantity => $quantity,
quantityrec => $quantity,
quantitysugg => $data->{quantitysugg},
rrp => $data->{'rrp'},
replacementprice => $data->{'replacementprice'},
gst_values => \@gst_values,
tax_rate => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering} + 0.0
: $bookseller->tax_rate ? $bookseller->tax_rate + 0.0
: 0,
listprice => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice ),

View File

@ -143,7 +143,7 @@
cloneItemBlock(0, '[% UniqueItemFields | html %]');
[% END %]
[% IF ( suggestionid ) %]updateCosts();[% END %]
[% IF ( suggestion ) %]updateCosts();[% END %]
$("#quantity").change(function() {
updateCosts();
});
@ -348,7 +348,7 @@
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
<input type="hidden" name="listinc" id="listinc" value="[% listincgst | html %]" />
<input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst | html %]" />
<input type="hidden" name="suggestionid" value="[% suggestionid | html %]" />
<input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
<input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
[% FOREACH c IN currencies %]
@ -466,14 +466,15 @@
[% END %]
</fieldset>
[% IF ( suggestionid ) %]
[% IF ( suggestion ) %]
<fieldset class="rows">
<legend>Suggestion</legend>
<ol>
<li>
<span class="label">Suggested by: </span>
[% 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
[% suggestion.suggester.surname | html %][% IF ( suggestion.suggester.firstname ) %], [% suggestion.suggester.firstname | html %][% END %] (<a
href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show"
>suggestion #[% suggestion.suggestionid | html %]</a
>)
</li>
</ol>
@ -743,7 +744,7 @@
<input type="hidden" id="op" name="op" value="cud-order" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="submit" class="btn btn-primary" value="Save" />
[% IF (suggestionid) %]
[% IF (suggestion) %]
<a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]">Cancel</a>
[% ELSE %]
[% IF subscriptionid %]