[Koha-cvs] koha maninvoice.pl C4/Koha.pm koha-tmpl/intrane... [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Mon Apr 23 18:30:36 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/04/23 16:30:36

Modified files:
	.              : maninvoice.pl 
	C4             : Koha.pm 
	koha-tmpl/intranet-tmpl/ccfls/en: maninvoice.tmpl 

Log message:
	Added ability to scan item instead of typing itemnumber in maininvoice.pl

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/maninvoice.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.8&r2=1.8.6.1
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.13&r2=1.22.2.4.2.14
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/ccfls/en/maninvoice.tmpl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.1&r2=1.1.2.1.2.2

Patches:
Index: maninvoice.pl
===================================================================
RCS file: /sources/koha/koha/Attic/maninvoice.pl,v
retrieving revision 1.8
retrieving revision 1.8.6.1
diff -u -b -r1.8 -r1.8.6.1
--- maninvoice.pl	23 Apr 2003 12:20:27 -0000	1.8
+++ maninvoice.pl	23 Apr 2007 16:30:36 -0000	1.8.6.1
@@ -28,6 +28,7 @@
 use CGI;
 use C4::Search;
 use C4::Accounts2;
+use C4::Koha;
 use HTML::Template;
 
 my $input=new CGI;
@@ -39,6 +40,12 @@
 if ($add){
 #  print $input->header;
   my $itemnum=$input->param('itemnum');
+  
+  my $barcode=$input->param('barcode');
+  if ( $barcode ) {
+    $itemnum = getItemnumberByBarcode( $barcode );
+  }
+
   my $desc=$input->param('desc');
   my $amount=$input->param('amount');
   my $type=$input->param('type');

Index: C4/Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.13
retrieving revision 1.22.2.4.2.14
diff -u -b -r1.22.2.4.2.13 -r1.22.2.4.2.14
--- C4/Koha.pm	21 Apr 2007 17:45:54 -0000	1.22.2.4.2.13
+++ C4/Koha.pm	23 Apr 2007 16:30:36 -0000	1.22.2.4.2.14
@@ -80,6 +80,9 @@
 			&displayPrimaryServers
 			&displaySecondaryServers
 			&displayLanguages
+
+                        getItemnumberByBarcode
+
 			$DEBUG);
 
 use vars qw();
@@ -1125,6 +1128,23 @@
 	return \%values;
 }
 
+sub getItemnumberByBarcode {
+  my ( $barcode ) = @_;
+  
+  my $dbh = C4::Context->dbh;
+    
+  my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE barcode = ?");
+  $sth->execute( $barcode ) or return( 0 );
+        
+  my $row = $sth->fetchrow_hashref;
+          
+  my $itemnumber = $$row{'itemnumber'};
+  $sth->finish;
+              
+  return( $itemnumber );
+}
+                
+
 1;
 __END__
 

Index: koha-tmpl/intranet-tmpl/ccfls/en/maninvoice.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/ccfls/en/Attic/maninvoice.tmpl,v
retrieving revision 1.1.2.1.2.1
retrieving revision 1.1.2.1.2.2
diff -u -b -r1.1.2.1.2.1 -r1.1.2.1.2.2
--- koha-tmpl/intranet-tmpl/ccfls/en/maninvoice.tmpl	30 Nov 2006 15:56:27 -0000	1.1.2.1.2.1
+++ koha-tmpl/intranet-tmpl/ccfls/en/maninvoice.tmpl	23 Apr 2007 16:30:36 -0000	1.1.2.1.2.2
@@ -7,7 +7,7 @@
 		<img src="<!-- TMPL_VAR NAME='themelang' -->/images/subTab-members-search-selected.png" border="0" />
 	</a>
 </div>
-
+<!-- HIDE FOR CCFLS
 <div id="subTab-2">
 	<a href="/cgi-bin/koha/members/memberentry.pl?actionType=Add">
 		<img src="<!-- TMPL_VAR NAME='themelang' -->/images/subTab-members-addMember-unselected.png" border="0" />
@@ -19,27 +19,24 @@
 		<img src="<!-- TMPL_VAR NAME='themelang' -->/images/subTab-members-addOrganization-unselected.png" border="0" />
 	</a>
 </div>
-
+-->
 <dl class="bodyPane">
-<dt class="bodyPane">Patrons: Create Manual Invoice</dt>
+<dt class="bodyPane">Patrons: Add Fine or Charge</dt>
 <dd class="bodyPane">
 
 <div id="main">
 <form class="inline" action="/cgi-bin/koha/maninvoice.pl" method="post"><input type="hidden" name="bornum" value="<!-- TMPL_VAR Name="bornum" -->" />
-	<div class="data"><table>
-	<caption>Manual Invoice</caption>
-	<tr><th>Borrowernumber</th><td><!-- TMPL_VAR Name="bornum" --></td></tr>
+	<div class="data">
+          <table>
+	    <tr><th>Borrowernumber</th><td><!-- TMPL_VAR Name="bornum" --></td><td></td></tr>
 	<tr><th>Type</th><td><select name="type">
 <option value="L">Lost Item</option>
 <option value="F">Fine</option>
-<option value="A">Account Management Fee</option>
-<option value="N">New Card</option>
-<option value="M">Sundry</option>
-<option value="REF">Cash Refund</option>
-</select></td></tr>
-	<tr><th>Itemnumber</th><td><input type="text" name="itemnum" /></td></tr>
-	<tr><th>Description</th><td><input type="text" name="desc" size="50" /></td></tr>
-	<tr><th>Amount</th><td>$<input type="text" name="amount" /></td></tr>
+</select></td><td></td></tr>
+	<tr><th>Itemnumber</th><td><input type="text" name="itemnum" /></td><td><i>Optional: Alternative to Barcode</i></td></tr>
+	<tr><th>Description</th><td><input type="text" name="desc" size="50" /></td><td></td></tr>
+	<tr><th>Amount</th><td>$<input type="text" name="amount" /></td><td></td></tr>
+	<tr><th>Barcode</th><td><input type="text" name="barcode" /></td><td><i>Item Barcode</i></td></tr>
 	</table></div>
 <input type="submit" name="add" value="Add Charge" class="submit" />
 </form> <form class="inline" action="/cgi-bin/koha/boraccount.pl" method="get"><input type="hidden" name="bornum" value="<!-- TMPL_VAR Name="bornum" -->" /><input type="submit" class="cancel" value="Cancel" /></form>





More information about the Koha-cvs mailing list