LP#1820741 - Certain fields to print information about bills in the
authorDan Pearl <dpearl@cwmars.org>
Tue, 19 Mar 2019 18:54:07 +0000 (14:54 -0400)
committerDan Pearl <dpearl@cwmars.org>
Fri, 17 May 2019 16:42:56 +0000 (12:42 -0400)
print receipt were not available.  The fix is a combination of a) documenting
the correct field names, b) enhancing the preview mechanism so that the data
can be visualized when the print receipt is edited, and c) ensuring that the
data itself is available when printing the receipt.

Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2
Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index cf6df66..5cf596f 100644 (file)
@@ -18,11 +18,28 @@ to this template includes:
     patron.has_email - Whether or not the patron has an email address
     patron.has_phone - Whether or not the patron has a phone number
     pref_ versions of all name fields (e.g. pref_family_name);
-* transasctions - a list of transactions, each of which
-  contains:
+* transasctions - a list of transactions, each of which contains:
+    xact.id - Bill unique id
+    xact.title - Copy title
+    xact.copy_barcode - Copy barcode
+    xact.xact_finish - Billing finish date and time
+    xact.xact_start - Billing start date and time
     xact.summary - information about the transaction
-    xact.title - Item title
-    xact.copy_barcode - Item barcode
+      xact.summary.balance_owed - Balance owed
+      xact.summary.last_billing_note - Last billing note
+      xact.summary.last_billing_type - Last billing type
+      xact.summary.last_payment_note - Last payment note
+      xact.summary.last_payment_ts - Last payment date and time
+      xact.summary.last_payment_type - Last payment type
+      xact.summary.total_owed - Total billed
+      xact.summary.total_paid - Total paid
+      xact.summary.xact_type - Billing type
+    xact.call_number - Information about the copy
+      xact.call_number.label - Copy call number
+      xact.call_number.prefix - Copy call number prefix
+      xact.call_number.suffix - Copy call number suffix
+      xact.call_number.owning_lib.name - The owning library's name
+      xact.call_number.owning_lib.shortname - The owning library's shortname
 -->
 Welcome to {{current_location.name}}!<br/>
 You have the following bills:
index 9c66cc9..e2a844b 100644 (file)
@@ -19,25 +19,27 @@ to this template includes:
     patron.has_phone - Whether or not the patron has a phone number
     pref_ versions of all name fields (e.g. pref_family_name);
 * transasctions - a list of transactions, each of which contains:
-  xact.id - Bill unique id
-  xact.copy_barcode - Item barcode
-  xact.xact_finish - Billing finish date and time
-  xact.xact_start - Billing start date and time
-  xact.summary - Information about the transaction
-    xact.summary.balance_owed - Balance owed
-    xact.summary.last_billing_note - Last billing note
-    xact.summary.last_billing_type - Last billing type
-    xact.summary.last_payment_note - Last payment note
-    xact.summary.last_payment_ts - Last payment date and time 
-    xact.summary.last_payment_type - Last payment type
-    xact.summary.total_owed - Total billed 
-    xact.summary.total_paid - Total paid
-    xact.summary.xact_type - Billing type 
-  xact.title - Item title
+    xact.id - Bill unique id
+    xact.title - Copy title
+    xact.copy_barcode - Copy barcode
+    xact.xact_finish - Billing finish date and time
+    xact.xact_start - Billing start date and time
     xact.summary - information about the transaction
-    xact.title - Item title
-    xact.copy_barcode - Item barcode
-
+      xact.summary.balance_owed - Balance owed
+      xact.summary.last_billing_note - Last billing note
+      xact.summary.last_billing_type - Last billing type
+      xact.summary.last_payment_note - Last payment note
+      xact.summary.last_payment_ts - Last payment date and time
+      xact.summary.last_payment_type - Last payment type
+      xact.summary.total_owed - Total billed
+      xact.summary.total_paid - Total paid
+      xact.summary.xact_type - Billing type
+    xact.call_number - Information about the copy
+      xact.call_number.label - Copy call number
+      xact.call_number.prefix - Copy call number prefix
+      xact.call_number.suffix - Copy call number suffix
+      xact.call_number.owning_lib.name - The owning library's name
+      xact.call_number.owning_lib.shortname - The owning library's shortname
 -->
 Welcome to {{current_location.name}}!<br/>
 You had the following bills:
