plugged in initial fines list interface
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Dec 2009 22:06:19 +0000 (22:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Dec 2009 22:06:19 +0000 (22:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15112 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Open-ILS/web/templates/default/circ/selfcheck/fines.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/circ/selfcheck/main.tt2
Open-ILS/web/templates/default/circ/selfcheck/summary.tt2

index 96e4a80..8e16638 100644 (file)
@@ -227,7 +227,7 @@ SelfCheckManager.prototype.loginPatron = function(barcode, passwd) {
     } else {
 
         this.handleAlert('', false, 'login-success');
-        dojo.byId('oils-selfck-user-banner').innerHTML = 'Welcome, ' + this.patron.usrname(); // TODO i18n
+        dojo.byId('oils-selfck-user-banner').innerHTML = 'Welcome, ' + this.patron.first_given_name(); // TODO i18n
         this.drawCircPage();
     }
 }
@@ -594,6 +594,52 @@ SelfCheckManager.prototype.drawHolds = function(holds) {
 }
 
 
+SelfCheckManager.prototype.drawFinesPage = function() {
+
+    // TODO add option to hid scanBox
+    // this.updateScanBox(...)
+
+    this.goToTab('fines');
+    progressDialog.show(true);
+
+    this.finesTbody = dojo.byId('oils-selfck-fines-tbody');
+    if(!this.finesTemplate)
+        this.finesTemplate = this.finesTbody.removeChild(dojo.byId('oils-selfck-fines-row'));
+    while(this.finesTbody.childNodes[0])
+        this.finesTbody.removeChild(this.finesTbody.childNodes[0]);
+
+    var self = this;
+    var handler = function(dataList) {
+        for(var i in dataList) {
+            var data = dataList[i];
+            var row = self.finesTemplate.cloneNode(true);
+            var type = data.transaction.xact_type();
+            if(type == 'circulation') {
+                self.byName(row, 'type').innerHTML = type;
+                self.byName(row, 'details').innerHTML = data.record.title();
+            } else if(type == 'grocery') {
+                self.byName(row, 'type').innerHTML = 'Miscellaneous'; // Go ahead and head off any confusion around "grocery".  TODO i18n
+                self.byName(row, 'details').innerHTML = data.transaction.last_billing_type();
+            }
+            self.byName(row, 'total_owed').innerHTML = data.transaction.total_owed();
+            self.byName(row, 'total_paid').innerHTML = data.transaction.total_paid();
+            self.byName(row, 'balance').innerHTML = data.transaction.balance_owed();
+            self.finesTbody.appendChild(row);
+        }
+    }
+
+    fieldmapper.standardRequest( 
+        ['open-ils.actor', 'open-ils.actor.user.transactions.have_balance.fleshed'],
+        {   async : true,
+            params : [this.authtoken, this.patron.id()],
+            oncomplete : function(r) { 
+                progressDialog.hide();
+                handler(openils.Util.readResponse(r));
+            }
+        }
+    );
+}
+
 
 /**
  * Check out a single item.  If the item is already checked 
@@ -859,13 +905,6 @@ SelfCheckManager.prototype.byName = function(node, name) {
 }
 
 
-SelfCheckManager.prototype.drawFinesPage = function() {
-    openils.Util.hide('oils-selfck-circ-page');
-    openils.Util.hide('oils-selfck-holds-page');
-    openils.Util.show('oils-selfck-payment-page');
-}
-
-
 SelfCheckManager.prototype.initPrinter = function() {
     try { // Mozilla only
                netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
diff --git a/Open-ILS/web/templates/default/circ/selfcheck/fines.tt2 b/Open-ILS/web/templates/default/circ/selfcheck/fines.tt2
new file mode 100644 (file)
index 0000000..423cc25
--- /dev/null
@@ -0,0 +1,22 @@
+<div id='oils-selfck-fines-table-div'>
+    <table id='oils-selfck-fines-table' class='oils-selfck-item-table'>
+        <thead>
+            <tr>
+                <td>Type</td>
+                <td>Details</td>
+                <td>Total Owed</td>
+                <td>Total Paid</td>
+                <td>Balance Owed</td>
+            </tr>
+        </thead>
+        <tbody id='oils-selfck-fines-tbody'>
+            <tr id='oils-selfck-fines-row'>
+                <td name='type'></td>
+                <td name='details'></td>
+                <td name='total_owed'></td>
+                <td name='total_paid'></td>
+                <td name='balance' style='color:red;'></td>
+            </tr>
+        </tbody>
+    </table>
+</div>
index a0020d8..ab74e07 100644 (file)
@@ -13,7 +13,7 @@
             <a id='oils-selfck-print-list-link' href='javascript:void(0);'>Print List</a>
         </div>
         <div id='oils-selfck-circ-page' class='hidden'>
-            <!-- Checkout / renewal interface -->
+            <!-- Checkout / renewal and items out interface -->
             [% INCLUDE 'default/circ/selfcheck/circ_page.tt2' %]
         </div>
         <div id='oils-selfck-holds-page' class='hidden'>
@@ -21,7 +21,8 @@
             [% INCLUDE 'default/circ/selfcheck/holds_page.tt2' %]
         </div>
         <div id='oils-selfck-payment-page' class='hidden'>
-            <!-- Credit Card payments interface -->
+            <!-- Fines and credit card payments interface -->
+            [% INCLUDE 'default/circ/selfcheck/fines.tt2' %]
         </div>
     </div>
     <div id='oils-selfck-summary-div'>
index 9bcacb6..d708073 100644 (file)
@@ -19,7 +19,7 @@
     <fieldset>
         <legend>Fines</legend>
         <div id='oils-selfck-fines-total'></div>
-        <div class='hidden'><a href='javascript:void(0);' id='oils-selfck-pay-fines-link'>Pay fines</a></div>
+        <div><a href='javascript:void(0);' id='oils-selfck-pay-fines-link'>View Fines</a></div>
     </fieldset>
 </div>