koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha acqui/orderreceive.pl koha-tmpl/intranet-t... [rel_3_0]


From: Antoine Farnault
Subject: [Koha-cvs] koha acqui/orderreceive.pl koha-tmpl/intranet-t... [rel_3_0]
Date: Tue, 09 Jan 2007 08:30:38 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Antoine Farnault <toins>        07/01/09 08:30:38

Modified files:
        acqui          : orderreceive.pl 
        koha-tmpl/intranet-tmpl/prog/en/acqui: orderreceive.tmpl 

Log message:
        sync with dev_week.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/orderreceive.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.2&r2=1.2.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/orderreceive.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.1&r2=1.2.2.2

Patches:
Index: acqui/orderreceive.pl
===================================================================
RCS file: /sources/koha/koha/acqui/Attic/orderreceive.pl,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -b -r1.2.2.2 -r1.2.2.3
--- acqui/orderreceive.pl       22 Dec 2006 17:17:39 -0000      1.2.2.2
+++ acqui/orderreceive.pl       9 Jan 2007 08:30:38 -0000       1.2.2.3
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: orderreceive.pl,v 1.2.2.2 2006/12/22 17:17:39 hdl Exp $
+# $Id: orderreceive.pl,v 1.2.2.3 2007/01/09 08:30:38 toins Exp $
 
 #script to recieve orders
 #written by address@hidden 24/2/2000
@@ -47,6 +47,8 @@
 =item biblio
 The biblionumber of this order.
 
+=item daterecieved
+
 =item catview
 
 =item gst
@@ -58,14 +60,15 @@
 use strict;
 use CGI;
 use C4::Context;
+use C4::Koha;   # GetKohaAuthorisedValues GetItemTypes
 use C4::Acquisition;
-use C4::Koha;
 use C4::Auth;
 use C4::Interface::CGI::Output;
 use C4::Date;
 use C4::Bookseller;
 use C4::Members;
 use C4::Branch; # GetBranches
+
 my $input      = new CGI;
 my $supplierid = $input->param('supplierid');
 my $dbh        = C4::Context->dbh;
@@ -74,35 +77,59 @@
 my $invoice = $input->param('invoice');
 my $freight = $input->param('freight');
 my $biblio  = $input->param('biblio');
-my $daterecieved  = $input->param('date');
-# ### $daterecieved
-# ### $input
+my $daterecieved = $input->param('daterecieved');
 my $catview = $input->param('catview');
 my $gst     = $input->param('gst');
+
 my @results = SearchOrder( $search, $supplierid, $biblio, $catview );
 my $count = scalar @results;
 
-# warn "C:$count for ordersearch($search,$supplierid,$biblio,$catview);";
 my @booksellers = GetBookSeller( $results[0]->{'booksellerid'} );
 
 my $date = $results[0]->{'entrydate'};
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-{
+    {
         template_name   => "acqui/orderreceive.tmpl",
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
         flagsrequired   => { acquisition => 1 },
         debug           => 1,
-}
+    }
 );
 $template->param($count);
-my ($flags, $homebranch) = GetFlagsAndBranchFromBorrower($loggedinuser);
 
 if ( $count == 1 ) {
-    my $sth;
 
+    my $itemtypes = GetItemTypes;
+    my @itemtypesloop;
+    foreach my $thisitemtype (sort keys %$itemtypes) {
+        my %row = (
+                    value => $thisitemtype,
+                    description => 
$itemtypes->{$thisitemtype}->{'description'},
+                  );
+        push @itemtypesloop, \%row;
+    }
+    
+    $template->param(itemtypeloop => address@hidden);
+
+
+    my $locations = GetKohaAuthorisedValues( $dbh, 'items.location' );
+    if ($locations) {
+        my @location_codes = keys %$locations;
+        my $CGIlocation    = CGI::scrolling_list(
+            -name     => 'location',
+            -id       => 'location',
+            -values   => address@hidden,
+            -default  => $results[0]->{'itemtype'},
+            -labels   => $locations,
+            -size     => 1,
+            -tabindex => '',
+            -multiple => 0
+        );
+        $template->param( CGIlocation => $CGIlocation );
+    }
     my $branches = GetBranches;
     my @branchloop;
     foreach my $thisbranch ( sort keys %$branches ) {
@@ -111,74 +138,75 @@
             branchname => $branches->{$thisbranch}->{'branchname'},
         );
         push @branchloop, \%row;
-}
+    }
 
     my $auto_barcode = C4::Context->boolean_preference("autoBarcode") || 0;
 