index d863844..04684bc 100644 (file)
@@ -481,31 +481,49 @@ function($scope , $q , egCore , ngToast) {
                 xact_start : new Date().toISOString(),
                 xact_finish : new Date().toISOString(),
                 summary : {
-                    xact_type : 'circulation',
+                    balance_owed : 1.00,
+                    last_billing_note : 'Test Note 1',
                     last_billing_type : 'Overdue materials',
-                    total_owed : 1.50,
                     last_payment_note : 'Test Note 1',
-                    last_payment_type : 'cash_payment',
                     last_payment_ts : new Date().toISOString(),
+                    last_payment_type : 'cash_payment',
+                    total_owed : 1.50,
                     total_paid : 0.50,
-                    balance_owed : 1.00
-                }
+                    xact_type : 'circulation'
+                    },
+                call_number : {
+                    label : 'GL 510.2',
+                    prefix : 'DISPLAY',
+                    suffix : 'YA',
+                    owning_lib : {
+                       name : 'Regina Public Library'
+                       }
+                    }
             }, {
                 id : 2,
                 xact_start : new Date().toISOString(),
                 xact_finish : new Date().toISOString(),
                 summary : {
-                    xact_type : 'circulation',
+                    balance_owed : 1.00,
+                    last_billing_note : 'Test Note 2',
                     last_billing_type : 'Overdue materials',
-                    total_owed : 2.50,
                     last_payment_note : 'Test Note 2',
-                    last_payment_type : 'credit_payment',
                     last_payment_ts : new Date().toISOString(),
+                    last_payment_type : 'credit_payment',
+                    total_owed : 1.50,
                     total_paid : 0.50,
-                    balance_owed : 2.00
+                    xact_type : 'circulation'
+                    },
+                call_number : {
+                    label : 'GL 510.2',
+                    prefix : 'DISPLAY',
+                    suffix : 'YA',
+                    owning_lib : {
+                       name : 'Regina Public Library'
+                       }
+                    }
                 }
-            }
-        ],
+           ],
 
         copy : seed_copy,
         copies : [ seed_copy ],
index ceda5c8..e41dfa5 100644 (file)
@@ -558,7 +558,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                 'mbt' : ['summary', 'circulation'],
                 'circ' : ['target_copy'],
                 'acp' : ['call_number'],
-                'acn' : ['record'],
+                'acn' : ['record','owning_lib','prefix','suffix'],
                 'bre' : ['simple_record']
                 }
             },
@@ -608,8 +608,17 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                     xact_start : xact.xact_start(),
                 }
                 if (xact.circulation()) {
-                    newXact.copy_barcode = xact.circulation().target_copy().barcode(),
-                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title()
+                    newXact.copy_barcode = xact.circulation().target_copy().barcode();
+                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title();
+                    newXact.call_number = {
+                        label  : xact.circulation().target_copy().call_number().label(),
+                        prefix : xact.circulation().target_copy().call_number().prefix().label(),
+                        suffix : xact.circulation().target_copy().call_number().suffix().label(),
+                        owning_lib : {
+                            name : xact.circulation().target_copy().call_number().owning_lib().name(),
+                            shortname : xact.circulation().target_copy().call_number().owning_lib().shortname()
+                                     }
+                        }
                 }
                 xacts.push(newXact);
             }
@@ -1057,7 +1066,7 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
                 'mbt' : ['summary', 'circulation'],
                 'circ' : ['target_copy'],
                 'acp' : ['call_number'],
-                'acn' : ['record'],
+                'acn' : ['record','owning_lib','prefix','suffix'],
                 'bre' : ['simple_record']
                 }
             },
@@ -1108,7 +1117,16 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
                 }
                 if (xact.circulation()) {
                     newXact.copy_barcode = xact.circulation().target_copy().barcode(),
-                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title()
+                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title();
+                    newXact.call_number = {
+                        label  : xact.circulation().target_copy().call_number().label(),
+                        prefix : xact.circulation().target_copy().call_number().prefix().label(),
+                        suffix : xact.circulation().target_copy().call_number().suffix().label(),
+                        owning_lib : {
+                            name : xact.circulation().target_copy().call_number().owning_lib().name(),
+                            shortname : xact.circulation().target_copy().call_number().owning_lib().shortname()
+                                     }
+                        }
                 }
                 xacts.push(newXact);
             }