Bugzilla – Attachment 38121 Details for
Bug 10472
Receipt by line or invoice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10472 - Receipt by line or invoice
Bug-10472---Receipt-by-line-or-invoice.patch (text/plain), 6.21 KB, created by
Mark Tompsett
on 2015-04-18 20:22:39 UTC
(
hide
)
Description:
Bug 10472 - Receipt by line or invoice
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-04-18 20:22:39 UTC
Size:
6.21 KB
patch
obsolete
>From 1aa97431f2afdddd15015fe34fb10fcdc92911eb Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amitddng135@gmail.com> >Date: Sat, 22 Jun 2013 23:01:21 +0530 >Subject: [PATCH] Bug 10472 - Receipt by line or invoice >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To select to âreceipt inâ items either by per line >or the entire invoice. > >Test plan: >1) Acquisitions preferences should be "AcqCreateItem -> >placing an order". >2) Create a basket. >3) Create orders under basket and close the basket. >4) Click on Receive shipment button. >5) Enter invoice number, shipmentdate and cost. >6) Search Basketno which you want to receive for ex: basketno 50 >and click on filter button. >7) After search "Receipt all" link is appear. >8) Click on "Receipt all" link you would be able to receive all >the order against the basketno. > >Sponsored-by: Staffordshire University/Halton Borough Council/PTFS Europe > >http://bugs.koha-community.org/show_bug.cgi?id=10440 >--- > 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 > >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index d37c8d9..bfc8495 100755 >--- a/acqui/parcel.pl >+++ b/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, >diff --git a/acqui/receiptorder.pl b/acqui/receiptorder.pl >new file mode 100755 >index 0000000..e370b4c >--- /dev/null >+++ b/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"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index a244f5f..c44bad0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -320,7 +320,9 @@ > <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>. > </p> > [% END %] >- >+[% IF ( result )%] >+ <a href="/cgi-bin/koha/acqui/receiptorder.pl?basketno=[% basketno %]&invoiceid=[% invoiceid %]&booksellerid=[% booksellerid %]&datereceived=[% datereceived %]">Receipt all</a> >+[% END %] > <div id="acqui_receive_receivelist"> > <h3>Already received</h3> > >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10472
:
19210
| 38121