-# See whether barcodes should be automatically allocated.
-# Defaults to 0, meaning "no".
+    # See whether barcodes should be automatically allocated.
+    # Defaults to 0, meaning "no".
     my $barcode;
     if ( $auto_barcode eq '1' ) {
-        $sth = $dbh->prepare("Select max(barcode) from items");
+        my $sth = $dbh->prepare("Select max(barcode) from items");
         $sth->execute;
         my $data = $sth->fetchrow_hashref;
         $barcode = $results[0]->{'barcode'} + 1;
         $sth->finish;
-}
+    }
 
     if ( $results[0]->{'quantityreceived'} == 0 ) {
         $results[0]->{'quantityreceived'} = '';
-}
+    }
     if ( $results[0]->{'unitprice'} == 0 ) {
         $results[0]->{'unitprice'} = '';
-}
-    $results[0]->{'copyrightdate'}=format_date( $results[0]->{'copyrightdate'} 
);
+    }
+    $results[0]->{'copyrightdate'} =
+      format_date( $results[0]->{'copyrightdate'} );
     $template->param(
         branchloop       => address@hidden,
         count            => 1,
+        biblionumber          => $results[0]->{'biblionumber'},
+        ordernumber           => $results[0]->{'ordernumber'},
+        biblioitemnumber      => $results[0]->{'biblioitemnumber'},
+        supplierid            => $results[0]->{'booksellerid'},
         freight          => $freight,
         gst              => $gst,
         catview          => ( $catview ne 'yes' ? 1 : 0 ),
         name             => $booksellers[0]->{'name'},
         date             => format_date($date),
-        daterecieved     => $daterecieved,
+        title                 => $results[0]->{'title'},
+        author                => $results[0]->{'author'},
+        copyrightdate         => format_date( $results[0]->{'copyrightdate'} ),
+        itemtype              => $results[0]->{'itemtype'},
+        isbn                  => $results[0]->{'isbn'},
+        seriestitle           => $results[0]->{'seriestitle'},
         barcode          => $barcode,
+        bookfund              => $results[0]->{'bookfundid'},
+        quantity              => $results[0]->{'quantity'},
+        quantityreceivedplus1 => $results[0]->{'quantityreceived'} + 1,
+        quantityreceived      => $results[0]->{'quantityreceived'},
+        rrp                   => $results[0]->{'rrp'},
+        ecost                 => $results[0]->{'ecost'},
+        unitprice             => $results[0]->{'unitprice'},
         invoice          => $invoice,
-        %{$results[0]}
-        # contains biblionumber, ordernumber, biblioitmenumber, supplierid, 
title, author, itemtype, isbn, seriestitle, bookfund, quantity, 
quantityreceived, rrp, ecost, unitprice, notes
-#         biblionumber     => $results[0]->{'biblionumber'},
-#         ordernumber      => $results[0]->{'ordernumber'},
-#         biblioitemnumber => $results[0]->{'biblioitemnumber'},
-#         supplierid       => $results[0]->{'booksellerid'},
-#         title            => $results[0]->{'title'},
-#         author           => $results[0]->{'author'},
-#         itemtype         => $results[0]->{'itemtype'},
-#         isbn             => $results[0]->{'isbn'},
-#         seriestitle      => $results[0]->{'seriestitle'},
-#         bookfund         => $results[0]->{'bookfundid'},
-#         quantity         => $results[0]->{'quantity'},
-#         quantityreceived => $results[0]->{'quantityreceived'},
-#         rrp              => $results[0]->{'rrp'},
-#         ecost            => $results[0]->{'ecost'},
-#         unitprice        => $results[0]->{'unitprice'},
-#         notes            => $results[0]->{'notes'},
+        daterecieved          => $daterecieved,
+        notes                 => $results[0]->{'notes'},
+        intranetcolorstylesheet =>
+          C4::Context->preference("intranetcolorstylesheet"),
+        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+        IntranetNav        => C4::Context->preference("IntranetNav"),
     );
 }
 else {
     my @loop;
     for ( my $i = 0 ; $i < $count ; $i++ ) {
-        my %line=%{$results[$i]};
-#         $line{title}            = $results[$i]->{'title'};
-#         $line{author}           = $results[$i]->{'author'};
-#         $line{isbn}             = $results[$i]->{'isbn'};
-#         $line{basketno}         = $results[$i]->{'basketno'};
-#         $line{quantity}         = $results[$i]->{'quantity'};
-#         $line{quantityrecieved} = $results[$i]->{'quantityreceived'};
-#         $line{ordernumber}      = $results[$i]->{'ordernumber'};
-#         $line{biblionumber}     = $results[$i]->{'biblionumber'};
+        my %line = %{ $results[$i] };
+
         $line{invoice}          = $invoice;
+        $line{daterecieved} = $daterecieved;
         $line{freight}          = $freight;
         $line{gst}              = $gst;
+        $line{title}        = $results[$i]->{'title'};
+        $line{author}       = $results[$i]->{'author'};
         $line{supplierid}       = $supplierid;
         push @loop, \%line;
     }
@@ -189,8 +217,12 @@
         name       => $booksellers[0]->{'name'},
         supplierid => $supplierid,
         invoice    => $invoice,
+        daterecieved            => $daterecieved,
+        intranetcolorstylesheet =>
+          C4::Context->preference("intranetcolorstylesheet"),
+        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+        IntranetNav        => C4::Context->preference("IntranetNav"),
     );
 
 }
 output_html_with_http_headers $input, $cookie, $template->output;
