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

(-)a/Koha/Acquisition/Order.pm (+7 lines)
Lines 69-74 sub store { Link Here
69
          unless $self->$key;
69
          unless $self->$key;
70
    }
70
    }
71
71
72
    if (not defined $self->{created_by}) {
73
        my $userenv = C4::Context->userenv;
74
        if ($userenv) {
75
            $self->created_by($userenv->{number});
76
        }
77
    }
78
72
    $self->quantityreceived(0) unless $self->quantityreceived;
79
    $self->quantityreceived(0) unless $self->quantityreceived;
73
    $self->entrydate(output_pref( { dt => dt_from_string, dateformat => 'iso' } )) unless $self->entrydate;
80
    $self->entrydate(output_pref( { dt => dt_from_string, dateformat => 'iso' } )) unless $self->entrydate;
74
81
(-)a/acqui/orderreceive.pl (-4 / +2 lines)
Lines 183-190 if( defined $order->{tax_rate_on_receiving} ) { Link Here
183
183
184
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
184
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
185
185
186
my $authorisedby = $order->{authorisedby};
186
my $creator = Koha::Patrons->find( $order->{created_by} );
187
my $authorised_patron = Koha::Patrons->find( $authorisedby );
188
187
189
my $budget = GetBudget( $order->{budget_id} );
188
my $budget = GetBudget( $order->{budget_id} );
190
189
Lines 217-224 $template->param( Link Here
217
    ecost                 => $ecost,
216
    ecost                 => $ecost,
218
    unitprice             => $unitprice,
217
    unitprice             => $unitprice,
219
    tax_rate              => $tax_rate,
218
    tax_rate              => $tax_rate,
220
    memberfirstname       => $authorised_patron->firstname || "",
219
    creator               => $creator,
221
    membersurname         => $authorised_patron->surname || "",
222
    invoiceid             => $invoice->{invoiceid},
220
    invoiceid             => $invoice->{invoiceid},
223
    invoice               => $invoice->{invoicenumber},
221
    invoice               => $invoice->{invoicenumber},
224
    datereceived          => $datereceived,
222
    datereceived          => $datereceived,
(-)a/acqui/showorder.pl (+45 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
use CGI;
20
21
use C4::Auth;
22
use C4::Output;
23
24
use Koha::Acquisition::Orders;
25
use Koha::Patrons;
26
27
my $cgi = new CGI;
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
29
    template_name   => "acqui/showorder.tt",
30
    query           => $cgi,
31
    type            => "intranet",
32
    authnotrequired => 0,
33
    flagsrequired   => { acquisition => '*' },
34
});
35
36
my $ordernumber = $cgi->param('ordernumber');
37
my $order = Koha::Acquisition::Orders->find($ordernumber);
38
my $creator = Koha::Patrons->find($order->created_by);
39
40
$template->param(
41
    order => $order,
42
    creator => $creator,
43
);
44
45
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/installer/data/mysql/atomicupdate/Bug-12395-add-column-aqorders.created_by.sql (+2 lines)
Line 0 Link Here
1
ALTER TABLE aqorders ADD COLUMN created_by int(11) NULL DEFAULT NULL AFTER quantityreceived;
2
UPDATE aqorders, aqbasket SET aqorders.created_by = aqbasket.authorisedby  WHERE aqorders.basketno = aqbasket.basketno;
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 3162-3167 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3162
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3162
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3163
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3163
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3164
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3164
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3165
  `created_by` int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3165
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3166
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3166
  `cancellationreason` text default NULL, -- reason of cancellation
3167
  `cancellationreason` text default NULL, -- reason of cancellation
3167
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3168
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +13 lines)
Lines 286-292 Link Here
286
            [% END %]
286
            [% END %]
287
       </select></li>
287
       </select></li>
288
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
288
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
289
       <li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
289
       <li>
290
        <label for="creator">Created by: </label>
291
        <span>
292
          [% IF (creator && creator.firstname && creator.surname) %]
293
            [% IF creator.firstname %]
294
              [% creator.firstname %]
295
            [% END %]
296
            [% creator.surname %]
297
          [% ELSE %]
298
            No name
299
          [% END %]
300
        </span>
301
       </li>
290
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
302
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
291
           [% IF ( edit and not subscriptionid) %]
303
           [% IF ( edit and not subscriptionid) %]
292
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
304
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-2 / +6 lines)
Lines 245-251 Link Here
245
            <th>Basket group</th>
245
            <th>Basket group</th>
246
            <th>Order line</th>
246
            <th>Order line</th>
247
            <th>Summary</th>
247
            <th>Summary</th>
248
            <th>View record</th>
248
            <th>More</th>
249
            <th>Quantity</th>
249
            <th>Quantity</th>
250
            <th>Unit cost</th>
250
            <th>Unit cost</th>
251
            <th>Order cost</th>
251
            <th>Order cost</th>
Lines 293-299 Link Here
293
                    [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>]
293
                    [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>]
294
                [% END %]
294
                [% END %]
295
                </td>
295
                </td>
296
                <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a></td>
296
                <td>
297
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" class="previewData">Order</a><br>
298
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a><br>
299
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a>
300
                </td>
297
                <td>[% loop_order.quantity %]</td>
301
                <td>[% loop_order.quantity %]</td>
298
                <td>[% loop_order.ecost | $Price %]</td>
302
                <td>[% loop_order.ecost | $Price %]</td>
299
                <td>[% loop_order.total | $Price %]</td>
303
                <td>[% loop_order.total | $Price %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt (-1 / +38 lines)
Line 0 Link Here
0
- 
1
[% INCLUDE 'doc-head-open.inc' %]
2
<style>
3
  td {
4
    padding: 0 1em;
5
  }
6
  td:first-child {
7
    font-weight: bold;
8
    text-align: right;
9
  }
10
</style>
11
</head>
12
<body>
13
  [% IF order %]
14
    <table>
15
      <tbody>
16
        <tr>
17
          <td>Creation date</td>
18
          <td>[% order.entrydate %]</td>
19
        </tr>
20
        <tr>
21
          <td>Creator</td>
22
          <td>[% creator.firstname %] [% creator.surname %]</td>
23
        </tr>
24
        <tr>
25
          <td>Claims count</td>
26
          <td>[% order.claims_count %]</td>
27
        </tr>
28
        <tr>
29
          <td>Last claim date</td>
30
          <td>[% order.claimed_date %]</td>
31
        </tr>
32
      </tbody>
33
    </table>
34
  [% ELSE %]
35
    No order found.
36
  [% END %]
37
</body>
38
</html>

Return to bug 12395