From 13a23d9eddb4bb46bb38af063c222e53a9f7e330 Mon Sep 17 00:00:00 2001
From: pines
Date: Fri, 1 Sep 2006 20:35:31 +0000
Subject: [PATCH] title in bill receipts
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5840 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
.../chrome/content/OpenILS/data.js | 2 +-
.../staff_client/chrome/content/util/print.js | 3 ++-
.../server/circ/print_list_template_editor.js | 4 ++--
.../xul/staff_client/server/patron/bills.js | 21 +++++++++++++++++--
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
index 5009ea028c..74a7d9f875 100644
--- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
+++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
@@ -168,7 +168,7 @@ OpenILS.data.prototype = {
'bill_payment' : {
'type' : 'payment',
'header' : 'Welcome to %LIBRARY%!
A receipt of your transaction:
Original Balance: | $%original_balance% |
Payment Method: | %payment_type% |
Payment Received: | $%payment_received% |
Payment Applied: | $%payment_applied% |
Billings Voided: | %voided_balance% |
Change Given: | $%change_given% |
New Balance: | $%new_balance% |
Note: %note%
Specific bills:
',
- 'line_item' : 'Bill #%bill_id% Received: $%payment%
',
+ 'line_item' : 'Bill #%bill_id% %last_billing_type% Received: $%payment%
%title%
',
'footer' : '
%PINES_CODE% %TODAY_TRIM%
',
},
'bills_historical' : {
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js
index d154ece1c3..63033b8868 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -146,7 +146,8 @@ util.print.prototype = {
);
break;
case 'payment':
- cols = [ '%bill_id%','%payment%'];
+ //cols = [ '%bill_id%','%payment%'];
+ cols = [];
break;
case 'holds':
JSAN.use('circ.util');
diff --git a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
index 47a6414d83..1fd72eea69 100644
--- a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
+++ b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
@@ -46,7 +46,7 @@ circ.print_list_template_editor.prototype = {
'items' : [["7608453","???","1497190","31033007616786","J 551.48 ARATO R","MGRL-RC","1","Stacks","Short","MGRL-RC","Low","Yes","Yes","Yes","No","No","0","19.95","","","???","???","???","???","World of water ","Arato, Rona.","","0778714160 (rlb : alk. paper)","c2005","Crabtree Pub. Co.","ocm55600795 ","???","???","Available","???","???","3",""],["7136201","???","1424085","31001000224056","YA ROWLING","ARL-ATH","3","Stacks","Short","ARL-ATH","Low","Yes","Yes","Yes","No","No","0","7.99","","","???","???","???","???","Harry Potter and the prisoner of Azkaban ","Rowling, J. K.","","0439136350 (hc)","1999","Arthur A. Levine Books","ocm41266045 ","???","???","Available","???","???","2","alert message here"],["6577928","???","1301532","31041005919235","975.8784 HAG","OHOOP-LADS","1","Stacks","Short","OHOOP-LADS","Low","Yes","Yes","Yes","No","No","0","10","","","???","???","???","???","Georgia genealogical sources series marriages 1869-1879, Appling County Georgia","Hageness, MariLee Beatty.","","","c1998","MLH Research","ocm49507123 ","???","???","Available","???","???","15","high use item"]],
'holds' : [["2006-05-13","2006-05-18 16:37:47.062916-04","","T","Athens-Clarke County Library","ARL-ATH","33207004749414","No","","","","7","999-999-9999","2006-05-15 00:37:28.269456-04","3","0","818781","3","Harry Potter and the goblet of fire ","Rowling, J. K.","Large print ed.","0786229276 (lg. print : hc : alk. paper)","2000","Thorndike Press","i0786229276"],["2006-05-16","2006-05-18 20:07:04.474747-04","","T","Athens-Clarke County Library","ARL-ATH","33207004347359","Yes","","","","8","777-777-7777","2006-05-18 16:52:23.866001-04","1000000","0","551071","1000524","Cats ","Arnold, Caroline.","","0822530325 (alk. paper)","1999","Lerner Publications","i0822530325"],["2006-05-17","2006-05-18 20:08:32.882203-04","","T","Athens-Clarke County Library","ARL-ATH","33207002398776","Yes","","","","28","999-999-9999","2006-05-18 16:52:58.020117-04","1000000","0","1274439","3","Tortilla Flat ","Steinbeck, John","","0140042407 (pbk.) :","1986, c1935","Penguin Books","a2095783"],["2006-05-10","2006-05-20 21:02:57.318012-04","","T","Athens-Clarke County Library","ARL-ATH","33207003330208","No","","","","4","222-333-4444","2006-05-18 16:52:23.362607-04","3","0","315900","3","Spreadin\' rhythm around Black popular songwriters, 1880-1930","Jasen, David A.","","0028647424","c1998","Schirmer Books","i0028647424"],["2006-05-20","2006-05-20 21:11:42.124176-04","","T","Athens-Clarke County Library","ARL-ATH","33207001049453","Yes","","","","54","218-233-3757","2006-05-20 19:48:12.101796-04","1000000","0","323269","1000567","Foundation and empire ","Asimov, Isaac","","0893402109","1979","J. Curley","i0893402109"],["2006-05-20","2006-05-20 21:19:15.209143-04","","T","Athens-Clarke County Library","ARL-ATH","33207001502782","Yes","","","","63","218-233-3757","2006-05-20 19:48:37.645795-04","1000567","0","427831","1000567","The Caine mutiny : a novel of World War II","Wouk, Herman","","","1952 [c1951]","Doubleday","PIN24075557"],["2006-06-03","2006-06-07 17:03:32.676709-04","","V","Athens-Clarke County Library","ARL-ATH","No Copy","No","","","","135","999-999-9999","2006-06-05 23:45:18.078505-04","3","0","6592393","3","No Title?","No Author?","???","???","???","???","???"]],
'bills' : [["248","Id = 3","grocery","-2.00","0.00","2.00","","Fee for copies","2006-05-27 22:56","","cash_payment","2006-06-10 17:01","2006-05-27",""],["239","Id = 3","circulation","17.00","17.00","0.00","SYSTEM GENERATED","Lost Materials Processing Fee","2006-05-27 22:07","",""," ","2006-05-26",""],["173","Id = 3","grocery","1.00","17.25","16.25","","Lost materials","2006-05-20 16:36","","cash_payment","2006-05-27 01:31","2006-05-20",""]],
- 'payment' : [ [333, '2.23'], [367, '5.17' ] ],
+ 'payment' : [ { 'bill_id' : 333, 'payment' : '2.23', 'title' : 'Harry Potter', 'last_billing_type' : 'Overdue materials', 'last_billing_note' : 'System Generated Overdue Fine' }, { 'bill_id' : 367, 'payment' : '5.17', 'last_billing_type' : 'Damaged material', 'last_billing_note' : 'Tracked up the carpet' } ],
'patrons' : [],
'offline_checkout' : [],
'offline_checkin' : [],
@@ -154,7 +154,7 @@ circ.print_list_template_editor.prototype = {
);
break;
case 'payment' :
- macros = [ '%original_balance%', '%payment_received%', '%payment_applied%', '%payment_type%', '%voided_balance%', '%change_given%', '%new_balance%', '%note%', '%bill_id%', '%payment%' ];
+ macros = [ '%original_balance%', '%payment_received%', '%payment_applied%', '%payment_type%', '%voided_balance%', '%change_given%', '%new_balance%', '%note%', '%bill_id%', '%payment%', '%title%' ];
break;
}
var macro_string = macros.join(', ');
diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js
index b261bb84b3..2169131940 100644
--- a/Open-ILS/xul/staff_client/server/patron/bills.js
+++ b/Open-ILS/xul/staff_client/server/patron/bills.js
@@ -17,6 +17,8 @@ patron.bills = function (params) {
patron.bills.prototype = {
+ 'bill_map' : {},
+
'current_payments' : [],
'SHOW_ME_THE_BILLS' : 'FM_MOBTS_HAVING_BALANCE',
@@ -83,6 +85,7 @@ patron.bills.prototype = {
'attributes' : { 'allowevents' : true }
}
);
+ obj.bill_map[ obj.bills[i].transaction.id() ] = obj.bills[i];
var cb = rnode.getElementsByTagName('checkbox')[0];
var tb = rnode.getElementsByTagName('textbox')[0];
var bo = obj.bills[i].transaction.balance_owed();
@@ -487,7 +490,7 @@ patron.bills.prototype = {
try {
obj.data.stash_retrieve();
var template = 'bill_payment';
- JSAN.use('patron.util');
+ JSAN.use('patron.util'); JSAN.use('util.functional');
var params = {
'patron' : patron.util.retrieve_au_via_id(ses(),obj.patron_id),
'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
@@ -496,9 +499,21 @@ patron.bills.prototype = {
'line_item' : obj.data.print_list_templates[template].line_item,
'footer' : obj.data.print_list_templates[template].footer,
'type' : obj.data.print_list_templates[template].type,
- 'list' : payment_blob.payments,
+ 'list' : util.functional.map_list(
+ payment_blob.payments,
+ function(o) {
+ return {
+ 'bill_id' : o[0],
+ 'payment' : o[1],
+ 'last_billing_type' : obj.bill_map[ o[0] ].transaction.last_billing_type(),
+ 'last_billing_note' : obj.bill_map[ o[0] ].transaction.last_billing_note(),
+ 'title' : typeof obj.bill_map[ o[0] ].title != 'undefined' ? obj.bill_map[ o[0] ].title : '',
+ };
+ }
+ ),
'data' : obj.previous_summary,
};
+ obj.error.sdump('D_DEBUG',js2JSON(params));
if (document.getElementById('auto_print').checked) params.no_prompt = true;
JSAN.use('util.print'); var print = new util.print();
print.tree_list( params );
@@ -794,6 +809,7 @@ patron.bills.prototype = {
var r_mvr = rreq.getResultObject();
if (instanceOf(r_mvr,mvr)) {
xt_value.appendChild( document.createTextNode( r_mvr.title().substr(0,50) ) );
+ obj.bill_map[ my.mobts.id() ].title = r_mvr.title();
} else {
obj.network.simple_request(
'FM_ACP_RETRIEVE',
@@ -802,6 +818,7 @@ patron.bills.prototype = {
var r_acp = rrreq.getResultObject();
if (instanceOf(r_acp,acp)) {
xt_value.appendChild( document.createTextNode( r_acp.dummy_title() ) );
+ obj.bill_map[ my.mobts.id() ].title = r_acp.dummy_title();
}
}
);
--
2.43.2