From 0c2bb2ada2b463c1602bd2af919c5ba5627533bc Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Tue, 1 Jan 2008 14:52:52 -0600 Subject: [PATCH] add item-level location,collection fields to orderreceive Signed-off-by: Joshua Ferraro --- acqui/orderreceive.pl | 61 ++++++++++--------- .../prog/en/modules/acqui/orderreceive.tmpl | 56 ++++++++++++++--- .../prog/en/modules/acqui/parcel.tmpl | 6 +- 3 files changed, 83 insertions(+), 40 deletions(-) diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index cc62fe43fe..bb1de0855b 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -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 $ccodes= GetKohaAuthorisedValues( 'items.ccode' ); + foreach my $thisccode (sort keys %$ccodes) { + push @ccodeloop, { + value => $thisccode, + description => $ccodes->{$thisccode}, + }; } - my $onlymine=C4::Context->preference('IndependantBranches') && + $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, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl index f67456421f..49aff39ec0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tmpl @@ -26,22 +26,60 @@
  1. Title:
  2. Author:
  3. -
  4. Copyright Date: +
  5. Copyright:
  6. -
  7. ISBN:
  8. Series:
  9. -
  10. - " />
- " /> +
  • + " />
  • +
  • +
  • + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + + " /> " /> " /> " /> - " /> + " /> " /> " /> @@ -83,10 +121,10 @@ - &recieve=&biblio=&invoice=&freight=&gst=&id="> + &receive=&biblio=&invoice=&freight=&gst=&id="> - + @@ -99,4 +137,4 @@ - \ No newline at end of file + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl index f54e7bddc3..69885aa0dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl @@ -47,7 +47,7 @@ - &biblionumber=&daterecieved=&invoice=&gst=&freight=&supplierid="> + &biblionumber=&datereceived=&invoice=&gst=&freight=&supplierid="> ">  /   ">
    ISBN: @@ -102,7 +102,7 @@ " /> " /> " /> -

    +

    @@ -128,7 +128,7 @@ - + -- 2.39.5
    or select a pending orders
    / &biblionumber=&daterecieved=&invoice=&gst=&freight=&supplierid=">Receive&biblionumber=&datereceived=&invoice=&gst=&freight=&supplierid=">Receive