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(dt_from_string) unless $self->entrydate;
80
    $self->entrydate(dt_from_string) unless $self->entrydate;
74
81
(-)a/acqui/orderreceive.pl (-8 / +2 lines)
Lines 183-196 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
if ( $authorised_patron ) { # This should not happen unless there was a migration issue (or very old install?)
189
    $template->param(
190
        memberfirstname  => $authorised_patron->firstname || "",
191
        membersurname    => $authorised_patron->surname || "",
192
    );
193
}
194
187
195
my $budget = GetBudget( $order->{budget_id} );
188
my $budget = GetBudget( $order->{budget_id} );
196
189
Lines 223-228 $template->param( Link Here
223
    ecost                 => $ecost,
216
    ecost                 => $ecost,
224
    unitprice             => $unitprice,
217
    unitprice             => $unitprice,
225
    tax_rate              => $tax_rate,
218
    tax_rate              => $tax_rate,
219
    creator               => $creator,
226
    invoiceid             => $invoice->{invoiceid},
220
    invoiceid             => $invoice->{invoiceid},
227
    invoice               => $invoice->{invoicenumber},
221
    invoice               => $invoice->{invoicenumber},
228
    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 3159-3164 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3159
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3159
  `unitprice_tax_excluded` decimal(28,6) default NULL, -- the unit price excluding tax (on receiving)
3160
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3160
  `unitprice_tax_included` decimal(28,6) default NULL, -- the unit price including tax (on receiving)
3161
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3161
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3162
  `created_by` int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3162
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3163
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3163
  `cancellationreason` MEDIUMTEXT default NULL, -- reason of cancellation
3164
  `cancellationreason` MEDIUMTEXT default NULL, -- reason of cancellation
3164
  `order_internalnote` LONGTEXT, -- notes related to this order line, made for staff
3165
  `order_internalnote` LONGTEXT, -- notes related to this order line, made for staff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +13 lines)
Lines 173-179 Link Here
173
            [% END %]
173
            [% END %]
174
       </select></li>
174
       </select></li>
175
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
175
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
176
       <li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
176
       <li>
177
        <label for="creator">Created by: </label>
178
        <span>
179
          [% IF (creator && creator.firstname && creator.surname) %]
180
            [% IF creator.firstname %]
181
              [% creator.firstname %]
182
            [% END %]
183
            [% creator.surname %]
184
          [% ELSE %]
185
            No name
186
          [% END %]
187
        </span>
188
       </li>
177
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
189
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
178
           [% IF ( edit and not subscriptionid) %]
190
           [% IF ( edit and not subscriptionid) %]
179
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
191
               <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 114-120 Link Here
114
            <th>Basket group</th>
114
            <th>Basket group</th>
115
            <th>Order line</th>
115
            <th>Order line</th>
116
            <th>Summary</th>
116
            <th>Summary</th>
117
            <th>View record</th>
117
            <th>More</th>
118
            <th>Quantity</th>
118
            <th>Quantity</th>
119
            <th>Unit cost</th>
119
            <th>Unit cost</th>
120
            <th>Order cost</th>
120
            <th>Order cost</th>
Lines 162-168 Link Here
162
                    [<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>]
162
                    [<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>]
163
                [% END %]
163
                [% END %]
164
                </td>
164
                </td>
165
                <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>
165
                <td>
166
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" class="previewData">Order</a><br>
167
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a><br>
168
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a>
169
                </td>
166
                <td>[% loop_order.quantity %]</td>
170
                <td>[% loop_order.quantity %]</td>
167
                <td>[% loop_order.ecost | $Price %]</td>
171
                <td>[% loop_order.ecost | $Price %]</td>
168
                <td>[% loop_order.total | $Price %]</td>
172
                <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