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

(-)a/C4/Acquisition.pm (-1 / +7 lines)
Lines 1266-1277 sub NewOrder { Link Here
1266
    my $dbh = C4::Context->dbh;
1266
    my $dbh = C4::Context->dbh;
1267
    my @params;
1267
    my @params;
1268
1268
1269
1270
    # if these parameters are missing, we can't continue
1269
    # if these parameters are missing, we can't continue
1271
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1270
    for my $key (qw/basketno quantity biblionumber budget_id/) {
1272
        croak "Mandatory parameter $key missing" unless $orderinfo->{$key};
1271
        croak "Mandatory parameter $key missing" unless $orderinfo->{$key};
1273
    }
1272
    }
1274
1273
1274
    if (not defined $orderinfo->{createdby}) {
1275
        my $userenv = C4::Context->userenv;
1276
        if ($userenv) {
1277
            $orderinfo->{createdby} = $userenv->{number};
1278
        }
1279
    }
1280
1275
    $orderinfo->{'entrydate'} ||= C4::Dates->new()->output("iso");
1281
    $orderinfo->{'entrydate'} ||= C4::Dates->new()->output("iso");
1276
    if (!$orderinfo->{quantityreceived}) {
1282
    if (!$orderinfo->{quantityreceived}) {
1277
        $orderinfo->{quantityreceived} = 0;
1283
        $orderinfo->{quantityreceived} = 0;
(-)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 3019-3024 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3019
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3019
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3020
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3020
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3021
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3021
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3022
  createdby int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3022
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3023
  `cancelledby` varchar(10) default NULL, -- not used? always NULL
3023
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3024
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3024
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3025
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 8705-8710 if ( CheckVersion($DBversion) ) { Link Here
8705
}
8705
}
8706
8706
8707
8707
8708
$DBversion = "XXX";
8709
if ( CheckVersion($DBversion) ) {
8710
    $dbh->do(q{
8711
        ALTER TABLE aqorders
8712
        ADD COLUMN createdby int(11) NULL DEFAULT NULL AFTER quantityreceived
8713
    });
8714
    print "Upgrade to $DBversion done (Bug 12395: Add aqorders.createdby column)\n";
8715
    SetVersion ($DBversion);
8716
}
8717
8708
=head1 FUNCTIONS
8718
=head1 FUNCTIONS
8709
8719
8710
=head2 TableExists($table)
8720
=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 244-250 Link Here
244
            <th>Basket group</th>
244
            <th>Basket group</th>
245
            <th>Order line</th>
245
            <th>Order line</th>
246
            <th>Summary</th>
246
            <th>Summary</th>
247
            <th>View record</th>
247
            <th>More</th>
248
            <th>Quantity</th>
248
            <th>Quantity</th>
249
            <th>Unit cost</th>
249
            <th>Unit cost</th>
250
            <th>Order cost</th>
250
            <th>Order cost</th>
Lines 287-293 Link Here
287
                    [<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
                    [<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
                [% END %]
288
                [% END %]
289
                </td>
289
                </td>
290
                <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>
290
                <td>
291
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" title="Order" rel="gb_page_center[600,500]">Order</a><br>
292
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a><br>
293
                  <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>
294
                </td>
291
                <td>[% loop_order.quantity %]</td>
295
                <td>[% loop_order.quantity %]</td>
292
                <td>[% loop_order.ecost %]</td>
296
                <td>[% loop_order.ecost %]</td>
293
                <td>[% loop_order.ordertotal %]</td>
297
                <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