Template for bill payment receipts. Data specific to this template
includes:
+* patron - has several fields from the patron object, including a financial summary
+
+ * first_given_name
+ * second_given_name
+ * family_name
+ * suffix
+ * card.barcode
+ * expire_date
+ * alias - aka Holds Alias
+ * has_email - boolean value to show/hide elements on the receipt
+ * has_phone - same as has_email
+
* current_location.name - name of workstation location
* payment_type
* payment_total - total paid
<!--
Template for printing checkout receipts; fields available include:
-* patron_money - summary of the patron's current financial obligations:
+* patron - has several fields from the patron object, including a financial summary
- * patron_money.balance_owed - current balance
- * patron_money.total_paid - payments made on outstanding fines/fees
- * patron_money.total_owed - total of outstanding fines/fees
+ * first_given_name
+ * second_given_name
+ * family_name
+ * suffix
+ * card.barcode
+ * money_summary.balance_owed - current balance
+ * money_summary.total_paid - payments made on outstanding fines/fees
+ * money_summary.total_owed - total of outstanding fines/fees
+ * expire_date
+ * alias - aka Holds Alias
+ * has_email - boolean value to show/hide elements on the receipt
+ * has_phone - same as has_email
* circulations - list of loans made during this session. Each
includes:
* title
- * copy_barcode
- * due_date
+ * author
+ * copy.barcode
+ * circ.due_date
-->
<div>
Template for printing a list of items that a patron has checked out.
Fields include:
+* patron - has several fields from the patron object, including a financial summary
+
+ * first_given_name
+ * second_given_name
+ * family_name
+ * suffix
+ * card.barcode
+ * money_summary.balance_owed - current balance
+ * money_summary.total_paid - payments made on outstanding fines/fees
+ * money_summary.total_owed - total of outstanding fines/fees
+ * expire_date
+ * alias - aka Holds Alias
+ * has_email - boolean value to show/hide elements on the receipt
+ * has_phone - same as has_email
+
* circulations - list of current loans, including
+ * title
+ * author
+ * call_number.label
* copy.barcode
* circ.due_date
- * title
-->
<div>
// alongside the templates.
// NOTE: A lot of this data can be shared across templates.
var seed_user = {
+ prefix : 'Mr',
first_given_name : 'Slow',
second_given_name : 'Joe',
family_name : 'Jones',
+ suffix : 'III',
card : {
barcode : '30393830393'
- }
+ },
+ money_summary : {
+ balance_owed : 4, // This is currently how these values are returned to the client
+ total_billed : '5.00',
+ total_paid : '1.00'
+ },
+ expire_date : '2020-12-31',
+ alias : 'the dude',
+ has_email : true,
+ has_phone : false
}
var seed_addr = {
street1 : '123 Apple Rd',
function printReceipt(type, payment_ids, payments_made, note) {
var payment_blobs = [];
+ var cusr = patronSvc.current;
+
angular.forEach(payments_made, function(payment) {
var xact_id = payment[0];
payments : payment_blobs,
current_location : egCore.idl.toHash(
egCore.org.get(egCore.auth.user().ws_ou()))
- }
+ };
+
+ // Not a good idea to use patron_stats.fines for this; it's out of date
+ print_data.patron = {
+ prefix : cusr.prefix(),
+ first_given_name : cusr.first_given_name(),
+ second_given_name : cusr.second_given_name(),
+ family_name : cusr.family_name(),
+ suffix : cusr.suffix(),
+ card : { barcode : cusr.card().barcode() },
+ expire_date : cusr.expire_date(),
+ alias : cusr.alias(),
+ has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+ has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+ };
print_data.new_balance = (
print_data.previous_balance * 100 -
}
$scope.print_receipt = function() {
- var print_data = {circulations : []}
+ var print_data = {circulations : []};
+ var cusr = patronSvc.current;
if ($scope.checkouts.length == 0) return $q.when();
};
});
+ // This is repeated in patron.* so everyting is in one place but left here so existing templates don't break.
print_data.patron_money = patronSvc.patron_stats.fines;
+ print_data.patron = {
+ prefix : cusr.prefix(),
+ first_given_name : cusr.first_given_name(),
+ second_given_name : cusr.second_given_name(),
+ family_name : cusr.family_name(),
+ suffix : cusr.suffix(),
+ card : { barcode : cusr.card().barcode() },
+ money_summary : patronSvc.patron_stats.fines,
+ expire_date : cusr.expire_date(),
+ alias : cusr.alias(),
+ has_email : Boolean($scope.has_email_address()),
+ has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+ };
return egCore.print.print({
context : 'default',
$scope.print_receipt = function(items) {
if (items.length == 0) return $q.when();
- var print_data = {circulations : []}
+ var print_data = {circulations : []};
+ var cusr = patronSvc.current;
angular.forEach(patronSvc.items_out, function(circ) {
print_data.circulations.push({
})
});
+ print_data.patron = {
+ prefix : cusr.prefix(),
+ first_given_name : cusr.first_given_name(),
+ second_given_name : cusr.second_given_name(),
+ family_name : cusr.family_name(),
+ suffix : cusr.suffix(),
+ card : { barcode : cusr.card().barcode() },
+ money_summary : patronSvc.patron_stats.fines,
+ expire_date : cusr.expire_date(),
+ alias : cusr.alias(),
+ has_email : Boolean(patronSvc.current.email() && patronSvc.current.email().match(/.*@.*/).length),
+ has_phone : Boolean(cusr.day_phone() || cusr.evening_phone() || cusr.other_phone())
+ };
+
return egCore.print.print({
context : 'default',
template : 'items_out',