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

(-)a/Koha/Acquisition/Order.pm (+7 lines)
Lines 36-41 sub insert { Link Here
36
          unless $self->{$key};
36
          unless $self->{$key};
37
    }
37
    }
38
38
39
    if (not defined $self->{created_by}) {
40
        my $userenv = C4::Context->userenv;
41
        if ($userenv) {
42
            $self->{created_by} = $userenv->{number};
43
        }
44
    }
45
39
    $self->{quantityreceived} ||= 0;
46
    $self->{quantityreceived} ||= 0;
40
    $self->{entrydate} ||=
47
    $self->{entrydate} ||=
41
      output_pref( { dt => dt_from_string, dateformat => 'iso' } );
48
      output_pref( { dt => dt_from_string, dateformat => 'iso' } );
(-)a/acqui/orderreceive.pl (-4 / +2 lines)
Lines 178-185 if( defined $order->{tax_rate_on_receiving} ) { Link Here
178
178
179
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
179
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
180
180
181
my $authorisedby = $order->{authorisedby};
181
my $creator = GetMember( borrowernumber => $order->{created_by} );
182
my $member = GetMember( borrowernumber => $authorisedby );
183
182
184
my $budget = GetBudget( $order->{budget_id} );
183
my $budget = GetBudget( $order->{budget_id} );
185
184
Lines 212-219 $template->param( Link Here
212
    ecost                 => $ecost,
211
    ecost                 => $ecost,
213
    unitprice             => $unitprice,
212
    unitprice             => $unitprice,
214
    tax_rate              => $tax_rate,
213
    tax_rate              => $tax_rate,
215
    memberfirstname       => $member->{firstname} || "",
214
    creator               => $creator,
216
    membersurname         => $member->{surname} || "",
217
    invoiceid             => $invoice->{invoiceid},
215
    invoiceid             => $invoice->{invoiceid},
218
    invoice               => $invoice->{invoicenumber},
216
    invoice               => $invoice->{invoicenumber},
219
    datereceived          => $datereceived,
217
    datereceived          => $datereceived,
(-)a/acqui/showorder.pl (+44 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::Acquisition;
23
use C4::Members;
24
use C4::Output;
25
26
my $cgi = new CGI;
27
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
28
    template_name   => "acqui/showorder.tt",
29
    query           => $cgi,
30
    type            => "intranet",
31
    authnotrequired => 0,
32
    flagsrequired   => { acquisition => '*' },
33
});
34
35
my $ordernumber = $cgi->param('ordernumber');
36
my $order = GetOrder($ordernumber);
37
my $creator = GetMember(borrowernumber => $order->{created_by});
38
39
$template->param(
40
    order => $order,
41
    creator => $creator,
42
);
43
44
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 3133-3138 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3133
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3133
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3134
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3134
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3135
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3135
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3136
  `created_by` int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3136
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3137
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3137
  `cancellationreason` text default NULL, -- reason of cancellation
3138
  `cancellationreason` text default NULL, -- reason of cancellation
3138
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3139
  `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 288-294 Link Here
288
                    [<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>]
288
                    [<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>]
289
                [% END %]
289
                [% END %]
290
                </td>
290
                </td>
291
                <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>
291
                <td>
292
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" class="previewData">Order</a><br>
293
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a><br>
294
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a>
295
                </td>
292
                <td>[% loop_order.quantity %]</td>
296
                <td>[% loop_order.quantity %]</td>
293
                <td>[% loop_order.ecost | $Price %]</td>
297
                <td>[% loop_order.ecost | $Price %]</td>
294
                <td>[% loop_order.total | $Price %]</td>
298
                <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