More work on the til reconciliation report
authorChris Cormack <crc@liblime.com>
Tue, 8 Jan 2008 02:42:38 +0000 (20:42 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jan 2008 02:49:19 +0000 (20:49 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Accounts.pm
koha-tmpl/intranet-tmpl/prog/en/modules/reports/stats_screen.tmpl

index 73757a5..e46e39d 100644 (file)
@@ -573,29 +573,26 @@ sub getcredits {
 } 
 
 
-sub getrefunds {                                                                                                                                           
-           my ( $date, $date2 ) = @_;                                                                                                                             
-           my $dbh = C4::Context->dbh;                                                                                                                            
-                                                                                                                                                                  
-           my $sth = $dbh->prepare(                                                                                                                               
-                               "Select *,                                                                                                                                         
-                  date_FORMAT(timestamp, '%Y-%m-%d %H:%i' ) as datetime                                                                                      
-                  from accountlines,borrowers                                                                                                                
-                  where (accounttype = 'REF'                                                                                                                 
-                                                         and accountlines.borrowernumber = borrowers.borrowernumber                                                                                 
-                                                         and date  >=?  and date  <?)"                                                                                                              
-      );                                                                                                                                                     
-                                                                                                                                                           
-    $sth->execute( $date, $date2 );                                                                                                                        
-                                                                                                                                                           
-    my $i = 0;                                                                                                                                             
-    my @results;                                                                                                                                           
-    while ( my $data = $sth->fetchrow_hashref ) {                                                                                                          
-                           $results[$i] = $data ;                                                                                                                         
-                           $i++;                                                                                                                                          
-                   }                                                                                                                                                      
-                                                                                                                                                           
-    return (@results);                                                                                                                                     
+sub getrefunds {
+       my ( $date, $date2 ) = @_;
+       my $dbh = C4::Context->dbh;
+       
+       my $sth = $dbh->prepare(
+                               "SELECT *,timestamp AS datetime                                                                                      
+                  FROM accountlines,borrowers
+                  WHERE (accounttype = 'REF'
+                                         AND accountlines.borrowernumber = borrowers.borrowernumber
+                                                         AND date  >=?  AND date  <?)"
+    );
+
+    $sth->execute( $date, $date2 );
+
+    my @results;
+    while ( my $data = $sth->fetchrow_hashref ) {
+               push @results,$data;
+               
+       }
+    return (@results);
 }
 END { }    # module clean-up code here (global destructor)
 
index 4bd004d..574d70b 100644 (file)
@@ -1,34 +1,45 @@
-<!-- TMPL_INCLUDE NAME="reportswcal-top.inc" -->
-
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> 
+<title>Koha &rsaquo; Reports &rsaquo; Till Reconciliation</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" --> 
+
+</head>    
+<body>   
+<!-- TMPL_INCLUDE NAME="header.inc" -->                                    
+<!-- TMPL_INCLUDE NAME="circ-search.inc" -->
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
+&rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
+&rsaquo; Till Reconciliation
+</div>
+<div id="doc3" class="yui-t1"> 
 <h1>Till Reconciliation</h1>
 
 <h4>Search between two dates</h4>
 <form action="stats.screen.pl" method="post">
   <label>Start Date</label>
   <input type="text" name="time" size="10" value="<!-- TMPL_IF NAME="date" --><!-- TMPL_VAR NAME="date" --><!-- TMPL_ELSE -->today<!-- /TMPL_IF -->" id="from"> 
-  <img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;" />
+  <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;" />
      <script type="text/javascript">
      Calendar.setup({
      inputField     :    "from",
-     ifFormat       :    "%d/%m/%Y",
+     ifFormat       :    "%Y-%m-%d",
      button         :    "buttonfrom1",
      align          :    "Tl"
      });
      </script>
-
   <label>End Date</label>
   <input type="text" name="time2" size="10" value="<!-- TMPL_IF NAME="date2" --><!-- TMPL_VAR NAME="date2" --><!-- TMPL_ELSE -->tomorrow<!-- /TMPL_IF -->" id="to">
-  <img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" id="buttonto1" style="cursor: pointer;" />
+  <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="buttonto1" style="cursor: pointer;" />
      <script type="text/javascript">
      Calendar.setup({
      inputField     :    "to",
-     ifFormat       :    "%d/%m/%Y",
+     ifFormat       :    "%Y-%m-%d",
      button         :    "buttonto1",
      align          :    "Tl"
      });
      </script>
   <input type="submit" value="To Screen" name="submit" class="button">
-  <input type="submit" value="To Excel" name="submit" class="button"> (dd/mm/yyyy)
+<!--  <input type="submit" value="To Excel" name="submit" class="button"> -->
 </form>
 
 <h2>Payments</h2>
 <p>
         <b>Total amount of cash collected:$ <!-- TMPL_VAR NAME="totalcash" --> </b>
 </p>
-<!-- TMPL_INCLUDE NAME="reports-bottom.inc" -->
-</body>
-</html>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->