From 2da39d1d356d1d75cfe5d5d5e698cf10a454b1e7 Mon Sep 17 00:00:00 2001 From: Dan Pearl Date: Tue, 19 Mar 2019 14:54:07 -0400 Subject: [PATCH] LP#1820741 - Certain fields to print information about bills in the 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. --- .../share/print_templates/t_bills_current.tt2 | 25 +++++++++++--- .../share/print_templates/t_bills_historical.tt2 | 38 ++++++++++---------- .../js/ui/default/staff/admin/workstation/app.js | 40 ++++++++++++++++------ .../web/js/ui/default/staff/circ/patron/bills.js | 28 ++++++++++++--- 4 files changed, 93 insertions(+), 38 deletions(-) diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2 index cf6df6624a..5cf596ffbf 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_bills_current.tt2 @@ -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}}!
You have the following bills: diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 index 9c66cc9aa8..e2a844b244 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_bills_historical.tt2 @@ -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}}!
You had the following bills: diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js index d863844e3d..04684bc261 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js @@ -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 ], diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js index ceda5c82d4..e41dfa5991 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js @@ -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); } -- 2.11.0