@@ -, +, @@ --- acqui/parcel.pl | 17 +++++ acqui/receiptorder.pl | 86 ++++++++++++++++++++++ .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 4 +- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100755 acqui/receiptorder.pl --- a/acqui/parcel.pl +++ a/acqui/parcel.pl @@ -193,6 +193,23 @@ unless( defined $invoice->{closedate} ) { $orderno = $input->param('orderfilter') || ''; $basketgroupname = $input->param('basketgroupnamefilter') || ''; } + my $grouped; + my $owner; + $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean); + my $dbh = C4::Context->dbh; + my $rv = $dbh->selectall_arrayref( + 'SELECT COUNT(*) as count FROM aqorders_items LEFT JOIN aqorders + ON aqorders.ordernumber = aqorders_items.ordernumber WHERE + aqorders.basketno = ?', + { Slice => {} }, $basketno + ); + if ( $rv->[0]->{count} ) { + $template->param( + result => $rv->[0]->{count}, + basketno => $basketno, + datereceived => $datereceived + ); + } $pendingorders = SearchOrders({ booksellerid => $booksellerid, basketname => $basketname, --- a/acqui/receiptorder.pl +++ a/acqui/receiptorder.pl @@ -0,0 +1,86 @@ +#!/usr/bin/perl + +# Copyright 2013 Amit Gupta (amitddng135@gmail.com) +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +receiptorder.pl + +=head1 DESCRIPTION + +Search for receiptorder by basketno (Choose system preference AcqCreateItem -> placing an order) + +=cut + +use strict; +use warnings; + +use CGI; +use C4::Auth; +use C4::Output; +use C4::Acquisition qw/ GetOrders GetOrder ModReceiveOrder /; + +my $input=new CGI; +my $flagsrequired = {acquisition => 'order_receive'}; + +checkauth($input, 0, $flagsrequired, 'intranet'); + +my $basketno = $input->param('basketno'); +my $datereceived = $input->param('datereceived'); +my $booksellerid = $input->param('booksellerid'); +my $invoiceid = $input->param('invoiceid'); +my $user = $input->remote_user; + +my @details = GetOrders($basketno); + +foreach my $detail(@details) { + my $order = GetOrder($detail->{'ordernumber'}); + $order->{rrp} = $detail->{'rrp'}; + $order->{ecost} = $detail->{'ecost'}; + $order->{unitprice} = $detail->{'ecost'}; + my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid); + if ( $bookseller->{listincgst} ) { + if ( not $bookseller->{invoiceincgst} ) { + $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} ); + $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} ); + $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} ); + } + } else { + if ( $bookseller->{invoiceincgst} ) { + $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} ); + $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} ); + $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} ); + } + } + if ( $detail->{'quantity'} > 0 ) { + ($datereceived, $order) = ModReceiveOrder( + $detail->{'biblionumber'}, + $detail->{'ordernumber'}, + $detail->{'quantity'}, + $user, + $order->{unitprice}, + $order->{ecost}, + $invoiceid, + $order->{rrp}, + undef, + $datereceived, + undef, + ); + } + +} +print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -320,7 +320,9 @@ Reopen it.

[% END %] - +[% IF ( result )%] + Receipt all +[% END %]

Already received

--