From b5b84d83e7c9c0c42f4800d2f0b601c6ac076a9c Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Wed, 18 Jul 2012 17:17:47 +0530 Subject: [PATCH 2/2] Bug 8456 - Capture the invoice number, price, date of a subscription To Test: Create an order using a subscription. This order is different from regular orders in that it is for a serial subscription, not for a book. When receiving, the item add function does not work as it does in the case of books. Here no item is added since items are added from serials module. But invoice, invoice date, actual cost is captured when receiving. Two cases here: 1) Systempreferences "AcqCreateItem" is set to "receiving an order" When receiving this message is displayed instead of the usual add item fields -- "This order is for a serial subscription. Items are added in the serial module." 2) Systempreferences "AcqCreateItem" is set to "placing an order" When ordering this message is displayed instead of the usual add item fields -- "This order is for a serial subscription. Items are added in the serial module." --- acqui/neworderempty.pl | 12 ++++++++---- acqui/orderreceive.pl | 8 +++++++- .../prog/en/modules/acqui/neworderempty.tt | 5 +++++ .../prog/en/modules/acqui/orderreceive.tt | 4 ++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 85d9739..69f6916 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -317,10 +317,14 @@ if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { unless($marc) { $template->param('NoACQframework' => 1); } - $template->param( - AcqCreateItemOrdering => 1, - UniqueItemFields => C4::Context->preference('UniqueItemFields'), - ); + unless($subscriptionid){ + $template->param( + AcqCreateItemOrdering => 1, + UniqueItemFields => C4::Context->preference('UniqueItemFields'), + ); + } else { + $template->param( subscription => 1,); + } } # Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio my @itemtypes; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 85168d5..aa28a59 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -93,6 +93,8 @@ my $datereceived = $input->param('datereceived'); $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new(); my $bookseller = GetBookSellerFromId($booksellerid); +my $sub = GetOrder($ordernumber); +my $subscriptionid = $sub->{'subscriptionid'}; my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; my $results = SearchOrder($ordernumber,$search); @@ -121,10 +123,14 @@ if ( $count == 1 ) { my $AcqCreateItem = C4::Context->preference('AcqCreateItem'); if ($AcqCreateItem eq 'receiving') { - $template->param( + unless($subscriptionid){ + $template->param( AcqCreateItemReceiving => 1, UniqueItemFields => C4::Context->preference('UniqueItemFields'), ); + } else { + $template->param( subscription => 1,); + } } elsif ($AcqCreateItem eq 'ordering') { my $fw = ($acq_fw) ? 'ACQ' : ''; my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index fd1a93f..57b8aae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -383,6 +383,11 @@ $(document).ready(function() [% END %][%# IF (AcqCreateItemOrdering) %] + [% IF (subscription) %] +

+ This order is for a serial subscription. Items are added in the serial module. +

+ [% END %]
Accounting Details
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 821dcd3..5f60aa2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -234,6 +234,10 @@ [% END %] + [% ELSIF (subscription) %] +

    + This order is for a serial subscription. Items are added in the serial module. +

    [% END %] -- 1.6.4.2