my $dbh = C4::Context->dbh;
my $strsth = "
SELECT ".($grouped?"count(*),":"")."aqbasket.basketno,
- surname,firstname,aqorders.*,biblio.*,biblioitems.isbn,
- aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname
+ surname,firstname,biblio.*,biblioitems.isbn,
+ aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname,
+ aqorders.*
FROM aqorders
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2011 BibLibre SARL
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+modordernotes.pl
+
+=head1 DESCRIPTION
+
+Modify just notes when basket is closed.
+
+=cut
+
+use Modern::Perl;
+
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Acquisition;
+use C4::Bookseller qw( GetBookSellerFromId);
+
+my $input = new CGI;
+my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
+ template_name => 'acqui/modordernotes.tmpl',
+ query => $input,
+ type => 'intranet',
+ authnotrequired => 0,
+ flagsrequired => { 'acquisition' => '*' },
+ debug => 1,
+} );
+
+my $op = $input->param('op');
+my $ordernumber = $input->param('ordernumber');
+my $referrer = $input->param('referrer') || $input->referer();
+
+my $order = GetOrder($ordernumber);
+my $basket = GetBasket($order->{basketno});
+my ($bookseller) = GetBookSellerFromId($basket->{booksellerid});
+
+
+if($op and $op eq 'save') {
+ my $ordernotes = $input->param('ordernotes');
+ $order->{'notes'} = $ordernotes;
+ ModOrder($order);
+ print $input->redirect($referrer);
+ exit;
+} else {
+ $template->param(
+ ordernotes => $order->{'notes'},
+ );
+}
+
+if($op) {
+ $template->param($op => 1);
+}
+
+$template->param(
+ basketname => $basket->{'basketname'},
+ basketno => $order->{basketno},
+ booksellerid => $bookseller->{'id'},
+ booksellername => $bookseller->{'name'},
+ ordernumber => $ordernumber,
+ referrer => $referrer,
+);
+
+
+output_html_with_http_headers $input, $cookie, $template->output;
);
my $marcflavour = C4::Context->preference('marcflavour');
+
+if(!$basketno) {
+ my $order = GetOrder($ordernumber);
+ $basketno = $order->{'basketno'};
+}
+
my $basket = GetBasket($basketno);
my $contract = &GetContract($basket->{contractnumber});
<td>
<p>[% IF ( books_loo.order_received ) %] (rcvd)[% END %]
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% books_loo.biblionumber %]">[% books_loo.title |html %]</a> by [% books_loo.author %]
- [% IF ( books_loo.notes ) %] [% books_loo.notes %][% END %]
- [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
- [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
- [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
- [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
- [% IF ( books_loo.suggestionid ) %]
- <br/>
- Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
- (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>)
- [% END %]
- [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
+ <br />
+ [% IF ( books_loo.isbn ) %] - [% books_loo.isbn %][% END %]
+ [% IF ( books_loo.issn ) %] - [% books_loo.issn %][% END %]
+ [% IF ( books_loo.publishercode ) %], [% books_loo.publishercode %][% END %]
+ [% IF ( books_loo.publicationyear ) %], [% books_loo.publicationyear %][% END %]
+ [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
+ [% IF ( books_loo.suggestionid ) %]
+ <br/>
+ Suggested by: [% books_loo.surnamesuggestedby %][% IF ( books_loo.firstnamesuggestedby ) %], [% books_loo.firstnamesuggestedby %] [% END %]
+ (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>)
+ [% END %]
+ [% IF ( books_loo.notes ) %]
+ <p class="ordernote"><strong>Note: </strong>[% books_loo.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Change note</a>]</p>
+ [% ELSE %]
+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Add note</a>]
+ [% END %]
</p>
- </td>
+ </td>
<td class="number">[% books_loo.rrp %]</td>
<td class="number">[% books_loo.ecost %]</td>
<td class="number">[% books_loo.quantity %]</td>
--- /dev/null
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Acquisition › Change order notes</title>
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+
+<body>
+[% INCLUDE 'header.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisition</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername|html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketname|html %] ([% basketno %])</a> › Change order notes</div>
+
+<div id="doc" class="yui-t7">
+
+<div id="bd">
+ <div id="yui-main">
+ <h1>Change order notes (order no. [% ordernumber %])</h1>
+ <form action="/cgi-bin/koha/acqui/modordernotes.pl" method="post">
+ <fieldset class="brief">
+ <label for="ordernotes">Notes:</label>
+ <textarea id="ordernotes" name="ordernotes" rows="3" cols="30">[% ordernotes %]</textarea>
+ </fieldset>
+ <input type="hidden" name="referrer" value="[% referrer %]" />
+ <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
+ <input type="hidden" name="op" value="save" />
+ <fieldset class="action">
+ <input type="submit" value="Save" />
+ <a class="cancel" href="[% referrer %]">Cancel</a>
+ </fieldset>
+ </form>
+ </div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
[% IF ( basketno ) %]
<div id="acqui_basket_summary" class="yui-g">
- <fieldset class="rows">
+ <fieldset class="rows">
<legend>Basket details</legend>
- <ol>
+ <ol>
[% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
[% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
[% IF ( basketcontractno ) %]
<input type="hidden" value="mod_basket" name="op" />
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
</li>
- <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
- </form>
+ <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
[% END %]
+ </form>
[% END %]
- </ol>
-</fieldset>
+ </ol>
+ </fieldset>
</div>
[% END %]
Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&op=show">suggestion #[% loop_order.suggestionid %]</a>)
[% END %]
+ <br />
+ [% IF ( loop_order.notes ) %]
+ <p class="ordernote"><strong>Note: </strong>[% loop_order.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Change note</a>]</p>
+ [% ELSE %]
+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Fbooksellerid=[% loop_order.booksellerid %]&datereceived=[% loop_order.invoicedatereceived %]&invoice=[% loop_order.invoice %]">Add note</a>]
+ [% END %]
</td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
<td>[% loop_order.quantity %]</td>