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

(-)a/C4/Acquisition.pm (-1 / +7 lines)
Lines 1265-1276 sub NewOrder { Link Here
1265
    my $dbh = C4::Context->dbh;
1265
    my $dbh = C4::Context->dbh;
1266
    my @params;
1266
    my @params;
1267
1267
1268
1269
    # if these parameters are missing, we can't continue
1268
    # if these parameters are missing, we can't continue
1270
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1269
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1271
        croak "Mandatory parameter $key missing" unless $orderinfo->{$key};
1270
        croak "Mandatory parameter $key missing" unless $orderinfo->{$key};
1272
    }
1271
    }
1273
1272
1273
    if (not defined $orderinfo->{createdby}) {
1274
        my $userenv = C4::Context->userenv;
1275
        if ($userenv) {
1276
            $orderinfo->{createdby} = $userenv->{number};
1277
        }
1278
    }
1279
1274
    if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) {
1280
    if ( defined $orderinfo->{subscription} && $orderinfo->{'subscription'} eq 'yes' ) {
1275
        $orderinfo->{'subscription'} = 1;
1281
        $orderinfo->{'subscription'} = 1;
1276
    } else {
1282
    } else {
(-)a/acqui/orderreceive.pl (-4 / +2 lines)
Lines 190-197 if ( $bookseller->{listincgst} ) { Link Here
190
190
191
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
191
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
192
192
193
my $authorisedby = $order->{authorisedby};
193
my $creator = GetMember( borrowernumber => $order->{createdby} );
194
my $member = GetMember( borrowernumber => $authorisedby );
195
194
196
my $budget = GetBudget( $order->{budget_id} );
195
my $budget = GetBudget( $order->{budget_id} );
197
196
Lines 216-223 $template->param( Link Here
216
    quantityreceived      => $order->{'quantityreceived'},
215
    quantityreceived      => $order->{'quantityreceived'},
217
    rrp                   => sprintf( "%.2f", $rrp ),
216
    rrp                   => sprintf( "%.2f", $rrp ),
218
    ecost                 => sprintf( "%.2f", $ecost ),
217
    ecost                 => sprintf( "%.2f", $ecost ),
219
    memberfirstname       => $member->{firstname} || "",
218
    creator               => $creator,
220
    membersurname         => $member->{surname} || "",
221
    invoiceid             => $invoice->{invoiceid},
219
    invoiceid             => $invoice->{invoiceid},
222
    invoice               => $invoice->{invoicenumber},
220
    invoice               => $invoice->{invoicenumber},
223
    datereceived          => $datereceived->output(),
221
    datereceived          => $datereceived->output(),
(-)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 2 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->{createdby});
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/kohastructure.sql (+1 lines)
Lines 3002-3007 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3002
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3002
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3003
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3003
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3004
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3004
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3005
  createdby int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3005
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3006
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3006
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3007
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3007
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3008
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 8551-8556 if (CheckVersion($DBversion)) { Link Here
8551
    SetVersion($DBversion);
8551
    SetVersion($DBversion);
8552
}
8552
}
8553
8553
8554
$DBversion = "XXX";
8555
if ( CheckVersion($DBversion) ) {
8556
    $dbh->do(q{
8557
        ALTER TABLE aqorders
8558
        ADD COLUMN createdby int(11) NULL DEFAULT NULL AFTER quantityreceived
8559
    });
8560
    print "Upgrade to $DBversion done (Bug 12395: Add aqorders.createdby column)\n";
8561
    SetVersion ($DBversion);
8562
}
8563
8554
=head1 FUNCTIONS
8564
=head1 FUNCTIONS
8555
8565
8556
=head2 TableExists($table)
8566
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +13 lines)
Lines 279-285 Link Here
279
            [% END %]
279
            [% END %]
280
       </select></li>
280
       </select></li>
281
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
281
       <li><label>&nbsp;</label><span>(Current: [% budget_period_description %] - [% bookfund %])</span></li>
282
       <li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
282
       <li>
283
        <label for="creator">Created by: </label>
284
        <span>
285
          [% IF (creator && creator.firstname && creator.surname) %]
286
            [% IF creator.firstname %]
287
              [% creator.firstname %]
288
            [% END %]
289
            [% creator.surname %]
290
          [% ELSE %]
291
            No name
292
          [% END %]
293
        </span>
294
       </li>
283
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
295
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
284
           [% IF ( edit and not subscriptionid) %]
296
           [% IF ( edit and not subscriptionid) %]
285
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
297
               <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 243-249 Link Here
243
            <th>Basket group</th>
243
            <th>Basket group</th>
244
            <th>Order line</th>
244
            <th>Order line</th>
245
            <th>Summary</th>
245
            <th>Summary</th>
246
            <th>View record</th>
246
            <th>More</th>
247
            <th>Quantity</th>
247
            <th>Quantity</th>
248
            <th>Unit cost</th>
248
            <th>Unit cost</th>
249
            <th>Order cost</th>
249
            <th>Order cost</th>
Lines 286-292 Link Here
286
                    [<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>]
286
                    [<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>]
287
                [% END %]
287
                [% END %]
288
                </td>
288
                </td>
289
                <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&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
289
                <td>
290
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" title="Order" rel="gb_page_center[600,500]">Order</a><br>
291
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a><br>
292
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
293
                </td>
290
                <td>[% loop_order.quantity %]</td>
294
                <td>[% loop_order.quantity %]</td>
291
                <td>[% loop_order.ecost %]</td>
295
                <td>[% loop_order.ecost %]</td>
292
                <td>[% loop_order.ordertotal %]</td>
296
                <td>[% loop_order.ordertotal %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt (-1 / +39 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>
39

Return to bug 12395