-

Index: koha-tmpl/intranet-tmpl/prog/en/acqui/orderreceive.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/Attic/orderreceive.tmpl,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- koha-tmpl/intranet-tmpl/prog/en/acqui/orderreceive.tmpl     22 Dec 2006 
17:17:39 -0000      1.2.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/acqui/orderreceive.tmpl     9 Jan 2007 
08:30:38 -0000       1.2.2.2
@@ -35,20 +35,61 @@
 
     <h2>Catalogue Details</h2>
     <p><label>Title *</label><input type="text" size="20" name="title" 
value="<!-- TMPL_VAR NAME="title" -->" /></p>
-    <p><label>Author</label><input type="text" size="20" name="author" 
value="<!-- TMPL_VAR NAME="author" -->" /></p>
-    <p><label>Copyright Date</label><input type="text" size="20" 
name="copyright" value="<!-- TMPL_VAR NAME="copyrightdate" -->" /></p>
-    <p><label>Format</label><!-- TMPL_VAR NAME="CGIitemtype" --></p>
-    <p><label>ISBN</label><input type="text" size="20" name="ISBN" value="<!-- 
TMPL_VAR NAME="isbn" -->" /></p>
-    <p><label>Series</label><input type="text" size="20" name="Series" 
value="<!-- TMPL_VAR NAME="seriestitle" -->" /></p>
-    <p><label>Branch</label>
+    <p>
+        <label>Author</label>
+        <input type="text" size="20" name="author" value="<!-- TMPL_VAR 
NAME="author" -->" />
+    </p>
+    <p>
+        <label>Copyright Date</label>
+        <input type="text" size="20" name="copyright" value="<!-- TMPL_VAR 
NAME="copyrightdate" -->" />
+    </p>
+    
+    <!-- TMPL_IF NAME="itemtypeloop" -->
+    <p>
+        <label for="itemtype">Item Type</label>
+        <select id="itemtype" name="itemtype">
+            <option value="">Please choose</option>
+            <!-- TMPL_LOOP name="itemtypeloop" -->
+                <option value="<!-- TMPL_VAR name="value" -->">
+                    <!-- TMPL_VAR name="description" -->
+                </option>
+            <!-- /TMPL_LOOP -->
+        </select>
+    </p>
+    <!-- /TMPL_IF -->
+    
+    <p>
+        <label>ISBN</label>
+        <input type="text" size="20" name="ISBN" value="<!-- TMPL_VAR 
NAME="isbn" -->" />
+    </p>
+    <p>
+        <label>Series</label>
+        <input type="text" size="20" name="Series" value="<!-- TMPL_VAR 
NAME="seriestitle" -->" />
+    </p>
+    <p>
+    <label>Branch</label>
             <select name="branch">
             <!-- TMPL_LOOP name="branchloop" -->
                 <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR 
name="branchname" --></option>
             <!-- /TMPL_LOOP -->
             </select>
     </p>
-    <p><label>Item Barcode *</label><input type="text" size="20" 
name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" /></p>
-    <p><label>Volume Info (for serials) *</label><input type="text" size="20" 
name="volinf" /></p>
+    <p>
+        <label>Item Barcode *</label>
+        <input type="text" size="20" name="barcode" value="<!-- TMPL_VAR 
NAME="barcode" -->" />
+    </p>
+    <p>
+        <label for="location">Location</label>
+        <!-- TMPL_IF NAME="CGIlocation" -->
+            <!-- TMPL_VAR NAME="CGIlocation" -->
+        <!-- TMPL_ELSE -->
+            <input id="location" type="text" size="20" name="location" 
value="<!-- TMPL_VAR name="location" -->" />
+        <!-- /TMPL_IF -->
+    </p>
+    <p>
+        <label>Volume Info (for serials) *</label>
+        <input type="text" size="20" name="volinf" />
+    </p>
     <input type="hidden" name="biblio" value="<!-- TMPL_VAR 
NAME="biblionumber" -->" />
     <input type="hidden" name="ordnum" value="<!-- TMPL_VAR NAME="ordernumber" 
-->" />
     <input type="hidden" name="biblioitemnum" value="<!-- TMPL_VAR 
NAME="biblioitemnumber" -->" />
@@ -56,6 +97,7 @@
     <input type="hidden" name="daterecieved" value="<!-- TMPL_VAR 
NAME="daterecieved" -->" />
     <input type="hidden" name="freight" value="<!-- TMPL_VAR NAME="freight" 
-->" />
     <input type="hidden" name="gst" value="<!-- TMPL_VAR NAME="gst" -->" />
+    
     <h2>Accounting Details</h2>
         <p><label>Bookfund *</label><!-- TMPL_VAR NAME="CGIbookfund" --></p>
         <p><label>Quantity Ordered</label><input type="text" size="20" 
name="quantity" value="<!-- TMPL_VAR NAME="quantity" -->" /></p>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]