Specify datereceived when receiving a new parcel.
authorRyan Higgins <rch@liblime.com>
Wed, 2 Jan 2008 00:39:47 +0000 (18:39 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 2 Jan 2008 00:42:47 +0000 (18:42 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Acquisition.pm
acqui/finishreceive.pl
acqui/parcel.pl
acqui/parcels.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tmpl

index b4b2655..26c2578 100644 (file)
@@ -865,7 +865,7 @@ sub GetParcel {
     }
     $strsth .= " ORDER BY aqbasket.basketno";
     ### parcelinformation : $strsth
-    warn "STH : $strsth";
#   warn "STH : $strsth";
     my $sth = $dbh->prepare($strsth);
     $sth->execute($supplierid);
     while ( my $data = $sth->fetchrow_hashref ) {
index bba6e51..e39f779 100755 (executable)
@@ -22,6 +22,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Context;
 use C4::Output;
 use C4::Acquisition;
 use C4::Biblio;
index e928143..fb95c55 100755 (executable)
@@ -72,7 +72,9 @@ my $count = scalar @booksellers;
 my $invoice=$input->param('invoice') || '';
 my $freight=$input->param('freight');
 my $gst=$input->param('gst');
-my $datereceived=C4::Dates->new($input->param('datereceived'),'iso') || C4::Dates->new();
+my $datereceived =  ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) 
+                                       :  C4::Dates->new($input->param('datereceived'), 'iso')   ;
+$datereceived = C4::Dates->new() unless $datereceived;
 my $code=$input->param('code');
 
 my ($template, $loggedinuser, $cookie)
index a137bc8..213ba23 100755 (executable)
@@ -160,7 +160,8 @@ $template->param(searchresults=>\@loopres, count=>$count) if ($count);
 $template->param(orderby=>$order, filter=>$code, datefrom=>$datefrom,dateto=>$dateto, resultsperpage=>$resultsperpage);
 $template->param(
         name => $booksellers[0]->{'name'},
-        supplierid => $supplierid,
+        DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+               supplierid => $supplierid,
            GST => C4::Context->preference("gist"),
         );
 
index f7d8e36..7da22f8 100644 (file)
@@ -1,6 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Acquisitions &rsaquo; Receive parcel from supplier <!-- TMPL_VAR NAME="name" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
     <div id="parcels_new_parcel">
         <form method="get" action="parcel.pl">
     <fieldset class="rows">
-    <legend>Receive a new Parcel</legend>
+    <legend>Receive a new parcel</legend>
        <ol> <li>
-            <label for="invoice">Supplier Invoice / Parcel Code</label>
+            <label for="invoice">Supplier Invoice </label>
             <input type="hidden" name="supplierid" value="<!-- TMPL_VAR NAME="supplierid" -->" />
-            <input type="text" size="20" id="invoice" name="invoice" />
+            <input type="hidden" name="op" value="new" />
+                       <input type="text" size="20" id="invoice" name="invoice" />
         </li>
                <!-- TMPL_IF NAME="gst" -->
         <li>
         <li>
             <label for="freight">Freight:</label>
             <input type="text" size="20" id="freight" name="freight" />
-        </li></ol>
+        </li>
+         <li><label for="datereceived">Shipment date: </label>
+            <input type="text" id="datereceived" name="datereceived"  maxlength="10" size="10"  value="<!-- TMPL_VAR NAME="datereceived" -->" />
+            <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="datereceived_button" alt="Show Calendar" />
+      <script language="JavaScript" type="text/javascript">
+        Calendar.setup(
+          {
+            inputField : "datereceived",
+            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+            button : "datereceived_button"          }
+        );
+      </script>        </li>
+               </ol>
     </fieldset>
             <fieldset class="action"><input type="submit" class="button" value="Save" /> <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Cancel</a></fieldset>
         </form>