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

(-)a/Koha/Acquisition/Order.pm (+7 lines)
Lines 32-37 sub insert { Link Here
32
          unless $self->{$key};
32
          unless $self->{$key};
33
    }
33
    }
34
34
35
    if (not defined $self->{createdby}) {
36
        my $userenv = C4::Context->userenv;
37
        if ($userenv) {
38
            $self->{createdby} = $userenv->{number};
39
        }
40
    }
41
35
    $self->{quantityreceived} ||= 0;
42
    $self->{quantityreceived} ||= 0;
36
    $self->{entrydate} ||=
43
    $self->{entrydate} ||=
37
      output_pref( { dt => dt_from_string, dateformat => 'iso' } );
44
      output_pref( { dt => dt_from_string, dateformat => 'iso' } );
(-)a/acqui/orderreceive.pl (-4 / +2 lines)
Lines 191-198 if ( $bookseller->{listincgst} ) { Link Here
191
191
192
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
192
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
193
193
194
my $authorisedby = $order->{authorisedby};
194
my $creator = GetMember( borrowernumber => $order->{createdby} );
195
my $member = GetMember( borrowernumber => $authorisedby );
196
195
197
my $budget = GetBudget( $order->{budget_id} );
196
my $budget = GetBudget( $order->{budget_id} );
198
197
Lines 217-224 $template->param( Link Here
217
    quantityreceived      => $order->{'quantityreceived'},
216
    quantityreceived      => $order->{'quantityreceived'},
218
    rrp                   => sprintf( "%.2f", $rrp ),
217
    rrp                   => sprintf( "%.2f", $rrp ),
219
    ecost                 => sprintf( "%.2f", $ecost ),
218
    ecost                 => sprintf( "%.2f", $ecost ),
220
    memberfirstname       => $member->{firstname} || "",
219
    creator               => $creator,
221
    membersurname         => $member->{surname} || "",
222
    invoiceid             => $invoice->{invoiceid},
220
    invoiceid             => $invoice->{invoiceid},
223
    invoice               => $invoice->{invoicenumber},
221
    invoice               => $invoice->{invoicenumber},
224
    datereceived          => $datereceived->output(),
222
    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 3052-3057 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3052
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3052
  `freight` decimal(28,6) default NULL, -- shipping costs (not used)
3053
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3053
  `unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
3054
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3054
  `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
3055
  createdby int(11) NULL DEFAULT NULL, -- the borrowernumber of order line's creator
3055
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3056
  `datecancellationprinted` date default NULL, -- the date the line item was deleted
3056
  `cancellationreason` text default NULL, -- reason of cancellation
3057
  `cancellationreason` text default NULL, -- reason of cancellation
3057
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
3058
  `order_internalnote` mediumtext, -- notes related to this order line, made for staff
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 9759-9764 if ( CheckVersion($DBversion) ) { Link Here
9759
    SetVersion ($DBversion);
9759
    SetVersion ($DBversion);
9760
}
9760
}
9761
9761
9762
$DBversion = "XXX";
9763
if ( CheckVersion($DBversion) ) {
9764
    $dbh->do(q{
9765
        ALTER TABLE aqorders
9766
        ADD COLUMN createdby int(11) NULL DEFAULT NULL AFTER quantityreceived
9767
    });
9768
    print "Upgrade to $DBversion done (Bug 12395: Add aqorders.createdby column)\n";
9769
    SetVersion ($DBversion);
9770
}
9771
9762
=head1 FUNCTIONS
9772
=head1 FUNCTIONS
9763
9773
9764
=head2 TableExists($table)
9774
=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 231-237 Link Here
231
            <th>Basket group</th>
231
            <th>Basket group</th>
232
            <th>Order line</th>
232
            <th>Order line</th>
233
            <th>Summary</th>
233
            <th>Summary</th>
234
            <th>View record</th>
234
            <th>More</th>
235
            <th>Quantity</th>
235
            <th>Quantity</th>
236
            <th>Unit cost</th>
236
            <th>Unit cost</th>
237
            <th>Order cost</th>
237
            <th>Order cost</th>
Lines 274-280 Link Here
274
                    [<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>]
274
                    [<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>]
275
                [% END %]
275
                [% END %]
276
                </td>
276
                </td>
277
                <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>
277
                <td>
278
                  <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber %]" title="Order" rel="gb_page_center[600,500]">Order</a><br>
279
                  <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a><br>
280
                  <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>
281
                </td>
278
                <td>[% loop_order.quantity %]</td>
282
                <td>[% loop_order.quantity %]</td>
279
                <td>[% loop_order.ecost | $Price %]</td>
283
                <td>[% loop_order.ecost | $Price %]</td>
280
                <td>[% loop_order.total | $Price %]</td>
284
                <td>[% loop_order.total | $Price %]</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