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

(-)a/acqui/parcel.pl (+17 lines)
Lines 193-198 unless( defined $invoice->{closedate} ) { Link Here
193
            $orderno  = $input->param('orderfilter') || '';
193
            $orderno  = $input->param('orderfilter') || '';
194
            $basketgroupname = $input->param('basketgroupnamefilter') || '';
194
            $basketgroupname = $input->param('basketgroupnamefilter') || '';
195
        }
195
        }
196
        my $grouped;
197
        my $owner;
198
        $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean);
199
        my $dbh = C4::Context->dbh;
200
        my $rv = $dbh->selectall_arrayref(
201
            'SELECT COUNT(*) as count FROM aqorders_items LEFT JOIN aqorders
202
            ON aqorders.ordernumber = aqorders_items.ordernumber WHERE
203
            aqorders.basketno = ?',
204
            { Slice => {} }, $basketno
205
        );
206
        if ( $rv->[0]->{count} ) {
207
            $template->param(
208
                    result => $rv->[0]->{count},
209
                    basketno => $basketno,
210
                    datereceived => $datereceived
211
                    );
212
        }
196
        $pendingorders = SearchOrders({
213
        $pendingorders = SearchOrders({
197
            booksellerid => $booksellerid,
214
            booksellerid => $booksellerid,
198
            basketname => $basketname,
215
            basketname => $basketname,
(-)a/acqui/receiptorder.pl (+86 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2013 Amit Gupta (amitddng135@gmail.com)
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
=head1 NAME
20
21
receiptorder.pl
22
23
=head1 DESCRIPTION
24
25
Search for receiptorder by basketno (Choose system preference AcqCreateItem -> placing an order)
26
27
=cut
28
29
use strict;
30
use warnings;
31
32
use CGI;
33
use C4::Auth;
34
use C4::Output;
35
use C4::Acquisition qw/ GetOrders GetOrder ModReceiveOrder /;
36
37
my $input=new CGI;
38
my $flagsrequired = {acquisition => 'order_receive'};
39
40
checkauth($input, 0, $flagsrequired, 'intranet');
41
42
my $basketno = $input->param('basketno');
43
my $datereceived = $input->param('datereceived');
44
my $booksellerid = $input->param('booksellerid');
45
my $invoiceid = $input->param('invoiceid');
46
my $user = $input->remote_user;
47
48
my @details = GetOrders($basketno);
49
50
foreach my $detail(@details) {
51
    my $order = GetOrder($detail->{'ordernumber'});
52
    $order->{rrp} = $detail->{'rrp'};
53
    $order->{ecost} = $detail->{'ecost'};
54
    $order->{unitprice} = $detail->{'ecost'};
55
    my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
56
    if ( $bookseller->{listincgst} ) {
57
        if ( not $bookseller->{invoiceincgst} ) {
58
            $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
59
            $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} );
60
            $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} );
61
        }
62
    } else {
63
        if ( $bookseller->{invoiceincgst} ) {
64
            $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} );
65
            $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} );
66
            $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} );
67
        }
68
    }
69
    if ( $detail->{'quantity'} > 0 ) {
70
        ($datereceived, $order) = ModReceiveOrder(
71
            $detail->{'biblionumber'},
72
            $detail->{'ordernumber'},
73
            $detail->{'quantity'},
74
            $user,
75
            $order->{unitprice},
76
            $order->{ecost},
77
            $invoiceid,
78
            $order->{rrp},
79
            undef,
80
            $datereceived,
81
            undef,
82
        );
83
    }
84
85
}
86
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-2 / +3 lines)
Lines 320-326 Link Here
320
        <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
320
        <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
321
    </p>
321
    </p>
322
[% END %]
322
[% END %]
323
323
[% IF ( result )%]
324
    <a href="/cgi-bin/koha/acqui/receiptorder.pl?basketno=[% basketno %]&amp;invoiceid=[% invoiceid %]&amp;booksellerid=[% booksellerid %]&amp;datereceived=[% datereceived %]">Receipt all</a>
325
[% END %]
324
<div id="acqui_receive_receivelist">
326
<div id="acqui_receive_receivelist">
325
    <h3>Already received</h3>
327
    <h3>Already received</h3>
326
328
327
- 

Return to bug 10440