add item-level location,collection fields to orderreceive

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan Higgins 2008-01-01 14:52:52 -06:00 committed by Joshua Ferraro
parent c9a35c1089
commit 0c2bb2ada2
3 changed files with 82 additions and 39 deletions

View File

@ -46,7 +46,7 @@ the number of this invoice.
=item biblio
The biblionumber of this order.
=item daterecieved
=item datereceived
=item catview
@ -72,11 +72,11 @@ my $input = new CGI;
my $supplierid = $input->param('supplierid');
my $dbh = C4::Context->dbh;
my $search = $input->param('recieve');
my $search = $input->param('receive');
my $invoice = $input->param('invoice');
my $freight = $input->param('freight');
my $biblionumber = $input->param('biblionumber');
my $daterecieved = C4::Dates->new($input->param('datereceived'),'iso') || C4::Dates->new();
my $datereceived = C4::Dates->new($input->param('datereceived'),'iso') || C4::Dates->new();
my $catview = $input->param('catview');
my $gst = $input->param('gst');
@ -101,35 +101,40 @@ $template->param($count);
if ( $count == 1 ) {
my (@itemtypesloop,@locationloop,@ccodeloop);
my $itemtypes = GetItemTypes;
my @itemtypesloop;
foreach my $thisitemtype (sort keys %$itemtypes) {
my %row = (
my %row = (
value => $thisitemtype,
description => $itemtypes->{$thisitemtype}->{'description'},
selected => ($thisitemtype eq $results[0]->{itemtype}), # ifdef itemtype @ bibliolevel, use it as default for item level.
);
push @itemtypesloop, \%row;
}
$template->param(itemtypeloop => \@itemtypesloop);
my $locations = GetKohaAuthorisedValues( 'items.location' );
if ($locations) {
my @location_codes = keys %$locations;
my $CGIlocation = CGI::scrolling_list(
-name => 'location',
-id => 'location',
-values => \@location_codes,
-default => $results[0]->{'itemtype'},
-labels => $locations,
-size => 1,
-tabindex => '',
-multiple => 0
);
$template->param( CGIlocation => $CGIlocation );
my $locs = GetKohaAuthorisedValues( 'items.location' );
foreach my $thisloc (sort keys %$locs) {
warn $thisloc;
my $row = {
value => $thisloc,
description => $locs->{$thisloc},
};
push @locationloop, $row;
}
my $onlymine=C4::Context->preference('IndependantBranches') &&
my $ccodes= GetKohaAuthorisedValues( 'items.ccode' );
foreach my $thisccode (sort keys %$ccodes) {
push @ccodeloop, {
value => $thisccode,
description => $ccodes->{$thisccode},
};
}
$template->param(itemtypeloop => \@itemtypesloop ,
locationloop => \@locationloop,
ccodeloop => \@ccodeloop,
itype => C4::Context->preference('item-level_itypes'),
);
my $onlymine=C4::Context->preference('IndependantBranches') &&
C4::Context->userenv &&
C4::Context->userenv->{flags} !=1 &&
C4::Context->userenv->{branch};
@ -138,7 +143,7 @@ if ( $count == 1 ) {
foreach my $thisbranch ( sort keys %$branches ) {
my %row = (
value => $thisbranch,
branchname => $branches->{$thisbranch}->{'branchname'},
description => $branches->{$thisbranch}->{'branchname'},
);
push @branchloop, \%row;
}
@ -191,7 +196,7 @@ if ( $count == 1 ) {
ecost => $results[0]->{'ecost'},
unitprice => $results[0]->{'unitprice'},
invoice => $invoice,
daterecieved => $daterecieved->output(),
datereceived => $datereceived->output(),
);
}
else {
@ -200,7 +205,7 @@ else {
my %line = %{ $results[$i] };
$line{invoice} = $invoice;
$line{daterecieved} = $daterecieved->output();
$line{datereceived} = $datereceived->output();
$line{freight} = $freight;
$line{gst} = $gst;
$line{title} = $results[$i]->{'title'};
@ -211,7 +216,7 @@ else {
$template->param(
loop => \@loop,
date => format_date($date),
daterecieved => $daterecieved->output(),
datereceived => $datereceived->output(),
name => $booksellers[0]->{'name'},
supplierid => $supplierid,
invoice => $invoice,

View File

@ -26,22 +26,60 @@
<ol><li><span class="label">Title: </span><!-- TMPL_VAR NAME="title" --></li>
<li> <span class="label">Author: </span>
<!-- TMPL_VAR NAME="author" --></li>
<li><span class="label">Copyright Date: </span>
<li><span class="label">Copyright: </span>
<!-- TMPL_VAR NAME="copyrightdate" --></li>
<li> <span class="label">ISBN: </span>
<!-- TMPL_VAR NAME="isbn" --></li>
<li> <span class="label">Series: </span>
<!-- TMPL_VAR NAME="seriestitle" --></li>
<li> <label for="barcode">Item Barcode: </label>
<input type="text" size="20" name="barcode" id="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" /></li>
<li> <label for="volinf">Volume Info (for serials): </label>
<input type="text" size="20" name="volinf" id="volinf" /></li></ol>
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<li> <label for="barcode">Item Barcode: </label>
<input type="text" size="20" name="barcode" id="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" /></li>
<li> <label for="homebranch">Home Library: </label>
<select name="homebranch" id="homebranch"> <!-- TMPL_LOOP name="branchloop" -->
<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
<!-- TMPL_IF NAME="locationloop" -->
<li> <label for="location">Shelf location: </label>
<select name="location" id="location"> <!-- TMPL_LOOP name="locationloop" -->
<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itype" -->
<li> <label for="itemtype">Item type: </label>
<select name="itemtype" id="itemtype"> <!-- TMPL_LOOP name="itemtypeloop" -->
<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="ccodeloop" -->
<li> <label for="ccode">Collection: </label>
<select name="ccode" id="ccode"> <!-- TMPL_LOOP name="ccodeloop" -->
<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
<!-- TMPL_ELSE -->
<option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</select></li>
<!-- /TMPL_IF -->
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="ordnum" value="<!-- TMPL_VAR NAME="ordernumber" -->" />
<input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
<input type="hidden" name="supplierid" value="<!-- TMPL_VAR NAME="supplierid" -->" />
<input type="hidden" name="daterecieved" value="<!-- TMPL_VAR NAME="daterecieved" -->" />
<input type="hidden" name="datereceived" value="<!-- TMPL_VAR NAME="datereceived" -->" />
<input type="hidden" name="freight" value="<!-- TMPL_VAR NAME="freight" -->" />
<input type="hidden" name="gst" value="<!-- TMPL_VAR NAME="gst" -->" />
</fieldset>
@ -83,10 +121,10 @@
<tr>
<td><!-- TMPL_VAR NAME="basketno" --></td>
<td><!-- TMPL_VAR NAME="isbn" --></td>
<td><a href="orderreceive.pl?daterecieved=<!-- TMPL_VAR NAME="daterecieved" -->&amp;recieve=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblio=<!-- TMPL_VAR NAME="biblionumber" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;id=<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="title" --></a></td>
<td><a href="orderreceive.pl?datereceived=<!-- TMPL_VAR NAME="datereceived" -->&amp;receive=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblio=<!-- TMPL_VAR NAME="biblionumber" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;id=<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="title" --></a></td>
<td><!-- TMPL_VAR NAME="author" --></td>
<td><!-- TMPL_VAR NAME="quantity" --></td>
<td><!-- TMPL_VAR NAME="quantityrecieved" --></td>
<td><!-- TMPL_VAR NAME="quantityreceived" --></td>
</tr>
<!-- /TMPL_LOOP -->
</table>
@ -99,4 +137,4 @@
<!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

View File

@ -47,7 +47,7 @@
</tr>
<!-- TMPL_LOOP NAME="loop_received" -->
<tr>
<td><a href="orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;daterecieved=<!-- TMPL_VAR NAME="datereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="quantityreceived" --></a></td>
<td><a href="orderreceive.pl?receive=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;datereceived=<!-- TMPL_VAR NAME="datereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->"><!-- TMPL_VAR NAME="quantityreceived" --></a></td>
<td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->"><!-- TMPL_VAR NAME="basketno" --></a>&nbsp; / &nbsp;<!-- TMPL_VAR NAME="ordernumber" --></td>
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
<!-- TMPL_IF NAME="isbn" --><br />ISBN: <!-- TMPL_VAR NAME="isbn" --><!--/TMPL_IF-->
@ -102,7 +102,7 @@
<input type="hidden" name="gst" value="<!-- TMPL_VAR NAME="gst" -->" />
<input type="hidden" name="freight" value="<!-- TMPL_VAR NAME="freight" -->" />
<input type="hidden" name="invoice" value="<!-- TMPL_VAR NAME="invoice" -->" />
<p><label for="recieve">Search ISBN or Title:</label> <input type="text" size="25" id="recieve" name="recieve" /></p>
<p><label for="receive">Search ISBN or Title:</label> <input type="text" size="25" id="receive" name="receive" /></p>
</form>
<table> <caption>or select a pending orders</caption>
<tr>
@ -128,7 +128,7 @@
<td> <!-- TMPL_VAR NAME="quantityreceived" --> / <!-- TMPL_VAR NAME="quantity" --></td>
<td><!-- TMPL_VAR NAME="ecost" --></td>
<td><!-- TMPL_IF EXPR="unitprice ne '0.00'" --><!-- TMPL_VAR NAME="unitprice" --><!-- /TMPL_IF --></td>
<td><a href="orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;daterecieved=<!-- TMPL_VAR NAME="datereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Receive</a></td>
<td><a href="orderreceive.pl?receive=<!-- TMPL_VAR NAME="ordernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;datereceived=<!-- TMPL_VAR NAME="datereceived" -->&amp;invoice=<!-- TMPL_VAR NAME="invoice" -->&amp;gst=<!-- TMPL_VAR NAME="gst" -->&amp;freight=<!-- TMPL_VAR NAME="freight" -->&amp;supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Receive</a></td>
</tr>
<!-- /TMPL_LOOP -->
<tr><td colspan="2">&nbsp;</td>