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

(-)a/acqui/parcel.pl (+14 lines)
Lines 219-224 if(!defined $invoice->{closedate}) { Link Here
219
        my $grouped;
219
        my $grouped;
220
        my $owner;
220
        my $owner;
221
        $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean);
221
        $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean);
222
        my $dbh = C4::Context->dbh;
223
        my $rv = $dbh->selectall_arrayref(
224
            'SELECT COUNT(*) as count FROM aqorders_items LEFT JOIN aqorders
225
            ON aqorders.ordernumber = aqorders_items.ordernumber WHERE
226
            aqorders.basketno = ?',
227
            { Slice => {} }, $basketno
228
        );
229
        if ( $rv->[0]->{count} ) {
230
            $template->param(
231
                    result => $rv->[0]->{count},
232
                    basketno => $basketno,
233
                    datereceived => $datereceived
234
                    );
235
        }
222
    }else{
236
    }else{
223
        $pendingorders = GetPendingOrders($booksellerid);
237
        $pendingorders = GetPendingOrders($booksellerid);
224
    }
238
    }
(-)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 249-255 Link Here
249
        <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
249
        <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
250
    </p>
250
    </p>
251
[% END %]
251
[% END %]
252
252
[% IF ( result )%]
253
    <a href="/cgi-bin/koha/acqui/receiptorder.pl?basketno=[% basketno %]&amp;invoiceid=[% invoiceid %]&amp;booksellerid=[% booksellerid %]&amp;datereceived=[% datereceived %]">Receipt all</a>
254
[% END %]
253
<div id="acqui_receive_receivelist">
255
<div id="acqui_receive_receivelist">
254
    <h3>Already received</h3>
256
    <h3>Already received</h3>
255
257
256
- 

Return to bug 10440